Skip to content

Commit 5a7b235

Browse files
authored
spectrophotometry methods of cytation call set_plate (#650)
1 parent e7b9bf3 commit 5a7b235

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

pylabrobot/plate_reading/biotek_backend.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,8 @@ async def read_absorbance(self, plate: Plate, wavelength: int) -> List[List[floa
618618
if not 230 <= wavelength <= 999:
619619
raise ValueError("Wavelength must be between 230 and 999")
620620

621+
await self.set_plate(plate)
622+
621623
wavelength_str = str(wavelength).zfill(4)
622624
cmd = f"00470101010812000120010000110010000010600008{wavelength_str}1"
623625
checksum = str(sum(cmd.encode()) % 100).zfill(2)
@@ -636,6 +638,8 @@ async def read_luminescence(self, plate: Plate, focal_height: float) -> List[Lis
636638
if not 4.5 <= focal_height <= 13.88:
637639
raise ValueError("Focal height must be between 4.5 and 13.88")
638640

641+
await self.set_plate(plate)
642+
639643
cmd = f"3{14220 + int(1000*focal_height)}\x03"
640644
await self.send_command("t", cmd)
641645

@@ -663,6 +667,8 @@ async def read_fluorescence(
663667
if not 250 <= emission_wavelength <= 700:
664668
raise ValueError("Emission wavelength must be between 250 and 700")
665669

670+
await self.set_plate(plate)
671+
666672
cmd = f"{614220 + int(1000*focal_height)}\x03"
667673
await self.send_command("t", cmd)
668674

pylabrobot/plate_reading/biotek_tests.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ async def test_get_current_temperature(self):
7070
async def test_read_absorbance(self):
7171
self.backend.io.read.side_effect = _byte_iter(
7272
"\x06"
73+
+ "\x03"
74+
+ "\x06"
7375
+ "0350000000000000010000000000490300000\x03"
7476
+ "\x06"
7577
+ "0000\x03"
@@ -94,10 +96,9 @@ async def test_read_absorbance(self):
9496
)
9597
)
9698

97-
self.backend._plate = CellVis_96_wellplate_350uL_Fb(
98-
name="plate"
99-
) # lint: disable=protected-access
100-
resp = await self.backend.read_absorbance(plate=self.plate, wavelength=580)
99+
resp = await self.backend.read_absorbance(
100+
plate=CellVis_96_wellplate_350uL_Fb(name="plate"), wavelength=580
101+
)
101102

102103
self.backend.io.write.assert_any_call(b"D")
103104
self.backend.io.write.assert_any_call(
@@ -184,6 +185,8 @@ async def test_read_absorbance(self):
184185
async def test_read_fluorescence(self):
185186
self.backend.io.read.side_effect = _byte_iter(
186187
"\x06"
188+
+ "\x03"
189+
+ "\x06"
187190
+ "0000\x03"
188191
+ "\x06"
189192
+ "0350000000000000010000000000490300000\x03"
@@ -209,11 +212,8 @@ async def test_read_fluorescence(self):
209212
)
210213
)
211214

212-
self.backend._plate = CellVis_96_wellplate_350uL_Fb(
213-
name="plate"
214-
) # lint: disable=protected-access
215215
resp = await self.backend.read_fluorescence(
216-
plate=self.plate,
216+
plate=CellVis_96_wellplate_350uL_Fb(name="plate"),
217217
excitation_wavelength=485,
218218
emission_wavelength=528,
219219
focal_height=7.5,

0 commit comments

Comments
 (0)