Skip to content

Commit

Permalink
feat(api): add pipette plus constructors (#3407)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahiuchingau authored and Laura-Danielle committed May 2, 2019
1 parent 817cdd1 commit f4feee9
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 5 deletions.
49 changes: 48 additions & 1 deletion api/src/opentrons/legacy_api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion api/tests/opentrons/config/test_pipette_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
3 changes: 3 additions & 0 deletions api/tests/opentrons/labware/test_pipette_constructors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
]


Expand Down
6 changes: 3 additions & 3 deletions shared-data/robot-data/pipetteModelSpecs.json
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,7 @@
"max": 100
}
},
"p20_single_v2": {
"p+20_single_v2.0": {
"name": "p+20_single",
"top": {
"value": 19.5,
Expand Down Expand Up @@ -2294,7 +2294,7 @@
"max": 100
}
},
"p300_single_v2": {
"p+300_single_v2.0": {
"name": "p+300_single",
"top": {
"value": 19.5,
Expand Down Expand Up @@ -3256,7 +3256,7 @@
"max": 100
}
},
"p1000_single_v2": {
"p+1000_single_v2.0": {
"name": "p+1000_single",
"top": {
"value": 19.5,
Expand Down

0 comments on commit f4feee9

Please sign in to comment.