Skip to content

Commit 4cc3fb0

Browse files
committed
Merge branch 'edge' into fix_text-area-style-issue
2 parents 2533b58 + 84a57ce commit 4cc3fb0

File tree

60 files changed

+1115
-128
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1115
-128
lines changed

analyses-snapshot-testing/Makefile

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ CACHEBUST ?= $(shell date +%s)
33
ANALYSIS_REF ?= edge
44
PROTOCOL_NAMES ?= all
55
OVERRIDE_PROTOCOL_NAMES ?= all
6-
OPENTRONS_VERSION ?= edge
6+
LOCAL_IMAGE_TAG ?= local
7+
ANALYZER_IMAGE_NAME ?= opentrons-analysis
78

8-
export OPENTRONS_VERSION # used for server
9-
export ANALYSIS_REF # used for analysis and snapshot test
10-
export PROTOCOL_NAMES # used for the snapshot test
11-
export OVERRIDE_PROTOCOL_NAMES # used for the snapshot test
9+
export ANALYSIS_REF # tag, branch or commit for the opentrons repository. Used as the image tag for the analyzer image
10+
export PROTOCOL_NAMES # tell the test which protocols to run
11+
export OVERRIDE_PROTOCOL_NAMES # tell the test which override protocols to run
1212

1313
ifeq ($(CI), true)
1414
PYTHON=python
@@ -93,23 +93,47 @@ build-base-image:
9393

9494
.PHONY: build-opentrons-analysis
9595
build-opentrons-analysis:
96-
@echo "Building docker image for $(ANALYSIS_REF)"
97-
@echo "The image will be named opentrons-analysis:$(ANALYSIS_REF)"
98-
@echo "If you want to build a different version, run 'make build-opentrons-analysis ANALYSIS_REF=<version>'"
99-
docker build --build-arg BASE_IMAGE_NAME=$(BASE_IMAGE_NAME) --build-arg ANALYSIS_REF=$(ANALYSIS_REF) --build-arg CACHEBUST=$(CACHEBUST) -t opentrons-analysis:$(ANALYSIS_REF) -f citools/Dockerfile.analyze citools/.
96+
@echo "Building docker image for opentrons repository reference$(ANALYSIS_REF)"
97+
@echo "The image will be named $(ANALYZER_IMAGE_NAME):$(ANALYSIS_REF)"
98+
@echo "If you want to build a different version, run 'make build-opentrons-analysis ANALYSIS_REF=<tag, branch, or commit>'"
99+
docker build --build-arg BASE_IMAGE_NAME=$(BASE_IMAGE_NAME) --build-arg ANALYSIS_REF=$(ANALYSIS_REF) --build-arg CACHEBUST=$(CACHEBUST) -t $(ANALYZER_IMAGE_NAME):$(ANALYSIS_REF) -f citools/Dockerfile.analyze citools/.
100100

101-
.PHONY: local-build
102-
local-build:
101+
.PHONY: build-local
102+
build-local:
103103
@echo "Building docker image for your local opentrons code"
104-
@echo "The image will be named opentrons-analysis:local"
105-
@echo "For a fresh build, run 'make local-build NO_CACHE=1'"
106-
docker build --build-arg BASE_IMAGE_NAME=$(BASE_IMAGE_NAME) $(BUILD_FLAGS) -t opentrons-analysis:local -f citools/Dockerfile.local .. || true
104+
@echo "This image will be named $(ANALYZER_IMAGE_NAME):$(LOCAL_IMAGE_TAG)"
105+
docker build --build-arg BASE_IMAGE_NAME=$(BASE_IMAGE_NAME) -t $(ANALYZER_IMAGE_NAME):$(LOCAL_IMAGE_TAG) -f citools/Dockerfile.local ..
107106
@echo "Build complete"
108107

108+
.PHONY: snapshot-test-local
109+
snapshot-test-local: ANALYSIS_REF=$(LOCAL_IMAGE_TAG)
110+
snapshot-test-local: build-base-image build-local
111+
@echo "This target is overriding the ANALYSIS_REF to the LOCAL_IMAGE_TAG: $(LOCAL_IMAGE_TAG)"
112+
@echo "ANALYSIS_REF is $(ANALYSIS_REF). The the test maps this env variable to the image tag."
113+
@echo "The image the test will use is $(ANALYZER_IMAGE_NAME):$(LOCAL_IMAGE_TAG)"
114+
@echo "PROTOCOL_NAMES is $(PROTOCOL_NAMES)"
115+
@echo "OVERRIDE_PROTOCOL_NAMES is $(OVERRIDE_PROTOCOL_NAMES)"
116+
$(PYTHON) -m pipenv run pytest -k analyses_snapshot_test -vv
117+
118+
.PHONY: snapshot-test-update-local
119+
snapshot-test-update-local: ANALYSIS_REF=$(LOCAL_IMAGE_TAG)
120+
snapshot-test-update-local: build-base-image build-local
121+
@echo "This target is overriding the ANALYSIS_REF to the LOCAL_IMAGE_TAG: $(LOCAL_IMAGE_TAG)"
122+
@echo "ANALYSIS_REF is $(ANALYSIS_REF). The the test maps this env variable to the image tag."
123+
@echo "The image the test will use is $(ANALYZER_IMAGE_NAME):$(LOCAL_IMAGE_TAG)"
124+
@echo "PROTOCOL_NAMES is $(PROTOCOL_NAMES)"
125+
@echo "OVERRIDE_PROTOCOL_NAMES is $(OVERRIDE_PROTOCOL_NAMES)"
126+
$(PYTHON) -m pipenv run pytest -k analyses_snapshot_test --snapshot-update
127+
109128
.PHONY: generate-protocols
110129
generate-protocols:
111130
$(PYTHON) -m pipenv run python -m automation.data.protocol_registry
112131

