Skip to content

Commit

Permalink
protocols/advanced_control/transfers: correct iter
Browse files Browse the repository at this point in the history
  • Loading branch information
sfoster1 committed Aug 7, 2024
1 parent 5c785bd commit 7b8abc2
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions api/src/opentrons/protocols/advanced_control/transfers.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
Callable,
Generator,
Iterator,
Iterable,
Sequence,
Tuple,
TypedDict,
Expand Down Expand Up @@ -533,7 +534,7 @@ def _plan_transfer(self) -> Generator[TransferStep, None, None]:
max_volume=self._instr.max_volume,
)
plan_iter = self._expand_for_volume_constraints(
iter(self._volumes),
self._volumes,
zip(sources, dests),
self._instr.max_volume
- self._strategy.disposal_volume
Expand Down Expand Up @@ -632,8 +633,8 @@ def _plan_distribute(self) -> Generator[TransferStep, None, None]:
# First method keeps distribute consistent with current behavior while
# the other maintains consistency in default behaviors of all functions
plan_iter = self._expand_for_volume_constraints(
iter(self._volumes),
iter(self._dests),
self._volumes,
self._dests,
# todo(mm, 2021-03-09): Is it right for this to be
# _instr_.max_volume? Does/should this take the tip maximum volume
# into account?
Expand Down Expand Up @@ -684,7 +685,7 @@ def _plan_distribute(self) -> Generator[TransferStep, None, None]:

@staticmethod
def _expand_for_volume_constraints(
volumes: Iterator[float], targets: Iterator[Target], max_volume: float
volumes: Iterable[float], targets: Iterable[Target], max_volume: float
) -> Generator[Tuple[float, "Target"], None, None]:
"""Split a sequence of proposed transfers if necessary to keep each
transfer under the given max volume.
Expand Down Expand Up @@ -750,8 +751,8 @@ def _plan_consolidate(self) -> Generator[TransferStep, None, None]:
# todo(mm, 2021-03-09): Is it right to use _instr.max_volume here?
# Why don't we account for tip max volume, disposal volume, or air
# gap?
iter(self._volumes),
iter(self._sources),
self._volumes,
self._sources,
self._instr.max_volume,
)
current_xfer = next(plan_iter)
Expand Down

0 comments on commit 7b8abc2

Please sign in to comment.