parentbeta_reconstruct: exit cleanly when no parent survives the nulls#8
Merged
Merged
Conversation
When the iterative extraction finds no prior-beta parent that beats the random and decoy nulls, `parents` is empty and the GATE 5/6 block crashed on `p1=parents[0]` with IndexError -- after already printing "=> 0 significant prior-beta grain(s)", so the run looked like it had succeeded up to the crash. Sparse scans land here legitimately: a small-area or coarse-step map has too few recurring orientations to resolve a parent at the default min-cluster-size. On one 20x20 um scan at min-cluster-size 30 this crashed; the same scan resolves 1 parent at size 10. Guard it: if no parent survives, write a well-formed EMPTY reconstruction.npz (so downstream variant_coherence.py finds a file rather than FileNotFoundError) and exit(0) with a message suggesting a smaller min-cluster-size. Verified against the exact case that crashed: min-cluster-size 30 on that scan now prints "0 parents, writing empty reconstruction" and exits 0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When the iterative extraction finds no prior-β parent that beats the random and decoy
nulls,
parentsis empty and the GATE 5/6 block crashed onp1=parents[0]withIndexError — after printing "=> 0 significant prior-beta grain(s)", so the run looked
like it had succeeded right up to the crash.
Sparse scans land here legitimately: a small-area or coarse-step map has too few recurring
orientations to resolve a parent at the default min-cluster-size. Found while folding a
20×20 µm scan into the cross-series — it crashed at min-cluster-size 30 and resolves 1
parent at size 10.
Fix: if no parent survives, write a well-formed empty
reconstruction.npz(sodownstream
variant_coherence.pyfinds a file rather than FileNotFoundError) andexit(0)with a message suggesting a smaller min-cluster-size.
Verified against the exact crash case: min-cluster-size 30 on that scan now prints
"0 parents, writing empty reconstruction" and exits 0, instead of the IndexError.