Repository navigation
Quick fixes B: channel QC, previews, notebook cards and state, results lifecycle - #530
Merged
Merged
Conversation
A third channel whose nearest channel is already paired in a mutual swap no longer overwrites that partner's pairing; it stays a plain swap finding, so one channel is never reported in two incompatible swaps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
The same file read through other roles names other pixels for the same coordinates, so the roles (axes, roles, singleton roles) are now part of the PreviewCache key, for reads and for the discard after a rewrite. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
ViewRequest and header_channels now raise a ValueError naming the value when the number of channels to draw is not a whole number of at least 1, instead of an IndexError, AttributeError or ZeroDivisionError after reading. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
…fusal The tissue-mask preview and write, and the tissue-mask command, now catch PlaneReadError (PlaneMemoryError, CompressionNotBoundedError) and OSError with the other refusals: the card replaces its working status with the message and hides an earlier preview, and the command prints the image's refusal and exits 1 instead of a traceback. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
The Convert a mask card showed a green 'The mask is converted.' for a source with no recorded files. It now shows a red card naming the mask ID and source type and writes nothing. The button is not disabled ahead of time: the card refreshes on the description only, so the manifest is read at the click, never a stale copy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
RowFold.arrange returned early when no row folded and kept the previous fold's rows (and their images and callbacks) in its hidden box and its line. It now empties both first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
The row was rebuilt only for other axis letters, so an image with the same letters and other lengths kept the previous image's lengths in its labels. It is now keyed by the letters and the shape; the roles chosen for the letters are kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
_LogCapture.lines is now a deque of the latest 500 lines, the ones the panel showed; older records are dropped instead of held for the whole session. Direct appends of tracebacks keep working. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
…answer The results were cleared only when the table's path changed, so a rerun to the same path kept the old statistics, tiles, plot and the 'use the planes that have the channel' answer for a new table. The clearing is now _forget_comparison(), called by a path change and by every run that wrote its table. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
An invalid percentile list (out of 0-100, NaN, inf) returned before the old table, tiles and plot were hidden, so they stayed on screen under a choice they were not calculated with. The refusal and the missing-table branch now hide them with _hide_statistics(); the table's checks and the partial-presence answer are kept, since the table did not change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
Candidate mutual pairs are ranked by the larger of their two cross distances and taken greedily from the strongest, each channel in one pair at most. Pairs sharing a channel within PAIR_TOLERANCE (0.5) are one ambiguous_channel_swap warning naming every channel, no pair picked. The review's case now reports B and C, whatever the channel names. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
checked_shown accepts numbers.Integral (not bool) and returns an int; ViewRequest and header_channels share it. Changelog for #395 and #433. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
Tests: a near-tie just inside and just outside PAIR_TOLERANCE (strengths computed in the test and asserted to straddle it), two independent swaps, an ambiguous group beside a clean swap, a 3-cycle (three plain look-alikes, locked), name and image-order independence of the ambiguous case, and units/conditions that do not interact. Wording: the ambiguous warning says the pairs are within the tolerance in robust deviations of the larger cross distance, and that look-alike alternatives are why no pair can be chosen. Contract 14.1, user guide and CHANGELOG updated. PAIR_TOLERANCE and its computation are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
PAIR_TOLERANCE, which decides between a clean possible_channel_swap and an ambiguous_channel_swap, becomes ChannelIdentitySettings.pair_tolerance (default 0.5; finite and at least 0), written to the run manifest's channel_identity with the seven other limits and read back, so a verdict can be reproduced from the manifest. The ambiguous warning and the printed limits name the tolerance used. Limits recorded without pair_tolerance are read with 0.5, explicitly: earlier code used 0.5 as a constant, and no released version recorded these limits or produced ambiguous_channel_swap (v0.8.0 manifests have no channel_identity at all and still read as None). Every other key stays required. No CLI option or notebook field exists for any channel-check limit, so it is exposed through the settings API only. Contract §9 and §14.1, user guide, CHANGELOG. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
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 25, 2026 08:14
guijacquemet
pushed a commit
that referenced
this pull request
Nov 25, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
guijacquemet
pushed a commit
that referenced
this pull request
Nov 25, 2026
…547, #546) into the v0.9.0 release branch No conflicts. The notebooks' RELEASE_REF, the RELEASE_CALLS entry and the pin assertion are put back to their pre-pin values (the release branch carried commit B's pins), so that the next commit is the preparation commit A and commit B moves them. CHANGELOG: #543 and #544 were not in the v0.9.0 section and are added; the others already were. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WX6rdMV1r5jUPUR94kxV5a
guijacquemet
pushed a commit
that referenced
this pull request
Nov 25, 2026
The full python tools/check.py on the tree of the merge commit 5e11bc9 (main at c8c3808 with #528, #534, #543, #545, #544, #530, #548, #547 and #546): Ruff clean, 760 files formatted, pytest 8813 passed and 12 skipped, code rules passed; the Spec modules 2122 passed, 0 skipped; the notebook pin and version tests 49 passed. Docs only: this commit is the v0.9.0 preparation commit A that commit B pins. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WX6rdMV1r5jUPUR94kxV5a
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.
Second half of the quick-fix batch from the 24 November 2026 triage (groups 7 to 11). One commit per issue, each with a regression test that fails on
main(75cde57) and passes here. Groups 1 to 6 are in a separate PR.Closes #395
Closes #428
Closes #433
Closes #469
Closes #481
Closes #514
Closes #521
Closes #523
Closes #524
Closes #527
Summary (by module)
channel_identity._findings([Lazy Sunday B12][QC correctness] One channel can be assigned two incompatible mutual swap partners #395): a channel that is already in a mutual swap keeps its first partner, taken in sorted order. A third channel that looks like it stays a plainpossible_channel_swapfinding, so one channel never shows up in two "look swapped" warnings. The check is still warning-only.preview([Lazy Sunday B24][Preview integrity] Cached plane is keyed without confirmed axis mapping #428): thePreviewCachekey now holds the confirmed roles (axes,roles,singleton_roles). This applies to reads and to the discard after a rewrite. Before, a file read as ZCYX and then as CZYX showed the pixels of the first reading.image_view.ViewRequest,header_preview.header_channels([Lazy Sunday B25][Validation] Zero or negative channel display limits produce raw exceptions instead of explicit refusal #433):shownmust be a whole number (int, notbool) of at least 1, or aValueErrornaming the value is raised before any read. Before, this failed with an IndexError, AttributeError or ZeroDivisionError.notebook_tissue_mask,cli_tissue_mask([Lazy Sunday B32][UI refusal] H&E preview leaves a working status and uncaught plane-read errors #469):PlaneReadError(PlaneMemoryError,CompressionNotBoundedError) andOSErrorare now handled as refusals:notebook_mask_conversion([Lazy Sunday B34][Notebook UX] Convert-a-mask card reports success for a declared source with no recorded image files #481): a declared mask with no recorded files now gets a red card naming the mask ID and its source type, and nothing is written. Before, it got a green "The mask is converted." card.notebook_row_fold([Lazy Sunday B41][Notebook memory] Empty RowFold retains previous hidden widget tree after all rows become changed or removed #514): when no row folds, the fold's box and line are emptied, so the earlier rows are not kept.notebook_scan_axes([Lazy Sunday B43][Notebook UI] Quick-scan axis labels retain old dimension lengths when another image has the same axis letters #521): the quick-scan role row is keyed by(axes, shape), so the length labels follow the image shown. Roles chosen for the same axis letters are kept.notebook_ui._LogCapture([Lazy Sunday B43][Memory] Notebook technical log retains all formatted records although only the latest 500 are displayed #523):linesis now adeque(maxlen=500), the lines the panel shows. Directlines.append(traceback…)calls still work.notebook_results,notebook_run([Lazy Sunday B44][Scientific reporting] Successful same-path rerun retains stale comparison results and partial-channel consent #524): a new_forget_comparison()clears the statistics, tiles, plot, table checks and the partial-presence answer (reset to REFUSE). It runs on a path change, as before, and also after every run that wrote its table, including a rerun to the same path.notebook_results.show_statistics([Lazy Sunday B44][Notebook reporting] Invalid percentile input leaves previous statistics visible without stale-result marking #527): refused percentiles (outside 0 to 100, NaN, inf) and a missing table now hide the earlier statistics with_hide_statistics().Decisions / notes for review
RunInputs.he_tissue_mask/preview_he_tissue_maskto raisePlaneMemoryError, so they run without scikit-image. With scikit-image installed locally, the existing tissue-mask tests also pass.CHANGELOG.md"Unreleased".Tests
main(the source change stashed) and failed:PlaneMemoryError;planes_with_channel;.[dev,zarr,notebook]plushe-mask).ruff check .andruff format --check .are clean, andpython tools/check.py --rulespasses. The [Lazy Sunday B44][Notebook reporting] Invalid percentile input leaves previous statistics visible without stale-result marking #527 test is in its own file becausetests/test_notebook_ui.pyis at its baseline line count.tools/check.py. The widgets were tested headless and not looked at in a real JupyterLab.Review fixes (24 Nov)
This section supersedes the #395 lines of the summary and decisions above (and the note "No new refusal codes":
ambiguous_channel_swapis a new warning code, documented in the contract and user guide).#395 rewritten: mutual swaps are chosen by strength, never by channel name. The first version ("first pair in sorted channel-name order wins") was misleading: with A ref (1000,125,5000), B ref (4000,500,20000), C ref (800,100,4000) and a unit where A shows B's content, B shows exactly C's reference and C shows B's content, it reported "A and B look swapped", although B <-> C is the swap (distance 0 both ways), and renaming the channels flipped the answer.
c'is in its unit, both leaning on each other bypartner_ratio, withinoutlier_limit). Its strength is the larger of its two cross distancesmax(d(u, c -> c'), d(u, c' -> c)); smaller is stronger. Pairs are taken greedily from the strongest, each channel in one pair at most. A channel not in a chosen pair keeps its plain "does not look like X but like Y" finding (unchanged message format for clear single swaps).PAIR_TOLERANCE = 0.5(distance units; now the recorded limitpair_tolerance, see "Owner decision" below), none is chosen: a new warning codeambiguous_channel_swapnames every channel of the group, each with its own distance and its distances to the channels it could be swapped with, says no pair is named, and its action says to check every channel named.ChannelFinding.alternativesholds(channel, distance)per alternative. The answer does not depend on channel names or input order (equal-strength pairs either do not share a channel or are in one ambiguous group).tests/test_channel_identity_pairs.py, new file becausetests/test_channel_identity.pywould exceed the 600-line rule): the review's unequal case (B <-> C mutual, A plainpossible_channel_swaplook-alike of B); the same data under all 6 permutations of channel names, each also with the images reversed; an exact tie (A and C identical references, B swapped with both) giving oneambiguous_channel_swapnaming A, B and C; plus a notebook test of the ambiguous row. The earliertest_a_channel_keeps_one_swap_partner(that same tie) was replaced by the ambiguous test.ABC,ACBfail; the other 4 permutations happened to be right) and the tie test fail (4 failed, 4 passed); all 8 pass after.#433: NumPy whole numbers accepted.
header_preview.checked_shown(shared byViewRequestandheader_channels) acceptsnumbers.Integralbut notbool(nornumpy.bool_) and returns anint. New test withnp.int64(1),np.uint8(2),np.int32(6)(all 3 fail before: the check refused them), andFalse,np.bool_(True),np.int64(0)added to the refusals.notebook_viewer.py:305buildsViewRequestwithoutshown, so it usesCHANNELS_SHOWN = 6, a valid int.Verification (local, Python 3.13,
.[dev,zarr,notebook]):tests/test_channel_identity.py,tests/test_channel_identity_pairs.py,tests/test_channel_identity_run.py,tests/test_notebook_channel_identity.py,tests/test_image_viewer.py,tests/test_preview.pyand the other tests that use the viewer or the channel card (test_notebook_axes_example,test_notebook_debt,test_notebook_projection,test_notebook_row_fold,test_run_page_labels): 163 passed, 0 skipped.ruff check .,ruff format --check .andpython tools/check.py --rulesare clean. Not run: the full suite andtools/check.py.Owner decision (24 Nov): the pair tolerance is a recorded limit (84b96a5)
PAIR_TOLERANCEbecomesChannelIdentitySettings.pair_tolerance(default 0.5;PAIR_TOLERANCEis that default). It is written to the run manifest'schannel_identitywith the seven other limits and read back, so a clean-vs-ambiguous verdict can be reproduced from the manifest._choosetakes the tolerance from the settings; the ambiguous warning ("within X robust deviations …") and the printed limits name the tolerance used. Validation: a finite number of at least 0 (negative, NaN, infinite, boolean, string or None refused; 0 means only exact ties are ambiguous).from_dictstill requires every key, with one documented exception: limits recorded withoutpair_toleranceare read with 0.5, because earlier code used 0.5 as a constant. No released version recorded these limits or producedambiguous_channel_swap(the channel check is not in v0.8.0; the ambiguity rule is new and unreleased in this PR), so an absent key only means that no ambiguity rule was recorded. Stated in thefrom_dictdocstring, contract §9 (channel_identityrow) and CHANGELOG. An unknown key, or any other missing key, is still refused. The manifest version does not change.channel_identitykey; with this branchread_manifestgiveschannel_identity = NoneandRunInputs.opensucceeds.mad_floor,outlier_limit,partner_ratio…) has a CLI option or notebook field (the CLI's--outlier-limitis the intensity checks'), sopair_toleranceis set throughcheck_channel_identity(summaries, ChannelIdentitySettings(pair_tolerance=…)), documented in contract §14.1 and the user guide.to_dict/from_dictand throughrun_manifest.json); the near-tie cases parametrized by the recorded setting (strengths 0 vs ~0.46 and 0 vs ~0.63 with tolerance 0.3 / 0.5 / 0.8: 0.3 makes both clean, 0.8 makes both ambiguous); limits without the key read as 0.5; a manifest withoutchannel_identityreads as None; invalid values refused in the settings and when the manifest is read; the limits text names the tolerance..[dev,zarr,notebook]):tests/test_channel_identity*.py+tests/test_notebook_channel_identity.py: 63 passed, 0 skipped;tests/test_manifest*.py,tests/test_run_inputs_manifest_sha256.py,tests/test_cli.py: 224 passed, 0 skipped.ruff check .,ruff format --check .,python tools/check.py --rulesclean. Not run: the full suite andtools/check.py.🤖 Generated with Claude Code
https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc