Repository navigation
feat(monet): bump to v0.7.17 + Disconnect button on the Monet tab - #72
Conversation
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>
- 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>
Deep code review (monet-tab correctness + full monet API-compat sweep) → fixed in 88077b1monet v0.7.17 API compatibility — fully verified against the real monet source. All ~25 symbols PycroFlow uses ( Fixed:
Verified safe (no change):
Left as-is (monet-side / inherent): monet's own "Connected" banner stays stale after a release (a monet display concern — PycroFlow's Disconnect button is the authoritative PycroFlow-side indicator); the best-effort auto-release can still race a run start, which is why disconnecting from the tab first is the documented reliable path. New test: a run start does NOT call |
Two related changes.
1. monet dependency
v0.6.13→v0.7.17monet moved on since we pinned it. I verified the monet API PycroFlow actually uses is unchanged against the current version:
monet.CONFIGS/monet.PROTOCOLS/monet.LASER_TAGmonet.control.IlluminationLaserControl(config, auto_enable_lasers=…)+load_calibration_database()monet.gui.MonetWidget/MonetMainWindow/shutdown()/connectedmonet.io.check_server_authmonet's own pins stay compatible with PycroFlow's:
PyQt6<7(⊇ our<6.12) andpicasso-registry @ v0.1.0(same as ours). CI is unaffected — the hosted CI installs.[dev,gui], not[hardware](where the monet git dep lives), and monet is mocked; the bump only affects lab installs.2. Disconnect monet from the Monet tab
Problem: if you connect monet (in the Monet tab) to check the sample live before an acquisition, you then can't start an experiment — monet holds the laser COM ports — and monet's embedded widget has a Connect but no Disconnect, so you're stuck.
Fix: the Monet tab gains a "Disconnect monet" button that calls
MonetWidget.shutdown()(disables the lasers and releases the serial ports / SDK sessions), enabled once monet reports it has connected. Starting a run also releases monet automatically (set_run_lock), but disconnecting first is the reliable path — the auto-release fires as the run is already starting, so it can race the orchestrator opening the lasers. The tab's explainer now says to disconnect before a run.Tests
test_disconnect_button_releases_monet: button disabled until monet'sconnectedfires; clicking it callsshutdown()and re-disables.test_run_lock_releases_monet: starting a run releases monet (shutdown) and greys its controls.Full suite passes bar the known monet dev-container flake (
test_placeholder_when_monet_absent, green in CI).🤖 Generated with Claude Code