Skip to content

release: v0.3.8 - #74

Merged
Heerpa merged 22 commits into
masterfrom
develop
Dec 2, 2026
Merged

Heerpa merged 22 commits into
masterfrom
develop

Conversation

@Heerpa

@Heerpa Heerpa commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator

Promote develop → master for the v0.3.8 release (tag to follow on master).

Highlights since v0.3.7:

See CHANGELOG.md [0.3.8].

🤖 Generated with Claude Code

Heerpa and others added 22 commits November 24, 2026 17:12
Add a line-art logo in the Picasso/monet family — a single continuous line
(the automated fluid flow PycroFlow orchestrates) curling into a droplet.

release/logos/ (matching picasso/monet):
- pycroflow-logo-square.svg  — the motif, 200x200, the icon source
- pycroflow-logo.svg         — horizontal wordmark lockup (flow line under
                               the name, echoing the Picasso signature card)
- pycroflow.ico              — app icon on a white rounded tile (16–256 px)
- make_pycroflow_logo.py     — the parametric generator (--render / --icon),
                               text outlined to paths so the SVGs are
                               self-contained; writes both the canonical .ico
                               and the package copy so they can't drift
- *.png                      — rendered previews

Show it on Windows across every surface:
- GUI: app.setWindowIcon(...) loads PycroFlow/gui/pycroflow.ico (shipped as
  package data) — title bar / taskbar for the frozen exe and a pip install
- PyInstaller: EXE(icon=...) embeds it in pycroflow-gui.exe (Explorer,
  taskbar, Start-menu/desktop shortcuts)
- Inno Setup: SetupIconFile for the installer exe + Add/Remove Programs

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A pump whose head carries an N-port distribution valve (not a simple Y
valve) addresses its valve by integer position and may aspirate without
switching it (input_pos null). `SetupConfig` typed input_pos/output_pos
and flush_pos.inject/flush as str-only, so such rigs (e.g. a Hamilton
PSD with an 8-port head) were rejected by the structured Setup-tab
editor with a confusing "Input should be a valid string".

Widen these to `int | str`. input_pos becomes Optional with a None
default so the form's None-drop in `SchemaForm.to_dict()` doesn't
resurface as an "input_pos: Field required" error when saving a
null-aspirate pump. Pydantic smart union preserves types, so Y-valve
'in'/'out' names are unaffected (not coerced to int), and every shipped
and fixture setup still validates and round-trips unchanged. Runtime
consumers already accept int positions (hamilton_components asserts
pos in [..., *range(1,9), None]).

Adds a hermetic schema test (int positions + absent/null input_pos) and
an end-to-end Setup-editor round-trip test; both fail without the fix.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…positions

fix(setup-schema): accept distribution-valve pump positions
When pump_a carries an N-port distribution valve (not a plain Y valve) it also
multiplexes reservoirs on its own ports and selects the sample / waste legs —
but the Fluid-tab schematic dropped those reservoirs entirely (the topology
only looked at the multiplexer valves) and never showed pump_a's own route to
waste.

fluid_topology() now emits a `pump_a_direct` block (the directly-wired
reservoirs' ports/routes plus the valve's sample/waste/mux ports), computed on
every return path and `None` for a Y-valve pump. The schematic draws those
reservoirs as a column of taps on pump_a's inlet, routes the multiplexer feed
into their rail from above (so it never crosses a tap box), draws pump_a's
waste leg, and lights whichever leg the live valve *port number* selects — a
direct tap, the mux feed, the sample leg or the waste leg. Plain Y-valve
setups are unchanged (same 'in'/'out' logic, no tap column).

Adds hermetic topology tests (direct classification, Y-valve -> None) and a
widget render/behaviour test for the tap column.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Double-light: when pump_a is a distribution valve, every multiplexer route
  now carries pump_a's mux-bridge port, so an MVP reservoir only reads as live
  when pump_a also selects the mux feed — not merely when its own rotary valve
  is parked. Previously, on a mixed MVP + distribution-pump_a rig (e.g. Gauss),
  selecting a direct tap while the MVP valve sat at a reservoir's port lit two
  reservoir paths at once (`_gate_valve_routes_through_pump_a`).
