skills/opentrons-integration/references/validation_and_operations.md
Use layered validation. A protocol is not ready for live samples merely because it compiles or simulates.
The skill pins separate compatibility environments:
requirements-flex.txt: opentrons==9.1.1, Flex API 2.29.requirements-ot2.txt: opentrons==9.0.0, OT-2 API 2.28.One-shot simulation:
# Flex
uv run --with "opentrons==9.1.1" opentrons_simulate protocol.py
# OT-2
uv run --with "opentrons==9.0.0" opentrons_simulate protocol.py
Dedicated Flex environment:
uv venv --python 3.10
uv pip install --python .venv/bin/python -r skills/opentrons-integration/requirements-flex.txt
.venv/bin/opentrons_simulate protocol.py
Use requirements-ot2.txt instead for the OT-2 compatibility environment.
opentrons==9.1.1 intentionally rejects OT-2 protocols after the release-line
split; the current OT-2 App remains the authoritative OT-2 analyzer.
Check the package and maximum API implemented by the local library:
uv run --with "opentrons==9.1.1" python -c \
"import opentrons; from opentrons import protocol_api; print(opentrons.__version__, protocol_api.MAX_SUPPORTED_VERSION)"
The local package does not update robot software. A protocol can simulate locally and still request an API level unavailable on the target robot.
python -m py_compile protocol.py
This catches Python syntax errors only. It does not instantiate Protocol API objects or validate deck geometry.
# Flex
uv run --with "opentrons==9.1.1" opentrons_simulate protocol.py
# OT-2
uv run --with "opentrons==9.0.0" opentrons_simulate protocol.py
Review:
Useful simulator options:
# More diagnostic logs
opentrons_simulate -l info protocol.py
# Custom labware directory; repeat -L as needed
opentrons_simulate -L custom_labware protocol.py
# Add only named data files; repeat -d as needed
opentrons_simulate -d plate_map.csv protocol.py
# Experimental estimate
opentrons_simulate -e protocol.py
Prefer -d over -D for data because -D loads every file in a directory
into memory. Never point -D at a directory containing credentials, unrelated
data, or large files.
The current directory is searched for custom labware implicitly, but explicit
-L paths make validation more reproducible.
Independently calculate:
Simulation does not prove that the liquid budget is sufficient.
Use the App appropriate for the target robot. At API 2.29 and newer, Flex and OT-2 use separate software and App release lines.
App analysis is closer to the target robot than local simulation, but it still does not verify actual liquids, tips, caps, seals, or calibration.
Use a second-person check for:
For a new or materially changed method:
A tip-only dry run is appropriate for new partial-nozzle layouts.
Keep:
opentrons package version used in local simulation.The default value should always produce a meaningful local simulation.
For each parameter:
The command-line simulator primarily analyzes defaults. Use App analysis or dedicated test variants to exercise alternate runtime values.
Before live use:
Do not silently replace a missing custom definition with standard labware.
Symptoms:
Actions:
Do not edit the version string alone; audit every method and behavior gate.
Actions:
p300_single_flex with current
flex_* names only after matching volume and channel count.Check:
Count:
new_tip="always" pair.Add racks or redesign the validated tip policy. Do not reset tracking unless the operator has physically replaced or correctly refilled racks.
Include distribution disposal volume, dead volume, pre-wet, mixing, carryover, and reserve. Liquid setup visualization does not prevent a physical source from running dry.
Check:
The reader returns zeros during simulation. Skip or substitute analysis-only
calculations under protocol.is_simulating() when a zero denominator is
possible. Keep the physical-run path unchanged.
Stop the run if collision or pickup failure is possible. Check calibration, labware definition, offsets, tip compatibility, adapter use, nozzle layout, and deck placement. Do not compensate with arbitrary offsets until the underlying geometry is understood.