Skip to content

Preserve saved tip state during tracker restoration - #1466

Open
hazlamshamin wants to merge 1 commit into
mainfrom
feat/ot2-eight-channel-upstream
Open

hazlamshamin wants to merge 1 commit into
mainfrom
feat/ot2-eight-channel-upstream

Conversation

@hazlamshamin

@hazlamshamin hazlamshamin commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Preserve committed tip state and saved liquid volume when loading a tip tracker. Attaching a deserialized tip to its spot changes its resource placement. Comparing tip states after attachment can incorrectly create a pending transaction, and ignoring the saved volume state loses the liquid in the tip.

  • Compare committed and pending tip states before attachment, and reuse the committed tip when both states match.
  • Restore saved committed and pending liquid volumes through the tip volume tracker.
  • Preserve pending pickup and removal transactions, resource-tree ownership, and the existing saved state format.

The shared TipSpot.serialize_state() and TipSpot.load_state() APIs delegate to this tracker. The fix therefore also applies to rack state used by the current OT-2 driver. No pipette driver or hardware command changes are included.

Verification

Three regression tests fail against upstream main at 3eb0b68cbda63095a4172dccc9844185deb3a674 and pass with the fix. A fourth test checks preservation of pending pickup transactions.

  • python -m pytest -q pylabrobot/legacy/liquid_handling pylabrobot/resources pylabrobot/legacy/tip_tracker_tests.py pylabrobot/opentrons/ot2 pylabrobot/opentrons/tracking_tests.py — 954 passed, 8 unchanged skips, and 341 subtests passed.
  • python -m ruff check pylabrobot/legacy/tip_tracker.py pylabrobot/legacy/tip_tracker_tests.py — passed.
  • python -m ruff format --check pylabrobot/legacy/tip_tracker.py pylabrobot/legacy/tip_tracker_tests.py — passed.
  • python -m mypy --follow-imports=silent --ignore-missing-imports pylabrobot/legacy/tip_tracker.py — passed; scoped to the changed source file.

Existing tests and CI configuration are unchanged. The full repository test suite and hardware tests did not run for this change.

@hazlamshamin
hazlamshamin requested a review from a team as a code owner October 2, 2026 21:21
@rickwierenga

Copy link
Copy Markdown
Member

why not add this to the new OT driver rather than legacy?

Compare committed and pending tips before attaching a tip to its
holder. Resource placement must not turn a committed state into a
pending transaction.

Restore saved liquid volume through the committed tip volume tracker.
Reuse the committed tip when both tip states match, while preserving
pending pickup and removal transactions for commit or rollback.

Keep resource-tree tip ownership and the saved state format unchanged.
@hazlamshamin
hazlamshamin force-pushed the feat/ot2-eight-channel-upstream branch from cb27f46 to b3bd5a7 Compare October 6, 2026 02:48
@hazlamshamin hazlamshamin changed the title Support OT-2 GEN2 eight-channel full-head operations Preserve saved tip state during tracker restoration Oct 6, 2026
@hazlamshamin

Copy link
Copy Markdown
Collaborator Author

oh god, i genuinely missed that. been working and building on top with the legacy one even before the new driver is merged last month. didn't realise it. but thats a good news for me too then... i have narrowed this PR to just the saved tip-state restoration, since the eight-channel capability i needed already exists in the new driver. apologies for duplicating!

This branch has not been deployed

No deployments
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.

2 participants