- Hover tooltip now picks its wording from the route's shape (a list of
  (address, port) pairs vs ibidi channel numbers) instead of the setup kind, so
  a pump_a direct tap never reads as an "ibidi channel" on an ibidi+direct rig.
- A no-multiplexer, direct-taps-only setup no longer reserves an empty left
  band (the taps render in the flow region's own tap column).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…a-direct

feat(fluid-schematic): show reservoirs wired directly on pump_a
…able layout + names

Three usability changes to how a run's imaging data is laid out on disk:

1. supporting_data/ sub-folder. Dark-round and wash-monitor movies and every
   PFS .xlsx log now go under <run>/supporting_data/, so the primary round
   movies sit uncluttered at the run-folder top level. (The connect-time test
   acquisition already wrote to a throwaway temp dir, so it never clutters the
   run folder.)

2. Configurable folder layout (img.settings.folder_structure): 'flat' (one
   dataset folder each, '_posN' suffix), 'by_round' (round/posN) or
   'by_position' (posN/round). With a single position no position sub-folder
   or suffix is added. PFS logs keep a flat, unique name so they never collide
   even when datasets are nested.

3. Configurable dataset names (img.settings.filename_template), default
   'round{round}_{name}', placeholders {round}/{name}/{role}/{pos}. The old
   'prtclstep{i}_' prefix is dropped.

The builder stamps each acquire entry with structured round / role / target
provenance; the imaging system formats names via plan_acquisition_targets()
(a pure, unit-tested planner) and falls back to the step message for entry
types that don't supply the fields. Protocol snapshots regenerated for the new
acquire fields.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Dark/main collision (data loss): the default template omits {role}, so a
  round's main and dark acquisitions produced the same base name — and since
  both PFS logs go to supporting_data/, the dark log overwrote the main
  movie's focus log (and the live-FOV ids collided). Role-prefix
  supporting-role names unless the template already places {role}.
- Archive overwrite under nesting: the C15 raw-movie archive keyed its
  destination on the dataset basename, which is non-unique with by_round /
  by_position (posN / roundX). archive_movie() gains a dest_name override; the
  live service passes the FOV's unique name, so a later FOV can't delete an
  earlier archived movie.
- folder_structure is now a validated Literal (flat/by_round/by_position); a
  typo errors at validation instead of silently falling back to flat.
- A filename_template that fails to format (unknown placeholder / bad spec)
  now logs a warning instead of silently reverting to the step message.
- {pos}/{role} placeholder detection handles format specs ({pos:02d}) via
  _template_has_field, so it can't double-append a position suffix.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
feat(imaging): restructure results — supporting_data folder, configurable layout + names
Scrolling through the Experiment Design (and Setup) form put the cursor over
each dropdown in turn, and every wheel notch silently changed the value under
the cursor. The schema form's combo boxes are now a _NoScrollComboBox that
ignores wheel events over the closed control, so the wheel scrolls the form
instead; values change only by clicking and picking an entry. The open dropdown
list still scrolls normally (its wheel events go to the popup view).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
fix(gui): dropdowns in the schema form ignore mouse-wheel scrolling
The cleaning-rounds dropdown offers the design's friendly reservoir *names*,
but the fluid backend keys cleaning on reservoir *ids*: _resolve_cleaning_
reservoir_ids() only knew the fixed-role special_names (e.g. 'h2o') and
silently skipped any other name, so picking a cleaning reservoir by its
friendly name (e.g. 'PBS') cleaned nothing.

assemble_hamilton_config now resolves every cleaning entry — int id,
special-role name, or friendly reservoir name (via the design's
reservoir_names) — to an id before handing it to the backend, which then
works purely in ids. An unresolvable name raises at connect instead of
silently no-op'ing. The cleaning dialog still shows friendly names (it
reverse-resolves ids via _reservoir_names / special_names).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
fix(fluid): cleaning-reservoir selection by name now works
Add PycroFlow logo and wire the app icon into the GUI + installer
…atus-bar progress

Four usability fixes to the tubing-cleaning procedure (ahead of a release):

1. Dialog size: it opened at the tiny QTableWidget size hint, needing a manual
   resize to read the content. It now sizes to its content (capped), so it
   opens readable.
