From 2ffdcf190c19bac3cd39a0b064d3998843f7d5f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Hidalgo?= <47150974+IvanHCenalmor@users.noreply.github.com> Date: Wed, 18 Nov 2026 02:27:39 +0200 Subject: [PATCH] Docs and audit: the LabConstrictor Demo is retired The Playground replaces the Demo, whose repository is being retired: - docs/REPOSITORIES.md: the Demo's rows are removed from both tables. - docs/HOST_FEATURES.md: no longer mentions the Demo. - tests/audit/notebooks/scripts/LabConstrictor_Demo/: its click scripts are removed (the audit needs scripts only for the app checkouts it is given). Co-Authored-By: Claude Opus 5.5 --- docs/HOST_FEATURES.md | 2 +- docs/REPOSITORIES.md | 2 - .../LabConstrictor_Demo/Image_Preview.py | 58 ------------------- .../scripts/LabConstrictor_Demo/Welcome.py | 5 -- 4 files changed, 1 insertion(+), 66 deletions(-) delete mode 100644 tests/audit/notebooks/scripts/LabConstrictor_Demo/Image_Preview.py delete mode 100644 tests/audit/notebooks/scripts/LabConstrictor_Demo/Welcome.py diff --git a/docs/HOST_FEATURES.md b/docs/HOST_FEATURES.md index 94b4cd1..e77387c 100644 --- a/docs/HOST_FEATURES.md +++ b/docs/HOST_FEATURES.md @@ -14,7 +14,7 @@ All three need an app whose Tools is **0.3.0a1 or newer** ([INSTALL.md](INSTALL. **Fiji limits (known, stated in the Fiji README):** a pixel-size field linked to an image follows that image's calibration by itself and there is **no "use the image's calibration" button**; typing the value the box already shows cannot be detected in a SciJava dialog (conformance case CAL-T9), so that field is cleared and the run blocked with a message, never a wrong value sent; `EnabledWhen` is ignored; `Collapsed` is a plain heading; no kept worker (a new worker for each run); the Macro Recorder does not record the plugin (a hand-typed macro line works, jar only). ## Which apps a host offers -Each host reads the registry. Which app each host offers is the app's own `hosts:` declaration (the discovery rule, feature `app_hosts_v1`; [PROTOCOL.md](PROTOCOL.md#app-hosts-which-host-lists-an-app)), and all three hosts honour it: **CellTracksColab** is hidden from Napari, Fiji and QuPath (notebook only; **LabConstrictor Demo** has no tools at all); **NucleiSky, Guess the Condition, Playground and StarDist2D** are offered by all three; **VLab4Mic** is offered by Napari and Fiji and **not** by QuPath. Installers pass the declaration from template 0.1.18; an app installed with an older installer has no declaration and every host lists it, logging the 'declares no hosts' sentence of [PROTOCOL.md](PROTOCOL.md#app-hosts-which-host-lists-an-app). A host also leaves out, with a sentence in its Log, an app whose Tools is too old. +Each host reads the registry. Which app each host offers is the app's own `hosts:` declaration (the discovery rule, feature `app_hosts_v1`; [PROTOCOL.md](PROTOCOL.md#app-hosts-which-host-lists-an-app)), and all three hosts honour it: **CellTracksColab** is hidden from Napari, Fiji and QuPath (notebook only); **NucleiSky, Guess the Condition, Playground and StarDist2D** are offered by all three; **VLab4Mic** is offered by Napari and Fiji and **not** by QuPath. Installers pass the declaration from template 0.1.18; an app installed with an older installer has no declaration and every host lists it, logging the 'declares no hosts' sentence of [PROTOCOL.md](PROTOCOL.md#app-hosts-which-host-lists-an-app). A host also leaves out, with a sentence in its Log, an app whose Tools is too old. | Feature | Napari | Fiji | QuPath | diff --git a/docs/REPOSITORIES.md b/docs/REPOSITORIES.md index 71d97fc..40dc2a2 100644 --- a/docs/REPOSITORIES.md +++ b/docs/REPOSITORIES.md @@ -23,7 +23,6 @@ Two other kinds of repository have different jobs: | VLab4Mic | [LabConstrictor-VLab4Mic](https://github.com/CellMigrationLab/LabConstrictor-VLab4Mic) | 2 (Simulate imaging of a virtual sample, Compare an image with a reference) | 0.1.8 | | StarDist2D | [Stardist2D](https://github.com/CellMigrationLab/Stardist2D) | yes | 1.2.1 | | CellTracksColab | [CellTracksColab](https://github.com/CellMigrationLab/CellTracksColab) (its desktop app is released from this repository) | 1 (Calculate Track Metrics), registered but listed in no host (`hosts: [notebook]`) | 1.1.5 | -| LabConstrictor Demo | [LabConstrictor_Demo](https://github.com/CellMigrationLab/LabConstrictor_Demo) | none (notebook only) | 0.0.4 | Each app's installer pins a Tools tag (`LC_TOOLS_PIN`); an app gets a new pin by the template sync and its next release ([OPERATIONS.md](OPERATIONS.md#pinning-tools-in-app-installers)). An app's latest release is on its page in the [App Centre](https://cellmigrationlab.github.io/LabConstrictor-Site/) and on its GitHub Releases page. @@ -40,7 +39,6 @@ Hosts do **not** need to install the application's scientific dependencies. The | NucleiSky, Guess the Condition, Playground, StarDist2D | listed | listed | listed | yes | | VLab4Mic | listed | listed | **not listed** | yes | | CellTracksColab | hidden | hidden | hidden | yes (notebook only: the release sandbox expects "not listed" in all three) | -| LabConstrictor Demo | (no tools) | (no tools) | (no tools) | yes | The `hosts:` line of an app's `labconstrictor-app.yaml` (App-Centre metadata, schema `.tools/schema/labconstrictor-app.schema.json` of the template) is the binding rule; installers pass it to Tools (`--app-manifest` or `--hosts`) from template 0.1.18. diff --git a/tests/audit/notebooks/scripts/LabConstrictor_Demo/Image_Preview.py b/tests/audit/notebooks/scripts/LabConstrictor_Demo/Image_Preview.py deleted file mode 100644 index 9a529da..0000000 --- a/tests/audit/notebooks/scripts/LabConstrictor_Demo/Image_Preview.py +++ /dev/null @@ -1,58 +0,0 @@ -"""Click script and oracle of LabConstrictor_Demo's Image_Preview.ipynb (an ipywidgets FileUpload, a status line and an inline preview). - -The browser's file dialog cannot be driven headless (HUMAN); the upload is simulated by setting the FileUpload value to what ipywidgets 8 puts there after -an upload (a tuple of {name, type, size, content, last_modified}), which fires the notebook's observer exactly as a real upload does. Files of known content -are built in the kernel with Pillow: -* gray16.png, 1200x900, 16-bit grayscale ramp: status "Loaded gray16.png (1200x900px, mode I...)", preview a PNG thumbnail of 800x600 (max 800x800, aspect kept); -* rgb.png, 300x200 RGB: status names 300x200 and RGB, preview 300x200 (no upscaling); -* notes.txt (not an image): status "Could not read the image", no preview; -* the upload cleared (empty value): status "Upload cleared.". - -Oracle (in the kernel, oracle_* rows): the status texts above and the decoded preview PNG sizes. -""" - -AFTER_CELL = {3: "upload"} -STAGES = { - "upload": """ -import base64 as _b64, datetime as _dt, re as _re -from io import BytesIO as _BytesIO -import numpy as _np -from PIL import Image as _Image - -_up = lcnb.find(var="uploader") -_status = lcnb.find(var="status_out") -_preview = lcnb.find(var="preview_out") -lcnb.human("upload_dialog", "the 'Upload image' button opens the browser's file dialog: the upload is simulated by setting the FileUpload value") - -def _png(array, mode=None): - buffer = _BytesIO() - (_Image.fromarray(array, mode) if mode else _Image.fromarray(array)).save(buffer, format="PNG") - return buffer.getvalue() - -def _upload(name, kind, data): - lcnb.set_value(_up, ({"name": name, "type": kind, "size": len(data), "content": memoryview(data), - "last_modified": _dt.datetime.now(_dt.timezone.utc)},)) - -def _preview_size(): - found = _re.search(r"data:image/png;base64,([A-Za-z0-9+/=]+)", str(_preview.value)) - return _Image.open(_BytesIO(_b64.b64decode(found.group(1)))).size if found else None - -_ramp = (_np.arange(1200, dtype=_np.uint32)[None, :] * 50 + _np.arange(900, dtype=_np.uint32)[:, None] * 3).astype(_np.uint16) -lcnb.guarded("click_upload_gray16", lambda: _upload("gray16.png", "image/png", _png(_ramp))) -lcnb.check("oracle_gray16_status", _re.search(r"Loaded gray16\\.png \\(1200x900px, mode I", str(_status.value)) is not None, "status: %s" % _status.value) -lcnb.check("oracle_gray16_preview", _preview_size() == (800, 600), "preview thumbnail size %s (expected (800, 600))" % (_preview_size(),)) - -_rgb = _np.zeros((200, 300, 3), dtype=_np.uint8) -_rgb[..., 0], _rgb[..., 1], _rgb[..., 2] = 200, 20, 30 -lcnb.guarded("click_upload_rgb", lambda: _upload("rgb.png", "image/png", _png(_rgb))) -lcnb.check("oracle_rgb_status", "Loaded rgb.png (300x200px, mode RGB)" in str(_status.value), "status: %s" % _status.value) -lcnb.check("oracle_rgb_preview", _preview_size() == (300, 200), "preview size %s (expected (300, 200): no upscaling)" % (_preview_size(),)) - -lcnb.guarded("click_upload_text", lambda: _upload("notes.txt", "text/plain", b"not an image")) -lcnb.check("oracle_text_refused", "Could not read the image" in str(_status.value) and not str(_preview.value), "status: %s; preview %r" % (_status.value, str(_preview.value)[:40])) - -lcnb.guarded("click_upload_clear", lambda: lcnb.set_value(_up, ())) -lcnb.check("oracle_upload_cleared", "Upload cleared." in str(_status.value), "status after clearing: %s" % _status.value) -""", -} -NO_ORACLE = "" diff --git a/tests/audit/notebooks/scripts/LabConstrictor_Demo/Welcome.py b/tests/audit/notebooks/scripts/LabConstrictor_Demo/Welcome.py deleted file mode 100644 index 0be2f19..0000000 --- a/tests/audit/notebooks/scripts/LabConstrictor_Demo/Welcome.py +++ /dev/null @@ -1,5 +0,0 @@ -"""Click script of LabConstrictor_Demo's Welcome.ipynb: the shared Welcome script (scripts/_welcome.py), nothing app specific.""" - -from _welcome import AFTER_CELL, STAGES, inputs # noqa: F401 - -NO_ORACLE = ""