132+
# Tools for running the robot server in a container
133+
134+
OPENTRONS_VERSION ?= edge
135+
export OPENTRONS_VERSION # used for the robot server image as the tag, branch or commit for the opentrons repository
136+
113137
.PHONY: build-rs
114138
build-rs:
115139
@echo "Building docker image for opentrons-robot-server:$(OPENTRONS_VERSION)"

analyses-snapshot-testing/README.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
1. Follow the instructions in [DEV_SETUP.md](../DEV_SETUP.md)
66
1. `cd analyses-snapshot-testing`
7-
1. use pyenv to install python 3.12 and set it as the local python version for this directory
7+
1. use pyenv to install python 3.13 and set it as the local python version for this directory
88
1. `make setup`
99
1. Have docker installed and ready
1010

@@ -72,10 +72,17 @@ cd analyses-snapshot-testing \
7272

7373
> This copies in your local code to the container and runs the analyses battery against it.
7474

75-
1. `make build-base-image`
76-
1. `make build-local`
77-
1. `make local-snapshot-test`
75+
`cd PYENV_ROOT && git pull` - make sure pyenv is up to date so you may install python 3.13.0
76+
`pyenv install 3.13.0` - install python 3.13.0
77+
`cd <OPENTRONS_REPO_ROOT>/analyses-snapshot-testing` - navigate to the analyses-snapshot-testing directory
78+
`pyenv local 3.13.0` - set the local python version to 3.13.0
79+
`make setup` - install the requirements
80+
`make snapshot-test-local` - this target builds the base image, builds the local code into the base image, then runs the analyses battery against the image you just created
7881