2. Actionable default: a meaningful clean needs a liquid to flush with, so with
   no cleaning_rounds configured the Clean button was disabled unless you
   switched to Custom and set a >0 pre-empty. The dialog now always offers the
   setup's flush/wash buffer (flushbuffer_a) as a selectable rinse liquid —
   checked by default when there are no dedicated cleaning rounds — so a
   start-of-experiment rinse runs straight from the Default view (0 pre-empty,
   no retraction). cleaning_plan() exposes the wash buffer; rigs that configure
   their own cleaning rounds are unchanged (the buffer is offered unchecked).
3. Preamble: a short note at the top explaining what the procedure does.
4. Status-bar progress: clean_tubings takes a `progress` callback (threaded
   through the pre-empty / chain / individual helpers, with friendly reservoir
   labels); the Fluid tab marshals it to the main-window status bar via a Qt
   signal so each step shows while the clean runs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Mirror the clean-tubings usability pass for fill:

- Clicking "Fill tubings" now first shows a short confirmation explaining what
  it does (prime each reservoir's tubing up to its valve, then flush the
  central tubing with the flush buffer), so it never moves liquid unannounced.
- fill_tubings() takes a `progress` callback and reports each step ("Filling
  from <reservoir>…", "Filling central tubing with flush buffer…") with
  friendly reservoir labels; the Fluid tab marshals it to the main-window
  status bar.

The per-op status plumbing added for clean is generalized (_op_step signal +
_op_progress(what) helper), so clean and fill share one thread-safe status-bar
path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… hardware

`cleaning_plan()` tested `wash_id in reservoir_a`, but on a connected rig
`reservoir_a` is a `ReservoirDict`, which has no `__contains__` — so the `in`
raised `TypeError`. `_on_clean` swallows plan errors (`except: plan = None`),
so the whole new per-reservoir clean dialog (table, wash-buffer rinse option,
proper sizing) silently never appeared on real hardware; the app fell back to
the old whole-system confirm. The unit test missed it because its fake used a
plain dict.

Test membership against `reservoir_a.keys()` instead, and make the regression
test use a real `ReservoirDict` so the production shape is exercised.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
feat(clean): usable clean-tubings dialog + status-bar step progress
* feat(monet): bump to v0.7.17 + a Disconnect button on the Monet tab

monet moved on since we pinned it; update the [hardware] pin v0.6.13 -> v0.7.17.
The monet API PycroFlow uses is unchanged (monet.CONFIGS/PROTOCOLS,
control.IlluminationLaserControl(config, auto_enable_lasers=...), gui.MonetWidget
+ shutdown, io.check_server_auth), and monet's PyQt6<7 / picasso-registry@v0.1.0
pins stay compatible. CI never installs monet (mocked; [hardware] not installed),
so the bump only affects lab installs.

Also fix being stuck after a live monet check: monet's embedded widget has a
Connect but no Disconnect, so once you connected monet to view the sample you
could neither start an experiment (monet held the laser ports) nor release it.
The Monet tab gains a "Disconnect monet" button (calls MonetWidget.shutdown(),
which releases the lasers/serial ports), enabled once monet reports connected.
Starting a run also releases monet (set_run_lock), but disconnecting first is
the reliable path since the auto-release fires as the run is already starting.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(monet-tab): address code-review findings

- Only release monet on run-lock when it is actually connected. `set_run_lock`
  used to call `disconnect_monet()` → monet `shutdown()` on every run start;
  `shutdown()` joins monet's calibration worker, so with a calibration running
  that could block the GUI thread for up to 5 s right as the run starts (and it
  was pointless work when monet was never connected). Gate it on
  `self._monet_connected`.
- Log (instead of silently swallowing) a failure to wire monet's `connected`
  signal, so a never-enabling Disconnect button is diagnosable.

Reviewed and left as-is: monet's own "Connected" banner stays stale after a
release (a monet-side display concern — PycroFlow's Disconnect button is the
authoritative PycroFlow-side indicator), and the best-effort auto-release can
still race a run start (disconnecting from the tab first is the reliable path,
as documented). Reconnect after disconnect works (monet rebuilds its pc), and
the `connected` signal is emitted on the GUI thread (slot wiring is safe) — both
verified against the real monet source.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
release: stamp CHANGELOG [0.3.8]
@Heerpa
Heerpa merged commit 7c8f817 into master Dec 2, 2026
12 checks passed
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.

1 participant