From dfa7311e7ecc08ebbc596a8a9a0ea1c41532259d Mon Sep 17 00:00:00 2001 From: Rick Wierenga Date: Mon, 11 Aug 2025 18:40:46 -0700 Subject: [PATCH 1/2] set_plate --- pylabrobot/plate_reading/biotek_backend.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pylabrobot/plate_reading/biotek_backend.py b/pylabrobot/plate_reading/biotek_backend.py index a522a537b75..5fd65a6d958 100644 --- a/pylabrobot/plate_reading/biotek_backend.py +++ b/pylabrobot/plate_reading/biotek_backend.py @@ -602,6 +602,8 @@ async def read_absorbance(self, plate: Plate, wavelength: int) -> List[List[floa if not 230 <= wavelength <= 999: raise ValueError("Wavelength must be between 230 and 999") + await self.set_plate(plate) + wavelength_str = str(wavelength).zfill(4) cmd = f"00470101010812000120010000110010000010600008{wavelength_str}1" checksum = str(sum(cmd.encode()) % 100).zfill(2) @@ -620,6 +622,8 @@ async def read_luminescence(self, plate: Plate, focal_height: float) -> List[Lis if not 4.5 <= focal_height <= 13.88: raise ValueError("Focal height must be between 4.5 and 13.88") + await self.set_plate(plate) + cmd = f"3{14220 + int(1000*focal_height)}\x03" await self.send_command("t", cmd) @@ -647,6 +651,8 @@ async def read_fluorescence( if not 250 <= emission_wavelength <= 700: raise ValueError("Emission wavelength must be between 250 and 700") + await self.set_plate(plate) + cmd = f"{614220 + int(1000*focal_height)}\x03" await self.send_command("t", cmd) From 16352dd1b2938042c5fb097a5339c51bc6db99b0 Mon Sep 17 00:00:00 2001 From: Rick Wierenga Date: Tue, 12 Aug 2025 17:42:16 -0700 Subject: [PATCH 2/2] fix tests --- pylabrobot/plate_reading/biotek_tests.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pylabrobot/plate_reading/biotek_tests.py b/pylabrobot/plate_reading/biotek_tests.py index c407f7bbaca..dcb94d0af4b 100644 --- a/pylabrobot/plate_reading/biotek_tests.py +++ b/pylabrobot/plate_reading/biotek_tests.py @@ -70,6 +70,8 @@ async def test_get_current_temperature(self): async def test_read_absorbance(self): self.backend.io.read.side_effect = _byte_iter( "\x06" + + "\x03" + + "\x06" + "0350000000000000010000000000490300000\x03" + "\x06" + "0000\x03" @@ -94,10 +96,9 @@ async def test_read_absorbance(self): ) ) - self.backend._plate = CellVis_96_wellplate_350uL_Fb( - name="plate" - ) # lint: disable=protected-access - resp = await self.backend.read_absorbance(plate=self.plate, wavelength=580) + resp = await self.backend.read_absorbance( + plate=CellVis_96_wellplate_350uL_Fb(name="plate"), wavelength=580 + ) self.backend.io.write.assert_any_call(b"D") self.backend.io.write.assert_any_call( @@ -184,6 +185,8 @@ async def test_read_absorbance(self): async def test_read_fluorescence(self): self.backend.io.read.side_effect = _byte_iter( "\x06" + + "\x03" + + "\x06" + "0000\x03" + "\x06" + "0350000000000000010000000000490300000\x03" @@ -209,11 +212,8 @@ async def test_read_fluorescence(self): ) ) - self.backend._plate = CellVis_96_wellplate_350uL_Fb( - name="plate" - ) # lint: disable=protected-access resp = await self.backend.read_fluorescence( - plate=self.plate, + plate=CellVis_96_wellplate_350uL_Fb(name="plate"), excitation_wavelength=485, emission_wavelength=528, focal_height=7.5,