From f4feee984495ce1b04a07fea2304aaf91b96956c Mon Sep 17 00:00:00 2001 From: Alise Au <20424172+ahiuchingau@users.noreply.github.com> Date: Thu, 2 May 2019 08:54:20 -0400 Subject: [PATCH] feat(api): add pipette plus constructors (#3407) --- api/src/opentrons/legacy_api/api.py | 49 ++++++++++++++++++- .../opentrons/config/test_pipette_config.py | 2 +- .../labware/test_pipette_constructors.py | 3 ++ shared-data/robot-data/pipetteModelSpecs.json | 6 +-- 4 files changed, 55 insertions(+), 5 deletions(-) diff --git a/api/src/opentrons/legacy_api/api.py b/api/src/opentrons/legacy_api/api.py index 13ce54786cd..1a1df7c5363 100644 --- a/api/src/opentrons/legacy_api/api.py +++ b/api/src/opentrons/legacy_api/api.py @@ -79,6 +79,20 @@ def P10_Multi( aspirate_flow_rate, dispense_flow_rate, min_volume, max_volume) + def P20_Plus_Single( + self, + mount, + trash_container='', + tip_racks=[], + aspirate_flow_rate=None, + dispense_flow_rate=None, + min_volume=None, + max_volume=None): + return self.pipette_by_name(mount, 'p+20_single', + trash_container, tip_racks, + aspirate_flow_rate, dispense_flow_rate, + min_volume, max_volume) + def P50_Single( self, mount, @@ -121,6 +135,20 @@ def P300_Single( aspirate_flow_rate, dispense_flow_rate, min_volume, max_volume) + def P300_Plus_Single( + self, + mount, + trash_container='', + tip_racks=[], + aspirate_flow_rate=None, + dispense_flow_rate=None, + min_volume=None, + max_volume=None): + return self.pipette_by_name(mount, 'p+300_single', + trash_container, tip_racks, + aspirate_flow_rate, dispense_flow_rate, + min_volume, max_volume) + def P300_Multi( self, mount, @@ -149,6 +177,20 @@ def P1000_Single( aspirate_flow_rate, dispense_flow_rate, min_volume, max_volume) + def P1000_Plus_Single( + self, + mount, + trash_container='', + tip_racks=[], + aspirate_flow_rate=None, + dispense_flow_rate=None, + min_volume=None, + max_volume=None): + return self.pipette_by_name(mount, 'p+1000_single', + trash_container, tip_racks, + aspirate_flow_rate, dispense_flow_rate, + min_volume, max_volume) + def pipette_by_name( self, mount, @@ -238,7 +280,12 @@ def retrieve_version_number(self, mount, expected_model_substring): # pass a default pipette model-version for when robot is simulating # this allows any pipette to be simulated, regardless of what is # actually attached/cached on the robot's mounts - return expected_model_substring + '_v1' # default to v1 + # + # from all available config models that match the expected string, + # pick the first one for simulation + return list(filter( + lambda m: expected_model_substring in m, + pipette_config.config_models))[0] instruments = InstrumentsWrapper(robot) diff --git a/api/tests/opentrons/config/test_pipette_config.py b/api/tests/opentrons/config/test_pipette_config.py index f135eabe522..f6aef18f61a 100644 --- a/api/tests/opentrons/config/test_pipette_config.py +++ b/api/tests/opentrons/config/test_pipette_config.py @@ -16,7 +16,7 @@ (c.startswith('p1000') or c.startswith('p300_multi') or c.endswith('1.5') - or c.endswith('v2'))]) + or c.endswith('v2.0'))]) def test_versioned_aspiration(pipette_model, monkeypatch): monkeypatch.setattr(ff, 'use_old_aspiration_functions', diff --git a/api/tests/opentrons/labware/test_pipette_constructors.py b/api/tests/opentrons/labware/test_pipette_constructors.py index 5b1a9ed2586..a19876f39e3 100644 --- a/api/tests/opentrons/labware/test_pipette_constructors.py +++ b/api/tests/opentrons/labware/test_pipette_constructors.py @@ -6,11 +6,14 @@ factories = [ ('p10_single', instruments.P10_Single), ('p10_multi', instruments.P10_Multi), + ('p+20_single', instruments.P20_Plus_Single), ('p50_single', instruments.P50_Single), ('p50_multi', instruments.P50_Multi), ('p300_single', instruments.P300_Single), + ('p+300_single', instruments.P300_Plus_Single), ('p300_multi', instruments.P300_Multi), ('p1000_single', instruments.P1000_Single), + ('p+1000_single', instruments.P1000_Plus_Single), ] diff --git a/shared-data/robot-data/pipetteModelSpecs.json b/shared-data/robot-data/pipetteModelSpecs.json index f1f8f816e11..32624b5eb9b 100644 --- a/shared-data/robot-data/pipetteModelSpecs.json +++ b/shared-data/robot-data/pipetteModelSpecs.json @@ -922,7 +922,7 @@ "max": 100 } }, - "p20_single_v2": { + "p+20_single_v2.0": { "name": "p+20_single", "top": { "value": 19.5, @@ -2294,7 +2294,7 @@ "max": 100 } }, - "p300_single_v2": { + "p+300_single_v2.0": { "name": "p+300_single", "top": { "value": 19.5, @@ -3256,7 +3256,7 @@ "max": 100 } }, - "p1000_single_v2": { + "p+1000_single_v2.0": { "name": "p+1000_single", "top": { "value": 19.5,