Repository navigation
Pass a stopped run's refusal on, from RunStoppedError (waits for the preprocessing release) - #128
Closed
guijacquemet wants to merge 1 commit into
Closed
guijacquemet wants to merge 1 commit into
guijacquemet wants to merge 1 commit into
Conversation
Contributor
Author
|
Preprocessing now has a public API for this: CellMigrationLab/morphobricks-preprocessing#324 (for #322). It is not merged yet; an independent review comes first. What to switch to. Drop the from morphobricks_preprocessing import RunInputs, RunStoppedError, RunReportUnreadableError
try:
inputs = RunInputs.open(run_folder)
except RunStoppedError as stopped: # code == "RUN_FOLDER_STOPPED"
for issue in stopped.issues: # tuple[ValidationIssue, ...], the report's order
issue.code, issue.message, issue.paths, issue.action # exactly as the report records them
except RunReportUnreadableError as bad: # code == "RUN_FOLDER_REPORT_UNREADABLE"; bad.path
...
The contract is §9.1, "A stopped run". Generated by Claude Code |
…126) On an output folder where preprocessing stopped on purpose without writing a run (Spec v29: RGB units beside fluorescence units, R_HETEROGENEOUS_LAYOUT_NOT_ENABLED), CellPatcher refused with preprocessing_run_refused and advised running preprocessing again, which stops the same way. Preprocessing's RunInputs.open now raises RunStoppedError (RUN_FOLDER_STOPPED, preprocessing #322, merged in #324) there. CellPatcher passes its issues on first, unchanged and in order (code, message, paths, suggested action; Spec ADR 0005, construction and propagation), then preprocessing_run_refused naming the folder ("holds no run_manifest.json") with no re-run advice. A report preprocessing cannot read (RunReportUnreadableError) is refused with its code, RUN_FOLDER_REPORT_UNREADABLE, naming the report. CellPatcher reads no discovery_report.json. A folder with no run and no stopped run's report says to give a written run or run preprocessing first; a stale written run keeps the advice to run preprocessing again. TODO(tag): preprocessing (core and zarr extra) is pinned to its main commit b24371abe0a728995f44b2f8f1dd6d36b4a4addc until its next release is tagged, and test_preprocessing_is_pinned_to_a_release_tag_not_a_commit accepts that one commit. Both go back to a tag before this is merged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
guijacquemet
force-pushed
the
claude/stopped-run-refusal
branch
from
November 17, 2026 01:51
ab3cbe3 to
04d761e
Compare
Contributor
Author
|
I'm closing this draft because its work is now in #133, recreated on top of the preprocessing v0.7.0 / normalization v0.7.1 pin commit. I recreated it instead of pushing here: this branch was based on Changes from this draft:
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.
Draft. Do not merge until the next morphobricks-preprocessing release (the first release that contains #324) is tagged and pinned here. Rebased onto
main(54e200b, after #127 /aca2c6c) and reworked to use preprocessing's public API (#322, merged on preprocessingmainin #324 atb24371a, not yet released).Addresses #126.
What it does
On a folder where preprocessing stopped without writing a run (Spec v29,
R_HETEROGENEOUS_LAYOUT_NOT_ENABLED), preprocessing'sRunInputs.openraisesRunStoppedError(RUN_FOLDER_STOPPED, preprocessing contract §9.1 "A stopped run").open_runcatches it and:issueson first, unchanged and in order (code, message, paths and suggested action; Spec ADR 0005 propagation);preprocessing_run_refusednaming the folder ("holds no run_manifest.json",RUN_FOLDER_STOPPED). It gives no advice to run preprocessing again.A report that preprocessing cannot read (
RunReportUnreadableError) gives one issue, codedRUN_FOLDER_REPORT_UNREADABLE, that names the report (exc.path).CellPatcher no longer reads
discovery_report.json. The previous report reader (_stopped_run_issues) is deleted.Unchanged:
Pin (
TODO(tag), this draft only)setup.pypins preprocessing to commitb24371abe0a728995f44b2f8f1dd6d36b4a4addc, both the core requirement and thezarrextra. Normalization stays atv0.7.0, which is what that commit pins.tests/test_dependency_pins.py::test_preprocessing_is_pinned_to_a_release_tag_not_a_commitrequires a tag, so on this branch only it also accepts that one commit (PREPROCESSING_MAIN_COMMIT).Tests (
tests/test_stopped_run.py)R_HETEROGENEOUS_LAYOUT_NOT_ENABLEDissue, and the other errors after it, are passed on equal toRunStoppedError.issuesand in its order. The folder notice follows, and nothing says "run preprocessing again".RunStoppedError: the issues are passed on as given (paths not re-sorted). A junkdiscovery_report.jsonsits beside them and is never read.RUN_FOLDER_REPORT_UNREADABLE, naming the report.checkor provisional report, and no report at all: the plain no-run refusal, unchanged.Gate
python tools/check.pywithPYTEST_ADDOPTSunset, Python 3.13: 2976 passed, 10 skipped (all 10 need torch, which is not installed). Code rules and Ruff are clean.MorphoFeature #240
adversarial/A07Installed as its README says, with this branch installed last using
--no-deps --force-reinstall.v0.6.1: A07 fails. CellPatcher raisesImportError(RunReportUnreadableError), because this branch needs preprocessing atb24371aor later.b24371ainstalled in the suite's env:RunInputs.open(...)match on "no run_manifest.json", now fails. Preprocessing's message is nowRUN_FOLDER_STOPPED: ..., so that line needs updating in #240 when it raises preprocessing.R_HETEROGENEOUS_LAYOUT_NOT_ENABLED,inconsistent_mapping, thenpreprocessing_run_refused, with no "preprocessing again".Before merge
zarr) and removePREPROCESSING_MAIN_COMMITfrom the pin test.🤖 Generated with Claude Code
https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc