Skip to content

Commit

Permalink
improve unconnected cross MFOV logging
Browse files Browse the repository at this point in the history
  • Loading branch information
trautmane committed Mar 26, 2024
1 parent 0350acc commit b6b5ae8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,15 @@ public void addUnconnectedPair(final OrderedMFOVPair unconnectedPair) {
unconnectedMFOVPairs.add(unconnectedPair);
}

@Override
public String toString() {
return "{'renderStackId': '" + renderStackId.toDevString() +
"', 'mFOVMontageStackName': '" + mFOVMontageStackName +
"', 'matchCollectionId': '" + matchCollectionId.toDevString() +
"', 'unconnectedMFOVPairs': [" + unconnectedMFOVPairs +
"]}";
}

public static List<UnconnectedMFOVPairsForStack> load(final String dataFile)
throws IOException, IllegalArgumentException {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.janelia.render.client.multisem;

import com.beust.jcommander.ParametersDelegate;
import com.fasterxml.jackson.core.JsonProcessingException;

import java.io.IOException;
import java.nio.file.Path;
Expand All @@ -14,7 +13,6 @@
import java.util.Set;
import java.util.stream.Collectors;

import org.janelia.alignment.json.JsonUtils;
import org.janelia.alignment.match.CanvasMatches;
import org.janelia.alignment.match.MatchCollectionId;
import org.janelia.alignment.multisem.LayerMFOV;
Expand Down Expand Up @@ -146,10 +144,10 @@ public void logOrStoreUnconnectedMFOVPairs(final List<UnconnectedMFOVPairsForSta
}
}

public static void logUnconnectedMFOVPairs(final List<UnconnectedMFOVPairsForStack> unconnectedMFOVsForAllStacks)
throws JsonProcessingException {
LOG.info("findUnconnectedMFOVs: unconnected MFOV pairs for all stacks are: \n{}",
JsonUtils.FAST_MAPPER.writeValueAsString(unconnectedMFOVsForAllStacks));
public static void logUnconnectedMFOVPairs(final List<UnconnectedMFOVPairsForStack> unconnectedMFOVsForAllStacks) {
for (final UnconnectedMFOVPairsForStack unconnectedMFOVPairs : unconnectedMFOVsForAllStacks) {
LOG.info("found unconnected MFOV pairs {}", unconnectedMFOVPairs);
}
}

public static void storeUnconnectedMFOVPairs(final List<UnconnectedMFOVPairsForStack> unconnectedMFOVsForAllStacks,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import static org.janelia.render.client.multisem.UnconnectedCrossMFOVClient.logUnconnectedMFOVPairs;

/**
* Spark client for patching matches missing from adjacent SFOV tile pairs within the same MFOV and z layer.
* Core logic is implemented in {@link org.janelia.render.client.multisem.MFOVMontageMatchPatchClient}.
Expand Down Expand Up @@ -103,9 +105,9 @@ public void runPipelineStep(final JavaSparkContext sparkContext,
findUnconnectedMFOVs(sparkContext, clientParameters);

if (! unconnectedMFOVsForAllStacks.isEmpty()) {
final String errorMessage =
"found " + unconnectedMFOVsForAllStacks.size() + " stacks with unconnected MFOVs";
LOG.error("runPipelineStep: {}: {}", errorMessage, unconnectedMFOVsForAllStacks);
final String errorMessage = "found " + unconnectedMFOVsForAllStacks.size() + " stacks with unconnected MFOVs";
LOG.error("runPipelineStep: {}", errorMessage);
logUnconnectedMFOVPairs(unconnectedMFOVsForAllStacks);
throw new IOException(errorMessage);
} else {
LOG.info("runPipelineStep: all MFOVs in all stacks are connected");
Expand Down

0 comments on commit b6b5ae8

Please sign in to comment.