Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pylabrobot/plate_reading/biotek_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)

Expand Down Expand Up @@ -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)

Expand Down
16 changes: 8 additions & 8 deletions pylabrobot/plate_reading/biotek_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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(
Expand Down Expand Up @@ -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"
Expand All @@ -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,
Expand Down