Skip to content

Notebook redesign 2: progress for every wait, progress callbacks from the readers, quick scan first - #270

Merged
guijacquemet merged 3 commits into
mainfrom
claude/redesign-2-progress
Nov 10, 2026
Merged

guijacquemet merged 3 commits into
mainfrom
claude/redesign-2-progress

Conversation

@guijacquemet

Copy link
Copy Markdown
Contributor

Second of four stacked pull requests (base: #269). Owner's test of v0.5.0, items (c) "a progress bar for every wait" and (d) "quick scan first". Design note: docs/restart/designs/notebook-redesign-2026-11-10.md on MorphoFeature branch claude/restart-doc.

Summary

  • notebook_progress (new, ui): Wait draws one status line with a bar for a wait: what is done of the total, the item being read, the elapsed time and, once it can be measured (one item and one second), the time left; progress_html, time_left, clock_text are its pure parts. Redrawn at most every 0.1 s, and always at the end.
  • Progress callbacks from the readers: discover_experiment(..., progress=) (each folder before it is listed), masks.find_masks(..., progress=) and run.preflight.remasked(..., progress) (each mask header), and preflight's progress now also reports ("folders", 0, 1, folder) and ("masks", done, total, mask_path). The first and last call of each phase, and every result, are unchanged (tested against a call without a callback).
  • Every wait of the notebook uses it: the folder check (listing the folders, image headers, mask headers, comparing, the check report, the pictures per folder), Check the masks, the run, the mask step, the named-axis copies and the statistics (their stage of four). "Checking the folders and image headers…" is gone. The run, the mask step and the copies keep their bar widget; the line beside it gains the count, the file, the elapsed time and the time left.
  • notebook_quick_scan (new, ui; shipped notebook only): Scan the folders runs the folder check's own walk (no image header is read), shows every folder with its labels and image count, and one image chosen at random with its path and seed, for looking only (drawn from that file's own header by the rules of the folder pictures: only when the header names Y and X, bound to the file as read). Nothing of the scan is kept. The folder check is then the explicit click Looks right: read all image headers, disabled with a line saying why until the folders are scanned as typed now: changing the experiment, output or masks folder or the exclusions asks for a new scan.
  • is_tiff_name, is_system_name, TIFF_SUFFIXES, SYSTEM_NAMES moved from discovery to image_names (still importable from discovery), so discovery.py is under the 600-line rule and its baseline entry is removed.

Decisions

  • folder_step() for the bricks that embed it is unchanged: Check folder, one click (now with the progress line). The quick scan belongs to steps().
  • The scan is a way to look before waiting, not a gate of the science: check_folder() called from code still checks without a scan, and the check does its own walk again (the folders may have changed since the scan).
  • The time left is estimated from the current part only (headers per header), and never shown for work that cannot be counted (the folder walk shows "N so far").

Notes for review

  • No timer thread: the elapsed time advances when the reader reports, so a single very slow file shows its last value until it returns.
  • The statistics test asserted the spinner class; it now asserts the wait line (mb-wait).
  • On the 28-image test data every wait is under a second apart from the run and the mask step, so the time left was only seen there and in the unit tests with a fake clock; not tried on Google Drive.

Tests

python tools/check.py on 04b0b9d: Ruff and the code rules pass; 5195 passed, 4 skipped (three for a case-sensitive file system, one for running with permissions that ignore file modes). New: tests/test_notebook_progress.py (17) and tests/test_notebook_quick_scan.py (10): the estimate and its threshold, the throttle, each reader's callback against the result without one, each wait's text, the scan reading exactly one header and running no check, the seed and path shown, the gate after each kind of folder change.


Generated by Claude Code

…s, quick scan first

Owner test of v0.5.0 (10 November 2026), items (c) and (d).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc

Copy link
Copy Markdown
Contributor Author

Gate after merging main (#267, #268) through #269: python tools/check.py on 75b5a82: Ruff and the code rules pass; 5210 passed, 4 skipped (the same four environment skips). The description's numbers are those of 04b0b9d, before the merge.

🤖 Generated with Claude Code

https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc


Generated by Claude Code

…-progress

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
Base automatically changed from claude/redesign-1-fixes to main November 10, 2026 19:22
@guijacquemet
guijacquemet merged commit 6c3301e into main Nov 10, 2026
14 checks passed
@guijacquemet
guijacquemet deleted the claude/redesign-2-progress branch November 10, 2026 19:23
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