Skip to content

SWEEP-PP (A): remove the remaining compatibility code (PP-05..PP-10) and fix the frozen clock (#262) - #265

Merged
guijacquemet merged 9 commits into
mainfrom
claude/sweep-pp
Nov 10, 2026
Merged

guijacquemet merged 9 commits into
mainfrom
claude/sweep-pp

Conversation

@guijacquemet

@guijacquemet guijacquemet commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

SWEEP-PP, part A: the small removals of the obsolete-code sweep of this repository (MorphoFeature docs/restart/designs/obsolete-code-inventory-2026-11-10.md §1 and §12, Stage 2 plan §3.7; owner policy of 10 November 2026, Spec ADR 0002 AR10/AR11). It goes into v0.5.1 and is based on main at 8776349 (PP-C, PP-0, PP-1 and PP-2 merged). Part B (#266, stacked on this branch) holds the pairing-editor rebuild and the removal of the design readers (PP-02). One commit per item.

Refs #262. Only part 1 of #262 (the frozen-clock test hygiene) is here. Part 2, the normalization pin move, is a separate PR after this one.

Removed (by inventory item)

Item What Commit
#262 part 1 tests/frozen_clock.py skips a module whose import fails only because ipywidgets or matplotlib (the notebook extra) is missing. The chain of causes is followed, and any other import error is still raised. The write test checks a core module's patch always and the notebook module's only when the extra is installed. Regression tests: tests/test_frozen_clock_extras.py. 8f78f44
PP-07 GroupSummary.plane_count, the deprecated alias of channel_histogram_count (before #104). No caller in the nine repositories. 80c0f0b
PP-08 (A7) source_fingerprint, removed from inventory, from the manifest re-export and from the top level. Tests use source_signature. 28055c7
PP-06 Conversion record: version 3 only. Version 2 was still read; version 1 had a message of its own. Any other version is now refused with one conversion_record_unreadable message that names its version and the fix: convert the originals again into a new folder. The record-level and entry-level projection key is required. 7068ec7
PP-05 (A16) Run manifest: nothing is read leniently. Removed: the strict flag of recorded_position_id and of the file-entry reader and writer, the version-1 branch of verify_content in to_dict, and the defaults for keys that version 4 always writes (singleton_roles, channel_names, significant_bits, read_in_blocks, channel_names_trimmed, pixel_sizes, settings.histogram, settings.verify_content). sizes_from_data refuses an absent list. In check_sources: the position_id_not_recorded issue is gone (an entry without a position is now identity_differs), and roles are no longer resolved from the image header when an entry has none (such an entry fits no axes: axis_mapping_mismatch). 10bf92e
PP-10 docs/migration-0.3-to-0.4.md, and the links to it in the README, user guide and CHANGELOG. 86c846e

Already gone on main (checked, nothing to do)

  • PP-01: undescribed runs (PP-C).
  • PP-04: manifest versions 1 to 3 and version_for. READ_VERSIONS == ("4",) (PP-C).
  • PP-10, rest of it (PP-C): test_parity_v0_4_0.py, parity_datasets.py, released_code.py, test_removed_in_v040.py and the CI fetch-depth: 0 step. PP-C also renamed test_schema_v2_equivalence.py to test_histogram_goldens.py (science goldens, A6). This PR does not touch it.

Not decided (reported, not changed)

Evidence

The comparison script ran every valid vendored Spec fixture (v01 to v37) through a described run, with masks too where the fixture declares any: 44 cases, 39 written. The refused ones are v04, v05, v06 and v17 (R_HETEROGENEOUS_LAYOUT_NOT_ENABLED) and v29 (mixed rgb/fluorescence, refused by the test helper). It compared main 8776349 with the head of part B (which contains this PR):

  • plane_histograms.csv and experiment_design.csv: SHA-256 of the bytes;
  • the run manifest, without its run-specific fields (paths, times, sizes, versions);
  • the refusal codes of the run and of the mask step;
  • mask_representation.json, without mtimes;
  • RunInputs.open(...).fovs(): key, condition, repeat group, technical repeat, image type and channel IDs.

Result: 0 differences. Outputs are byte-identical and the refusal codes are the same.

Tests

python tools/check.py on this head 86c846e (Python 3.13, the dev, notebook and zarr extras): ruff check and format clean; pytest 5149 passed, 4 skipped; code rules match their baseline. Skips, all environment-bound:

  • test_cli_log.py:166, test_folder_rules.py:199 and :230: this file system tells names apart by case.
  • test_discovery.py:665: running with permissions that ignore file modes.

I also ran the three #262 tests with ipywidgets and matplotlib blocked (sys.modules[...] = None). They pass, and on main they fail.

Downstream impact

Pins hold, so nothing breaks until a pin moves past this PR.

  • source_fingerprint: CellPatcher mentions it only in a docstring (src/cellpatcher/statistics.py).
  • GroupSummary.plane_count: no callers.
  • Conversion records of version 2 and manifests missing keys: refused, naming the fix.

The shipped notebook and its RELEASE_REF are unchanged.

A note for the pin-move PR (#262 part 2): PP-07 changes one test in tests/test_report.py. The alias's deprecation test now checks the pooled count. No PlaneRecord(...) constructor was touched, and run/steps.py:229-231 and run/rows.py:33 are unchanged.

🤖 Generated with Claude Code

https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc

…tra (#262)

tests/frozen_clock.py imported every module of the package, and the notebook
modules raise ImportError without ipywidgets/matplotlib, so the frozen-clock
tests failed on a plain dev install. A module whose import fails only because a
notebook-extra package is missing (followed through the re-raised cause) is now
skipped; any other import error is raised. The write test checks a core module's
patch always and the notebook module's only with the extra installed.

Regression tests: tests/test_frozen_clock_extras.py (blocked extra in a fresh
interpreter; a missing required dependency is still raised).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
The alias of channel_histogram_count (before #104) warned and served nothing
current: no caller in the nine repositories. Its deprecation test becomes a
check of the pooled count itself; AGENTS.md and the CHANGELOG say it is gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
source_fingerprint returned only (size, mtime_ns) of source_signature and was
kept "for callers"; none in the nine repositories. Removed from inventory, the
manifest re-export and the package top level. The tests that used it as a
helper take source_signature directly; the contract and AGENTS.md name
source_signature.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
The writer writes version 3 only. Version 2 was still read (as a tree without a
projection) and version 1 had a pointed message of its own. Now any version but
3 is refused with one message naming its version and the fix (convert the
originals again into a new folder); nothing is converted. The record's and each
entry's projection key is required, as version 3 always writes it.

Tests: the version-2 read test becomes a refusal test; 1, 2, 4 and a missing
version are refused; a record without its projection key is refused. Contract
§9.1/§17, user guide and CHANGELOG updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
Only version 4 manifests are read (PP-C), so the tolerant reading of version-1
file entries served nothing: the strict flag of recorded_position_id and of
the entry reader/writer, the defaults for keys the writer always writes
(singleton_roles, channel_names, significant_bits, read_in_blocks,
channel_names_trimmed, pixel_sizes, settings.histogram, settings.verify_content)
and the version-1 branch of verify_content in to_dict. Such a manifest is now
refused (ManifestFormatError). sizes_from_data refuses an absent list.

check_sources drops position_id_not_recorded (an entry without a position is
identity_differs) and the fallback that resolved roles from the image header
for an entry without them (it fits no axes: axis_mapping_mismatch).

Tests converted from "defaults when absent" to "refused when absent"; contract
§9/§16 and the user guide's code table updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
No run of v0.3 or v0.4 is read any more (manifest version 4 only), so the
migration guide described a path that no longer exists. README, user guide and
CHANGELOG no longer point to it; the user guide's upgrade note says what an
older run gets now. The rest of PP-10 (parity tests, test_removed_in_v040.py,
released_code.py, fetch-depth) was already removed in PP-C, and the histogram
goldens were renamed there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
With the defaults for always-written keys removed, a manifest missing one
was refused as "incomplete or malformed: 'histogram'" (a bare KeyError
text, no fix). It now says which key is absent, that every version 4
manifest records it, and to run preprocessing again. The version check
no longer defaults settings.verify_content to false either.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
A record_version of the number 3 (not the text "3") was refused as
"it is a record of version 3, and this version of preprocessing reads
version 3 only". The version is now shown as recorded (repr), and a
version 3 record missing a key it always holds names the key and the
fix instead of a bare KeyError text. RunInputs.open's docstring no longer
mentions version 1 records only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
The previous review commit quoted every refused version ('1'), which
dropped the "version 1" wording that convert's conversion_record_unreadable
message is tested for (test_convert_integrity). A text version is shown as
before; only a version that is not text (the number 3, null) is refused as
"record_version 3 is not text".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
@guijacquemet
guijacquemet merged commit 7672e9f into main Nov 10, 2026
7 checks passed
@guijacquemet
guijacquemet deleted the claude/sweep-pp branch November 10, 2026 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants