Skip to content

Commit

Permalink
Revert "temp commit, will reverted (can be rebased away)"
Browse files Browse the repository at this point in the history
This reverts commit 17feea8.
  • Loading branch information
ryanthecoder committed Feb 1, 2024
1 parent 79122f7 commit ba96e9f
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 954 deletions.
7 changes: 3 additions & 4 deletions api/src/opentrons/hardware_control/instruments/ot3/pipette.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,20 +427,19 @@ def available_volume(self) -> float:

def set_current_volume(self, new_volume: float) -> None:
assert new_volume >= 0
# assert new_volume <= self.working_volume
assert new_volume <= self.working_volume
self._current_volume = new_volume

def add_current_volume(self, volume_incr: float) -> None:
# assert self.ok_to_add_volume(volume_incr)
assert self.ok_to_add_volume(volume_incr)
self._current_volume += volume_incr

def remove_current_volume(self, volume_incr: float) -> None:
assert self._current_volume >= volume_incr
self._current_volume -= volume_incr

def ok_to_add_volume(self, volume_incr: float) -> bool:
# return self.current_volume + volume_incr <= self.working_volume
return True
return self.current_volume + volume_incr <= self.working_volume

def ok_to_push_out(self, push_out_dist_mm: float) -> bool:
return push_out_dist_mm <= (
Expand Down
10 changes: 8 additions & 2 deletions api/src/opentrons/protocol_api/core/engine/deck_conflict.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,18 @@ def check_safe_for_tip_pickup_and_return(
f" when picking up fewer than 96 tips."
)
elif not is_partial_config and not is_96_ch_tiprack_adapter:
pass
raise UnsuitableTiprackForPipetteMotion(
f"{tiprack_name} must be on an Opentrons Flex 96 Tip Rack Adapter"
f" in order to pick up or return all 96 tips simultaneously."
)

elif (
not is_partial_config
): # tiprack is not on adapter and pipette is in full config
pass
raise UnsuitableTiprackForPipetteMotion(
f"{tiprack_name} must be on an Opentrons Flex 96 Tip Rack Adapter"
f" in order to pick up or return all 96 tips simultaneously."
)


def _check_deck_conflict_for_96_channel(
Expand Down
8 changes: 4 additions & 4 deletions api/src/opentrons/protocol_api/core/legacy/deck.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ def load_name(self) -> str:
class Deck(UserDict): # type: ignore[type-arg]
data: Dict[int, Optional[DeckItem]]

def __init__(
self, deck_type: str, version: int = DEFAULT_LEGACY_DECK_DEFINITION_VERSION
) -> None:
def __init__(self, deck_type: str) -> None:
super().__init__()
self._definition = load_deck(name=deck_type, version=version)
self._definition = load_deck(
name=deck_type, version=DEFAULT_LEGACY_DECK_DEFINITION_VERSION
)
self._positions = {}
for slot in self._definition["locations"]["orderedSlots"]:
self.data[int(slot["id"])] = None
Expand Down
6 changes: 2 additions & 4 deletions api/src/opentrons/protocol_api/create_protocol_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

from .core.common import ProtocolCore as AbstractProtocolCore
from .core.legacy.deck import Deck as LegacyDeck
from opentrons_shared_data.deck import DEFAULT_DECK_DEFINITION_VERSION
from .core.legacy.legacy_protocol_core import LegacyProtocolCore
from .core.legacy.labware_offset_provider import (
AbstractLabwareOffsetProvider,
Expand Down Expand Up @@ -53,7 +52,6 @@ def create_protocol_context(
extra_labware: Optional[Dict[str, LabwareDefinition]] = None,
bundled_labware: Optional[Dict[str, LabwareDefinition]] = None,
bundled_data: Optional[Dict[str, bytes]] = None,
deck_version: int = DEFAULT_DECK_DEFINITION_VERSION,
) -> ProtocolContext:
"""Create a ProtocolContext for use in a Python protocol.
Expand Down Expand Up @@ -123,7 +121,7 @@ def create_protocol_context(

# TODO(mc, 2022-8-22): remove `disable_fast_protocol_upload`
elif use_simulating_core and not feature_flags.disable_fast_protocol_upload():
legacy_deck = LegacyDeck(deck_type=deck_type, version=deck_version)
legacy_deck = LegacyDeck(deck_type=deck_type)
core = LegacyProtocolCoreSimulator(
sync_hardware=sync_hardware,
labware_offset_provider=labware_offset_provider,
Expand All @@ -135,7 +133,7 @@ def create_protocol_context(
)

else:
legacy_deck = LegacyDeck(deck_type=deck_type, version=deck_version)
legacy_deck = LegacyDeck(deck_type=deck_type)
core = LegacyProtocolCore(
sync_hardware=sync_hardware,
labware_offset_provider=labware_offset_provider,
Expand Down
Loading

0 comments on commit ba96e9f

Please sign in to comment.