Skip to content

Register the masks: show a failed folder check in cell 5, never crash on the next press (#580) - #581

Draft
guijacquemet wants to merge 1 commit into
mainfrom
claude/register-failed-recheck
Draft

guijacquemet wants to merge 1 commit into
mainfrom
claude/register-failed-recheck

Conversation

@guijacquemet

Copy link
Copy Markdown
Contributor

Fixes #580. Draft: do not merge.

Change (notebook_mask_register.py)

  • A press whose folder check with the masks folder fails (check_folder() returns None) stops with CHECK_FAILED. The message includes cell 3's own reason and says what to do: Check folder in cell 3, confirm the axes, Register again. Before, it showed AXES_AGAIN.
  • refusal() gives the same CHECK_FAILED while the app has no check after a re-check that cell 5 made. _app_run no longer dereferences app.preflight when it is None. Before, every later press, and cell 5 run again, raised AttributeError out of the click handler.
  • register() wraps its body (_register). An unexpected error, or an interrupt, sets STOPPED in cell 5's status and is still raised.

Nothing that is checked, declared or written changes. The success path is the same calls in the same order.

Tests

  • New in tests/test_notebook_preprocessing_cellpose.py:
    • a failed check (OSError) says so in cell 5 and not the axes line;
    • pressing again and re-running cell 5 give the same refusal and no exception;
    • the run folder is byte-identical;
    • after cell 3's check is made again and the axes are confirmed, Register succeeds and RunInputs sees Cells;
    • an unexpected RuntimeError is shown in cell 5 and re-raised.
  • tests/test_notebook_preprocessing_cellpose.py + tests/test_notebook_preprocessing_cellpose_file.py: 39 passed.
  • ruff check, ruff format --check and tools/check.py --rules pass.
  • The full tools/check.py was not run.
  • Before the fix, the old behaviour was shown by a scratch script (the AXES_AGAIN line, then AttributeError on press 2 and on a cell 5 re-run). The new test module imports STOPPED, so it does not collect on the old code.

Overlap: draft #578 rewrites register() for its progress lines. Whichever merges second needs a small rebase. The logic here is independent of it.


Generated by Claude Code

… on the next press

When the folder check that Register the masks makes with the masks folder
failed (an OSError such as Drive not answering, or a coded refusal), cell 5
said to confirm the axes again in cell 3, the reason was drawn only in cell 3,
and every later press (and cell 5 run again) raised AttributeError out of the
click handler because app.preflight was None. Cell 5 now shows CHECK_FAILED
with cell 3's reason and continues once cell 3's check is made again; an
unexpected error during a press is shown in cell 5 (STOPPED) and re-raised.
Nothing checked, declared or written changes.

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 26, 2026
Fixes #580 on top of #578's Register wait: a failed re-check stops with
CHECK_FAILED and cell 3's reason; later presses and cell 5 run again refuse
without AttributeError; an unexpected error is shown in cell 5 (STOPPED) and
re-raised, with the wait's "Stopped after" line. Conflicts resolved so both
fixes hold; the tests of #581 use #578's question (choices, not ticks).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VbytvF3Gsa85ix8Ne2yMDW
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.

Cell 5 Register: a failed folder re-check shows "confirm the axes again", then every press crashes silently (AttributeError)

2 participants