Repository navigation
SWEEP-PP (B): experiment_design.csv is output only, and the pairing card is rebuilt on the draft (PP-02) - #266
Merged
Merged
Conversation
… the draft Owner answers 3 and 4 (Spec ADR 0002 AR11 (3)). Readers removed: read_confirmed_design, ConfirmedDesign, DesignCheckError, RunInputs.design(), the lenient read_experiment_design, load_design and DesignChanges. The derived file is still written by the run and checked by SHA-256 at RunInputs.open, but nothing reads it back; bricks take repeat_group from the description (Fov.repeat_group, resolve_request). Check and save now compares the candidate's derived rows with those of the published description instead of parsing the file in the output folder (check_candidate loses its output argument). Editor model removed: ExperimentDesign (with_group, with_confirmed, with_control, dated), default_design, design_edit.py (DesignEdit, DesignEditError, apply_design_edit, parse_repeat_group) and the unused report.design_summary/design_table. The rows are a read-only DesignTable; the run's check against the folders (reconcile_design, now returning the rows only, and design_issues), write_experiment_design, DESIGN_COLUMNS, design_derive and experiment_design_sha256 stay. parse_design_bytes (strict) stays for the draft's experiment-v1 section 7 legacy migration. Notebook: the pairing card is rebuilt on the draft (notebook_design): one row per folder of the draft's base with its repeat (PreprocessingNotebook.pairing replaces .design); a change is a draft answer at once and reopens the replicates whose folders it changes. Removed with it: the hidden comparability questions, the hidden control boxes and _sync_controls, the "Change the experiment design" button, the dead _design_pending/_design_items/ _design_confirmed gates and the described-run overrides that duplicated them. The shipped notebook file is unchanged. Tests: test_confirmed_design.py becomes test_design_file.py (the run's derived file parsed with the csv module in the test; the strict parser's refusals); test_design.py tests DesignTable, the run's check, the writer and the parser; RunInputs tests read repeat groups from the FOVs; dead design-template setup removed from CLI tests; the editor-model tests deleted. 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
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
SWEEP-PP, part B: inventory item PP-02 (owner answers 3 and 4; Spec ADR 0002 AR11 (3)). Stacked on #265 (base
claude/sweep-pp). Review and merge that one first.experiment_design.csvis now an output only and nothing reads it back. The notebook's pairing card is rebuilt on the draft.Removed
read_confirmed_design,ConfirmedDesign,DesignCheckError(its codesmissing_experiment_design,unreadable_experiment_designandchanged_experiment_designare no longer raised here),RunInputs.design(), the lenientread_experiment_design,load_design,DesignChanges.ExperimentDesign(with_group,with_confirmed,with_control,dated),default_design,design_edit.py(DesignEdit,DesignEditError,apply_design_edit,parse_repeat_group), and the unusedreport.design_summary/design_table.group_confirmations,groups_box,_build_group_questions), the hidden control boxes (controls_box,control_checks,_set_control,_sync_controls), the Change the experiment design button, the dead gates_design_pending,_design_itemsand_design_confirmed, the undescribed_sync_description/_design_pairingofnotebook_description, and the described-run overrides that duplicated them.designcommand,run --design,run_experiment(design=),run/design_file.py, the template,design_change.Kept, as decided
write_experiment_design,DESIGN_COLUMNS,design_derive.pyand the manifest'sexperiment_design_sha256stay.RunInputs.openstill refuses a design file whose SHA-256 is not the manifest's. The rows are now a read-onlyDesignTable, used by:reconcile_design, which now returns the rows only, anddesign_issues. A folder that is found but not described still givesdesign_not_confirmed.parse_design_bytes, which the draft's experiment-v1 §7 legacy migration needs (see "Not decided").Changed
notebook_design.py): one row per folder of the draft's base, with a dropdown of the repeat it is paired with.PreprocessingNotebook.pairingreplaces.design. A change is a draft answer at once, and the replicates whose folders it changes are asked "same way?" again, as before. The help text says that comparability is confirmed on Check and save.check_candidatecompares the candidate's derived rows with those of the published description, instead of parsing the file in the output folder. It lost itsoutputargument.Screenshots
The card was rendered with the real widgets (
ipywidgets.embedand headless Chromium), on a synthetic experiment with blob images:ctrl/rep1,ctrl/rep2,drug/rep1,drug/day2, thenday2paired withrep2. Images:main_1_paired_by_name.png,main_2_day2_paired_with_rep2.png(main) andhead_1_paired_by_name.png,head_2_day2_paired_with_rep2.png(this head), in the session's scratchpad, not committed. The visible difference: the card's help text now says that comparability is confirmed on Check and save, and the pairing heading has no "1." (there is no second question on the card any more).Not decided (reported, not changed)
draft.migrate_legacy_design(andLegacyMigrationRefused,MigrationNote,Draft.origin/legacy_missing, thelegacy_folder_missingquestion,describe's migration of a legacy CSV). The inventory marks it ONLY and plan §3.7 marks it "rule". But the vendored Spec experiment-v1 §7 ("Legacyexperiment_design.csv→ v1") specifies this migration, and conformance case P30 (AQ12, FR2;tests/test_spec_derived_design.py) tests it, while ADR 0002 says "experiment-v1 unchanged". Removing it drops a Spec conformance case, so it needs a Spec change or an owner ruling. I kept it, soparse_design_bytesanddesign_issuesstay for it.ids_confirmedand the global Image type card. They are hidden, not removed (rest of PP-09). This PR removes only the design card's retired parts.Evidence
Every valid Spec fixture
v01tov37(44 cases with mask variants, 39 written) was run onmain8776349 and on this head. Compared: the CSV and design bytes, the scrubbed manifest, the refusal codes of the run and of the mask step, the scrubbedmask_representation.json, andRunInputsFOVs with their canonical IDs. 0 differences.v04,v05,v06andv17are refusedR_HETEROGENEOUS_LAYOUT_NOT_ENABLEDon both, andv29is refused by the helper on both.Tests
python tools/check.pyon this head 245baa7 (Python 3.13, thedev,notebookandzarrextras): ruff check and format clean; pytest 5138 passed, 4 skipped; code rules match their baseline (lowered fordesign.pyandtests/test_notebook_ui.py). Skips, all environment-bound:test_cli_log.py:166,test_folder_rules.py:199and:230: this file system tells names apart by case.test_discovery.py:665: permissions that ignore file modes.The count is 11 lower than part A (5149) because the editor-model, lenient-reader and
RunInputs.designtests were deleted or merged intotest_design.pyandtest_design_file.py.Downstream impact
Pins hold; this breaks nobody until a pin moves past it. Callers that must move first (inventory X-03, plus a code search of the default branches):
src/cellpatcher/normalization.py(read_confirmed_design,ConfirmedDesign; inventorynormalization.py:115-175),config.py:274-325,setting_checks.py:270,file_runs.py:37,301, and the teststests/test_normalization.pyandtests/test_rgb_normalization.py(mbp.default_design). CP-1 is to readrepeat_groupfrom the description.experiment_design.py:55-83andfits.py:79-85(read_confirmed_design/RunInputs.design(), inventory MF-05). MF-4 is to readrepeat_groupfrom the description.PreprocessingNotebook:.designis now.pairing, and the widgetsgroup_confirmations,groups_box,controls_box,control_checksanddesign_changeare gone.show_designis unchanged.The shipped notebook and its
RELEASE_REFare unchanged.Generated by Claude Code