Skip to content

fix(fluidics): update the fluidics library to Squid-Fluidics main (fluidics saves work on Windows) - #869

Open
hongquanli wants to merge 2 commits into
masterfrom
fix/bump-fluidics-v2-windows-save
Open

hongquanli wants to merge 2 commits into
masterfrom
fix/bump-fluidics-v2-windows-save

Conversation

@hongquanli

Copy link
Copy Markdown
Contributor

Moves the software/fluidics_v2 submodule from 020040cb to 5b3dc750, the head of Squid-Fluidics main. The reason is the Windows save fix; two other upstream changes come with it.

What it brings in

  • Saves work on Windows (Cephla-Lab/Squid-Fluidics#58).
    • The library's atomic_write called os.fchmod, which Windows lacks before Python 3.13.
    • On a Windows rig (Python 3.10), every save through the library raised AttributeError: configs, sequences and run reports.
    • In Squid, the run-report writer thread logged Uncaught Exception! at the end of every fluidics step, and no run report was ever saved.
    • os.fchmod is now called on POSIX only.
  • The valve driver gives up on a dead I2C bus instead of hanging the MCU (Cephla-Lab/Squid-Fluidics#61). This is firmware only, and it takes effect when a controller is flashed; this PR moves only the source.
  • A set_temperature step can be told not to wait (Cephla-Lab/Squid-Fluidics#63).
    • The step takes a new optional field, wait, default true, so existing protocols run as before.
    • With wait: false the step sets the target, switches the TEC output on and moves on.
    • The time estimate drops its fixed 60 s for such a step.

Compatibility with Squid

Squid keeps fluidics rows as plain dicts and hands them to the library unchanged (strip_for_library drops only imaging rows). So wait reaches the library's validation, plan() (the time estimate) and run() as written.

Checked through Squid's LibraryFluidicsPort: a set_temperature row plans at 60 s, and at 0 s with wait: false.

Squid change

The Protocol tab's row editor now shows a yes/no field such as wait as a checkbox. Before, it was a number box that read 1 and accepted any number.

  • The box is ticked from the row's value or, if the row has none, from the library's default.
  • Unticking stores wait: false.
  • A row without the field stores nothing until the box is changed.

Tests

The fluidics-related tests were run with the submodule checked out and the library importable, as CI does with pip install --no-deps -e fluidics_v2/software:

  • tests/control/core/fluidics_protocol/
  • tests/control/widgets_fluidics/
  • tests/control/test_fluidics_system.py
  • tests/control/models/test_fluidics_protocol.py
  • tests/control/models/test_fluidics_run.py
  • tests/control/test_microscope.py
  • tests/control/test_theme_conversion.py

Library bump alone, on macOS:

PyQt5 PyQt6
before (020040cb) 167 passed, 1 failed 167 passed, 1 failed
after (5b3dc750) 167 passed, 1 failed 167 passed, 1 failed

The one failure is the same at both pins: test_a_tall_window_shows_the_whole_instrument_block opens a window taller than the local screen allows. Under Qt's offscreen platform it passes.

The editor change adds two tests in test_protocol_tab.py. Both failed before the change:

  • a wait checkbox that stores false when unticked and keeps the row valid;
  • a row without wait that shows it ticked and stores nothing until changed.

With the change, tests/control/widgets_fluidics/ passes in full under the offscreen platform: 79 passed on PyQt5 and 79 on PyQt6.

Also run in the simulated GUI (PyQt6):

  • The Fluidics tab initialized.
  • A protocol with a flow step and a set_temperature step with wait: false ran to finished.
  • The run report was written, with a 0 s estimate for the temperature step.
  • Clicking the wait checkbox stored wait: false, and the row stayed valid.

Not verified

  • Not run on Windows. The fix is upstream's; its test simulates Windows on Linux.
  • The valve firmware fix needs a flash to take effect.

🤖 Generated with Claude Code

hongquanli and others added 2 commits November 26, 2026 20:23
…uidics saves work on Windows)

Moves the software/fluidics_v2 submodule from 020040cb to 5b3dc750, the
head of Squid-Fluidics main. That brings in three upstream PRs:

- Cephla-Lab/Squid-Fluidics#58: atomic_write calls os.fchmod on POSIX
  only. Windows has no os.fchmod before Python 3.13, so on a Windows rig
  every save through the library raised AttributeError: configs,
  sequences and run reports. In Squid the report writer thread logged
  "Uncaught Exception!" at the end of every fluidics step, and no run
  report was ever saved.
- Cephla-Lab/Squid-Fluidics#61: the valve driver gives up on a dead I2C
  bus instead of hanging the MCU. Firmware only.
- Cephla-Lab/Squid-Fluidics#63: a set_temperature step takes an optional
  `wait` (default true). Squid hands fluidics rows to the library as
  plain dicts, so the field reaches its validation, time estimate and
  run unchanged.

No Squid code changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ckbox

The library update brings set_temperature's optional `wait` (a bool,
default true). The Protocol tab's row editor made a number box for every
field that is not a string or a float, so `wait` read "1", stored 0 or 1,
and any other number made the row invalid ("wait: Input should be a
valid boolean") until it was corrected.

A field the library's model types as bool now gets a checkbox, ticked
from the row's value or the model's default, and an edit stores
True/False. A row without the field shows it ticked and stores nothing
until the box is changed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 27, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 34 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available. Your 52 included PR review attempts over the past 7 days set your current allowance at 4 reviews per hour.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Team
  • Run ID: d9a6d275-4a32-49b7-96b8-c4208f4f987b
Commits

Reviewing files that changed from the base of the PR and between 8f3a879 and 38104ce.

Files selected for processing: 3

  • software/control/widgets_fluidics/protocol_tab.py
  • software/fluidics_v2
  • software/tests/control/widgets_fluidics/test_protocol_tab.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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