Repository navigation
v0.9.1: Cellpose cell 4 opens the run once with its wait; the install shows its progress (#574 items 1-2) - #575
Conversation
…progress (#574) Item 2, the silent Folders step: cell 4 opened the app's run twice before its widget was shown (once for the notice's refusal, once by Open the run), and each opening of a verify_content run reads every image whole for its content SHA-256. Cell 4 now shows the widget first (segmentation_step(notebook, show=display)), then opens the run once: 1 whole read per image instead of 2. run_inputs.open_checked is RunInputs.open (which now calls it, signature kept) telling a (phase, done, total, path) callback each phase of open_checks.OPEN_PHASES; the checks, their order, result and refusals are the same. notebook_open_progress.opening shows them with notebook_progress.Wait and its ticking thread (#567): the phase, n of N with the image, the elapsed time. Item 1, the slow, silent first install: the shared cell 1 does not install Cellpose (measured: 42 s first run in a fresh venv, 1.6 s second run); cell 4's own Install Cellpose step does. Its pip output went to the kernel's own output, invisible from a button. install_cellpose now streams pip's lines; the card shows what pip does now with a ticking time, then what it installed or changed (a failed install shows pip's last lines). The tick, the pinned release, the restart rule and the shared cells 1 to 3 are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WX6rdMV1r5jUPUR94kxV5a
|
Full
None of the skips are caused by this PR:
The new tests ran and passed: Generated by Claude Code |
- _pip kills and waits for pip when the reading stops (an interrupt included), as subprocess.run did; undecodable output is replaced. - Cell 4 is back to the pinned release's call. In a kernel, segmentation_step displays the widget first itself and the cell's display(segmentation) then adds nothing, so the cell works with both the pinned code (3af7891) and this code. - An error that is not a refusal while cell 4 opens the run leaves the cell again (StepForm.submit(reraise=True)); a button's stays under it. - The opening's line says "Stopped after m:ss." when an exception went through it. - Restore the register_step( check of cell 5 in the notebook file test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WX6rdMV1r5jUPUR94kxV5a
SegmentationStep._ipython_display_ drew the widget with _repr_mimebundle_, which ipywidgets 7.7 (Colab) does not have: the first display raised AttributeError, which IPython swallows, so the widget never appeared. It now uses the parent's _ipython_display_ when there is one (ipywidgets 7) and _repr_mimebundle_ otherwise (8). Tests cover both branches; the cell-4 tests also pass under ipywidgets 7.7.5. The docstring says the skip is consumed by the next display of that same step only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WX6rdMV1r5jUPUR94kxV5a
|
Re-review blocker fixed in 85a4b06. What was wrong: Fix: it now calls the parent's Tests:
Generated by Claude Code |
open_run now opens through run_inputs.open_checked (the hunks shared with #575), so the test that publishes the run while it is opened patches that function instead of RunInputs.open. Same change, byte for byte, as #575's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WX6rdMV1r5jUPUR94kxV5a
This PR covers items 1 and 2 of #574, from the owner's Colab test of
MorphoBricks_Preprocessing_Cellposeon 26 Nov. Items 3 to 5 and the preview display are out of scope. No pins are moved.Item 2: the Folders step showed nothing for minutes
_refusal→open_run), the second came from Open the run (segmentation_app→opener.submit()). For averify_contentrun, every opening reads every image whole to compute its content SHA-256 (RunInputs._check_files→content_changed).file_sha256: 2 before, 1 now. The viewer's first image is read as before; that is the preview, which is out of scope.run_inputs.open_checked(..., checking=):RunInputs.opennow calls it and keeps its pinned signature. The checks, their order, the result and the refusals are all the same as before. It reports a(phase, done, total, path)callback for each phase inopen_checks.OPEN_PHASES(the Run: show every check before the first image read, and make the header check linear (v0.9.0 release blocker) #567 signature).notebook_open_progress.opening: shows the open withnotebook_progress.Waitand its ticking thread. The line gives the phase, "n of N" with the current image, and the elapsed time. It ends with "Opened and checked in m:ss.", or "Stopped after m:ss." when an error or an interrupt went through.RELEASE_REF3af7891:segmentation_stepnow displays the widget itself before opening the run. The cell'sdisplay(segmentation)then adds nothing, becauseSegmentationStep._ipython_display_skips that one call; later displays work as for any widget. Outside a kernel nothing is displayed.show=overrides the default. No re-pin is needed for this cell.StepForm.submit(reraise=True)) and is also shown under Open the run. An error from pressing the button stays under the button.Item 1: the first install is slow and shows nothing
install_cellpose(ticked, output=)streams pip's lines throughPopen(..., errors="replace").subprocess.rundid.Review (CHANGES NEEDED on bf2afe8), addressed in 8ddd435
try/except BaseException: kill(); wait(); raise. The test interrupts the reader and checks that a real child process was killed.show=in cell 4. Fixed without a re-pin: cell 4 is back to its pinned text, and the display moved intosegmentation_step(see above).register_step(check for cell 5 had been dropped. Restored.errors="replace"added, with a test using a non-UTF-8 byte.widgets.Outputswallows errors as it does in a kernel:OSErrorleavessegmentation_step;Tests
tests/test_cellpose_folders_open.py(11 tests): reads per image, display before any read, the wait's lines,open_checkedagainstRunInputs.open, refusals, the "Stopped after" line, self-display and the skippeddisplay, and errors raised versus kept.tests/test_notebook_preprocessing_cellpose.py.tools/check.pyon bf2afe8: 8822 passed, 32 skipped, 0 failed. The skips areskimagemissing, release-only tests, and platform-dependent tests.tools/check.py --rulesare clean.srcchanges are the review items.Links #574.
🤖 Generated with Claude Code
https://claude.ai/code/session_01WX6rdMV1r5jUPUR94kxV5a