Skip to content

Commit a18f176

Browse files
committed
linear_tip_spot_generator.get_num_tips_left
1 parent c79c3f2 commit a18f176

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pylabrobot/resources/functional.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ def save_state(self):
6262
def set_index(self, index: int):
6363
self._tip_spot_idx = index
6464

65+
def get_num_tips_left(self) -> int:
66+
"""Returns the number of tips left to be sampled. Raises an error if repeat is True."""
67+
if self.repeat:
68+
raise RuntimeError("Cannot get number of tips left when repeat is True.")
69+
return len(self.tip_spots) - self._tip_spot_idx
70+
6571

6672
async def randomized_tip_spot_generator(
6773
tip_spots: List[TipSpot],

0 commit comments

Comments
 (0)