7982
You have the option to specify one or many protocols to run the analyses on. This is also described above [Running the tests against specific protocols](#running-the-tests-against-specific-protocols)
8083

81-
- `make local-snapshot-test PROTOCOL_NAMES=Flex_S_v2_19_Illumina_DNA_PCR_Free OVERRIDE_PROTOCOL_NAMES=none`
84+
- `make snapshot-test-local PROTOCOL_NAMES=Flex_S_v2_19_Illumina_DNA_PCR_Free OVERRIDE_PROTOCOL_NAMES=none`
85+
86+
### Updating the snapshots locally
87+
88+
- `make snapshot-test-update-local` - this target builds the base image, builds the local code into the base image, then runs the analyses battery against the image you just created, updating the snapshots by passing the `--update-snapshots` flag to the test

api/docs/v2/versioning.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ This table lists the correspondence between Protocol API versions and robot soft
134134
Changes in API Versions
135135
=======================
136136

137+
Version 2.21
138+
------------
139+
- :ref:`Liquid presence detection <lpd>` now only checks on the first aspiration of the :py:meth:`.mix` cycle.
140+
137141
Version 2.20
138142
------------
139143

api/src/opentrons/hardware_control/backends/ot3controller.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,6 +1008,7 @@ def _lookup_serial_key(pipette_name: FirmwarePipetteName) -> str:
10081008
lookup_name = {
10091009
FirmwarePipetteName.p1000_single: "P1KS",
10101010
FirmwarePipetteName.p1000_multi: "P1KM",
1011+
FirmwarePipetteName.p1000_multi_em: "P1KP",
10111012
FirmwarePipetteName.p50_single: "P50S",
10121013
FirmwarePipetteName.p50_multi: "P50M",
10131014
FirmwarePipetteName.p1000_96: "P1KH",

api/src/opentrons/hardware_control/dev_types.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ class PipetteDict(InstrumentDict):
100100
pipette_bounding_box_offsets: PipetteBoundingBoxOffsetDefinition
101101
current_nozzle_map: NozzleMap
102102
lld_settings: Optional[Dict[str, Dict[str, float]]]
103+
plunger_positions: Dict[str, float]
104+
shaft_ul_per_mm: float
103105

104106

105107
class PipetteStateDict(TypedDict):

api/src/opentrons/hardware_control/instruments/ot2/pipette.py

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
CommandPreconditionViolated,
2929
)
3030
from opentrons_shared_data.pipette.ul_per_mm import (
31-
piecewise_volume_conversion,
31+
calculate_ul_per_mm,
3232
PIPETTING_FUNCTION_FALLBACK_VERSION,
3333
PIPETTING_FUNCTION_LATEST_VERSION,
3434
)
@@ -584,21 +584,9 @@ def get_nominal_tip_overlap_dictionary_by_configuration(
584584
# want this to unbounded.
585585
@functools.lru_cache(maxsize=100)
586586
def ul_per_mm(self, ul: float, action: UlPerMmAction) -> float:
587-
if action == "aspirate":
588-
fallback = self._active_tip_settings.aspirate.default[
589-
PIPETTING_FUNCTION_FALLBACK_VERSION
590-
]
591-
sequence = self._active_tip_settings.aspirate.default.get(
592-
self._pipetting_function_version, fallback
593-
)
594-
else:
595-
fallback = self._active_tip_settings.dispense.default[
596-
PIPETTING_FUNCTION_FALLBACK_VERSION
597-
]
598-
sequence = self._active_tip_settings.dispense.default.get(
599-
self._pipetting_function_version, fallback
600-
)
601-
return piecewise_volume_conversion(ul, sequence)
587+
return calculate_ul_per_mm(
588+
ul, action, self._active_tip_settings, self._pipetting_function_version
589+
)
602590

603591
def __str__(self) -> str:
604592
return "{} current volume {}ul critical point: {} at {}".format(

api/src/opentrons/hardware_control/instruments/ot2/pipette_handler.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,13 @@ def get_attached_instrument(self, mount: MountType) -> PipetteDict:
260260
"pipette_bounding_box_offsets"
261261
] = instr.config.pipette_bounding_box_offsets
262262
result["lld_settings"] = instr.config.lld_settings
263+
result["plunger_positions"] = {
264+
"top": instr.plunger_positions.top,
265+
"bottom": instr.plunger_positions.bottom,
266+
"blow_out": instr.plunger_positions.blow_out,
267+
"drop_tip": instr.plunger_positions.drop_tip,
268+
}
269+
result["shaft_ul_per_mm"] = instr.config.shaft_ul_per_mm
263270
return cast(PipetteDict, result)
264271

265272
@property

api/src/opentrons/hardware_control/instruments/ot3/pipette.py

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
InvalidInstrumentData,
2828
)
2929
from opentrons_shared_data.pipette.ul_per_mm import (
30-
piecewise_volume_conversion,
30+
calculate_ul_per_mm,
3131
PIPETTING_FUNCTION_FALLBACK_VERSION,
3232
PIPETTING_FUNCTION_LATEST_VERSION,
3333
)
@@ -529,23 +529,13 @@ def tip_presence_responses(self) -> int:
529529
# want this to unbounded.
530530
@functools.lru_cache(maxsize=100)
531531
def ul_per_mm(self, ul: float, action: UlPerMmAction) -> float:
532-
if action == "aspirate":
533-
fallback = self._active_tip_settings.aspirate.default[
534-
PIPETTING_FUNCTION_FALLBACK_VERSION
535-
]
536-
sequence = self._active_tip_settings.aspirate.default.get(
537-
self._pipetting_function_version, fallback
538-
)
539-
elif action == "blowout":
540-
return self._config.shaft_ul_per_mm
541-
else:
542-
fallback = self._active_tip_settings.dispense.default[
543-
PIPETTING_FUNCTION_FALLBACK_VERSION
544-
]
545-
sequence = self._active_tip_settings.dispense.default.get(
546-
self._pipetting_function_version, fallback
547-
)
548-
return piecewise_volume_conversion(ul, sequence)
532+
return calculate_ul_per_mm(
533+
ul,
534+
action,
535+
self._active_tip_settings,
536+
self._pipetting_function_version,
537+
self._config.shaft_ul_per_mm,
538+
)
549539

550540
def __str__(self) -> str:
551541
return "{} current volume {}ul critical point: {} at {}".format(
@@ -585,6 +575,7 @@ def as_dict(self) -> "Pipette.DictType":
585575
"versioned_tip_overlap": self.tip_overlap,
586576
"back_compat_names": self._config.pipette_backcompat_names,
587577
"supported_tips": self.liquid_class.supported_tips,
578+
"shaft_ul_per_mm": self._config.shaft_ul_per_mm,
588579
}
589580
)
590581
return self._config_as_dict

api/src/opentrons/hardware_control/instruments/ot3/pipette_handler.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,13 @@ def get_attached_instrument(self, mount: OT3Mount) -> PipetteDict:
282282
"pipette_bounding_box_offsets"
283283
] = instr.config.pipette_bounding_box_offsets
284284
result["lld_settings"] = instr.config.lld_settings
285+
result["plunger_positions"] = {
286+
"top": instr.plunger_positions.top,
287+
"bottom": instr.plunger_positions.bottom,
288+
"blow_out": instr.plunger_positions.blow_out,
289+
"drop_tip": instr.plunger_positions.drop_tip,
290+
}
291+
result["shaft_ul_per_mm"] = instr.config.shaft_ul_per_mm
285292
return cast(PipetteDict, result)
286293

287294
@property

api/src/opentrons/hardware_control/ot3api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ async def _update_position_estimation(
776776
"""
777777
Function to update motor estimation for a set of axes
778778
"""
779-
779+
await self._backend.update_motor_status()
780780
if axes:
781781
checked_axes = [ax for ax in axes if ax in Axis]
782782
else:

0 commit comments

Comments
 (0)