Skip to content

Commit

Permalink
instrument context
Browse files Browse the repository at this point in the history
  • Loading branch information
rclarke0 committed Feb 13, 2024
1 parent e5f9d57 commit a19c4a2
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions api/src/opentrons/protocol_api/instrument_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def aspirate(
self,
volume: Optional[float] = None,
location: Optional[Union[types.Location, labware.Well]] = None,
rate: float = 1.0,
rate: float = 1.0,
) -> InstrumentContext:
"""
Draw liquid into a pipette tip.
Expand Down Expand Up @@ -260,11 +260,12 @@ def aspirate(
if self._api_version >= _PARTIAL_NOZZLE_CONFIGURATION_ADDED_IN
else self.channels
)
print(num_of_channels)
vol_to_save = c_vol * num_of_channels
well_to_save = well if well else self._get_last_location_by_api_version()
if well_to_save:
self._save_vol_and_loc(vol_to_save * -1, str(well_to_save.display_name))
else:
raise KeyError('No labware to save.')
with publisher.publish_context(
broker=self.broker,
command=cmds.aspirate(
Expand Down Expand Up @@ -430,11 +431,12 @@ def dispense(
if self._api_version >= _PARTIAL_NOZZLE_CONFIGURATION_ADDED_IN
else self.channels
)
print(num_of_channels)
vol_to_save = c_vol * num_of_channels
well_to_save = well if well else self._get_last_location_by_api_version()
if well_to_save:
self._save_vol_and_loc(vol_to_save, str(well_to_save.display_name))
else:
raise KeyError('No labware to save.')
with publisher.publish_context(
broker=self.broker,
command=cmds.dispense(
Expand Down Expand Up @@ -600,11 +602,12 @@ def blow_out(
if self._api_version >= _PARTIAL_NOZZLE_CONFIGURATION_ADDED_IN
else self.channels
)
print(num_of_channels)
vol_to_save = vol_to_save * num_of_channels
well_to_save = well if well else self._get_last_location_by_api_version()
if well_to_save:
self._save_vol_and_loc(vol_to_save, str(well_to_save.display_name))
else:
raise KeyError('No labware to save.')
with publisher.publish_context(
broker=self.broker,
command=cmds.blow_out(instrument=self, location=move_to_location),
Expand Down Expand Up @@ -765,6 +768,7 @@ def air_gap(
target = loc.labware.as_well().top(height)
self.move_to(target, publish=False)
self.aspirate(volume)
#self.aspirate(0)
return self

@publisher.publish(command=cmds.return_tip)
Expand Down

0 comments on commit a19c4a2

Please sign in to comment.