Repository navigation
v0.4.0rc5: tie-break gives no parent, ImageJ unit without resolution, plan Q66/Q73/Q74, changelog - #143
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
pair_counts took the first parent in label order when two or more parents shared a child's largest overlap exactly, so inside and parents_with_N_children depended on the label numbering. A tie now gives no parent; when the tied share would make the child inside it is counted as ambiguous_parent. The report is version 3; masks, the notebook card and the relationship table show it. The overlap helpers move to the pure module mask_pairs (mask_scan stays under 600 lines). Tests: the tie, three tied parents, a tie below the largest overlap, random masks under permuted labels, best_parents against a reference. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
…, as invalid An ImageJ TIFF with a unit but neither XResolution nor YResolution read as uncalibrated with no reason; it is now invalid_physical_calibration, "a unit without a resolution" (owner, 3 November 2026). A TIFF file without pages, which tifffile opens with only a log message, gives the reason "no pages". A file with neither unit nor resolution is still uncalibrated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
Q66 confirmed by the owner (3 November 2026); Q73's follow-up decided: neither a stated reshape nor a reorder in v0.4, kept in issue #144; Q74 records the tie-break and the consumers checked. The changelog gains a section for rc5 (PRs #139, #140, #142, #143) with migration notes: mounts refused, position_id required in v2, micrometre conversion within 1 ULP, --verify-content, and the tie-break. The migration guide gets the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
guijacquemet
marked this pull request as ready for review
November 3, 2026 14:09
… on its own Review of #143. In check and run a TIFF without pages is the error unreadable_tiff (its header has no series), as before rc5; only read_physical_sizes gives it the "no pages" reason. The CHANGELOG, contract, migration guide and user guide said it was invalid_physical_calibration. They also said every tied child is ambiguous_parent; only a tie whose share reaches inside_pixel_share is, and a smaller one stays split, as the contract and plan Q74 state. Tests: the folder check of a TIFF without pages; every count but child_pixels_with_parent_label is unchanged when the child and parent masks are relabelled independently (three inside shares, ties present). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
Contributor
Author
|
Independent adversarial review of the rc5 PR, starting at head 83ce987. Verdict: ready to merge after one documentation fix (e5e6a74). Tie-break (Q74). It holds up.
ImageJ / no pages.
Release.
§9.
Gate on e5e6a74:
Generated by Claude Code |
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.
Summary
The owner's decisions of 3 November 2026, and version 0.4.0rc5.
Masks: a tie between parents gives no parent (plan §12 Q74)
mask_scan.pair_counts: before,np.lexsort((-shared, kid))was stable, so when two or more parents shared a child's largest overlap exactly, the child went to the parent with the lowest label index. That was the only tie path: thesame_objectscounts come from a maximum matching, whose size does not depend on label numbering (Q67), and the hierarchy is sorted by name.mask_pairs.pywithbest_parents(gives each child's largest overlap and whether it is tied), plusone_to_one_matchesandmatch_counts, moved frommask_scanso that it stays under 600 lines.mask_scanstill re-exportsone_to_one_matches. The layer is declaredpure.inside. If the tied share would make it inside (at leastinside_pixel_share), it is counted in the new evidenceambiguous_parent. A tie below that share issplit_between_parents, as before (it gets no parent either way). Every child is counted in exactly one ofinside,ambiguous_parent,split_between_parentsoroutside_parents.MASK_REPORT_VERSION2 -> 3.mask_text: newmask_ambiguous_lines.mask_report_summary(themaskscommand) has an "Objects given no parent" section that covers every pair, including pairs whose relation isnone. The relationship table has a new last column. The notebook's Describe the masks card shows the lines.TIFF calibration (
physical_sizes,tiff_size_values)XResolutionnorYResolutionnow warnsinvalid_physical_calibrationwith the reason "X, Y: the unit 'um' is given but neither the XResolution nor the YResolution tag is (a unit without a resolution)". Before, it read as uncalibrated with no reason.Docs
ambiguous_parentrow) and §11 (the two new causes ofinvalid_physical_calibration).maskscommand, message table) and AGENTS.md repo map.position_idrequired in v2, µm conversion within 1 ULP,--verify-content, the tie-break), plus entries under 0.4.0. Migration guide: §5, §10, §11 and §13.Version: 0.4.0rc5 in
pyproject.toml, the notebook (current_version,RELEASE_TAGand the Step 0 callout),notebook_latest_versions.yaml, the README and the user guide. Historical rc4 mentions are kept: the rc4 manifest fixture and its test, the contract's "rc4 keys", and the plan's rc4 entries.Consumers of the tie-break fields (read-only grep, 3 November 2026)
438e6d4(branchclaude/fix-audit2) and atorigin/main79adc3a.9e66ca6(branchclaude/request-check-hook) and atorigin/main142c448.inside,parents_with_*,split_between_parents,outside_parents,inside_parent_larger,ambiguous_parent,mask_relationships,pair_counts,scan_masks,MaskReport.insidein CellPatchertests/test_notebook_session.py.docs/contracts/provider-api.mduses "inside" for region masks, and D79 in the decision ledger says "the mask scan lives in preprocessing".Decisions
inside_pixel_sharestayssplit_between_parents, notambiguous_parent, because it gets no parent under either rule. The no-pages case is reported as invalid rather than raised.Notes for review
child_pixels_with_parent_labelcompares label values, as designed (it is thegrouped_byevidence). So the permutation test applies one label map to both masks; independent maps would change that count legitimately.best_parentspatched to report no ties (the old lowest-index choice), 7 of the 9 tie tests fail. Against the old source, the 3 new TIFF tests fail.ruff check --ignore-noqagives 60 findings, the same 60 asorigin/main, all existing noqa'd entries.tools/code_rules.pyand its baseline are unchanged (SHAcc04a420).Tests
Local, Python 3.13,
.[dev,notebook,zarr](zarr 3): 2197 passed, 4 skipped, 0 failed.ruff check .,ruff format --check .andpython tools/check.py --rulesall pass.🤖 Generated with Claude Code
https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc