Skip to content

Commit 86bbc46

Browse files
authored
fix atc num of temp zones (#766)
1 parent d9277cd commit 86bbc46

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

pylabrobot/thermocycling/thermo_fisher/proflex_tests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class TestProflexBackend(unittest.IsolatedAsyncioTestCase):
1010
async def asyncSetUp(self):
1111
await super().asyncSetUp()
1212
self.proflex = ProflexBackend(ip="1.2.3.4")
13+
self.proflex.num_temp_zones = 2
1314
self.proflex.io.write = unittest.mock.AsyncMock() # type: ignore
1415
self.proflex.io.read = unittest.mock.AsyncMock() # type: ignore
1516
self.proflex.io.read_until_eof = unittest.mock.AsyncMock() # type: ignore

pylabrobot/thermocycling/thermo_fisher/thermo_fisher_thermocycler.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ async def _load_num_blocks_and_type(self):
442442
self.num_temp_zones = 2
443443
elif self.bid == "31":
444444
self._num_blocks = 1
445-
self.num_temp_zones = 1
445+
self.num_temp_zones = 3
446446
else:
447447
raise NotImplementedError("Only BID 31, 12 and 13 are supported")
448448

@@ -936,6 +936,15 @@ async def run_protocol(
936936
if isinstance(stage, Step):
937937
protocol.stages[i] = Stage(steps=[stage], repeats=1)
938938

939+
for stage in protocol.stages:
940+
for step in stage.steps:
941+
if len(step.temperature) != self.num_temp_zones:
942+
raise ValueError(
943+
f"Each step in the protocol must have a list of temperatures "
944+
f"of length {self.num_temp_zones}. "
945+
f"Step temperatures: {step.temperature} (length {len(step.temperature)})"
946+
)
947+
939948
stage_name_prefixes = stage_name_prefixes or ["Stage_" for i in range(len(protocol.stages))]
940949

941950
await self._scpi_write_run_info(

0 commit comments

Comments
 (0)