From 5a73e803f5dad7058002bc4eb4b12c4474e5792a Mon Sep 17 00:00:00 2001
From: AFg6K7h4fhy2 <127630341+AFg6K7h4fhy2@users.noreply.github.com>
Date: Sun, 17 Aug 2025 18:06:20 -0400
Subject: [PATCH 01/13] add typos; update pre-commit config
---
.pre-commit-config.yaml | 6 +++++-
_typos.toml | 25 +++++++++++++++++++++++++
2 files changed, 30 insertions(+), 1 deletion(-)
create mode 100644 _typos.toml
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index dc1e43d26b1..e52f86979ca 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -6,4 +6,8 @@ repos:
entry: make format
language: system
files: ^pylabrobot/.*$
-
+ - repo: https://github.com/crate-ci/typos
+ rev: v1
+ hooks:
+ - id: typos
+ args: ["--force-exclude"]
\ No newline at end of file
diff --git a/_typos.toml b/_typos.toml
new file mode 100644
index 00000000000..9aec8dfb838
--- /dev/null
+++ b/_typos.toml
@@ -0,0 +1,25 @@
+[default]
+extend-ignore-identifiers-re = [
+ "AttributeID.*Supress.*",
+]
+
+[default.extend-identifiers]
+AttributeIDSupressMenu = "AttributeIDSupressMenu"
+
+[default.extend-words]
+# words that should not be corrected
+dot_acn = ".acn"
+dot_fot = ".fot"
+dot_ist = ".ist"
+OT = "OT"
+ot = "ot"
+ser = "ser"
+ba = "ba"
+nd = "nd"
+PN = "PN"
+tro = "tro"
+COMMAN = "COMMAN"
+
+[files]
+extend-exclude = [
+ "*.ipynb"]
From 807fc1d7eafcd0485d627c86b99c20504169a656 Mon Sep 17 00:00:00 2001
From: AFg6K7h4fhy2 <127630341+AFg6K7h4fhy2@users.noreply.github.com>
Date: Sun, 17 Aug 2025 18:07:32 -0400
Subject: [PATCH 02/13] add typos
---
_typos.toml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/_typos.toml b/_typos.toml
index 9aec8dfb838..452e0848498 100644
--- a/_typos.toml
+++ b/_typos.toml
@@ -22,4 +22,5 @@ COMMAN = "COMMAN"
[files]
extend-exclude = [
- "*.ipynb"]
+ "*.ipynb"
+]
From cede27e27b70f6798a07376071fdeb9a5d96fff5 Mon Sep 17 00:00:00 2001
From: AFg6K7h4fhy2 <127630341+AFg6K7h4fhy2@users.noreply.github.com>
Date: Sun, 17 Aug 2025 18:24:56 -0400
Subject: [PATCH 03/13] fix spelling errors
---
_typos.toml | 5 ++++
docs/resources/index.md | 2 +-
docs/resources/library/eppendorf.md | 2 +-
docs/resources/library/porvair.md | 2 +-
.../hamilton-star/hardware/replacing-iswap.md | 6 ++---
.../hamilton-star/iswap-module.md | 2 +-
.../hamilton-star/star_lld.md | 2 +-
.../_getting-started/plr-architecture.rst | 2 +-
pylabrobot/centrifuge/vspin_backend.py | 2 +-
.../backends/hamilton/STAR_backend.py | 22 ++++++++---------
.../backends/hamilton/vantage_backend.py | 4 ++--
.../backends/opentrons_backend.py | 2 +-
.../backends/tecan/EVO_backend.py | 24 +++++++++----------
.../liquid_classes/hamilton/star.py | 4 ++--
.../liquid_classes/hamilton/vantage.py | 2 +-
.../liquid_handling/liquid_handler_tests.py | 2 +-
.../chemspeed/crystal_powderdose.py | 6 ++---
pylabrobot/resources/carrier.py | 2 +-
.../resources/hamilton/trough_carriers.py | 2 +-
.../resources/height_volume_functions.py | 12 +++++-----
pylabrobot/resources/resource.py | 8 +++----
pylabrobot/resources/utils.py | 4 ++--
pylabrobot/storage/cytomat/cytomat.py | 2 +-
pylabrobot/tilting/hamilton_backend.py | 2 +-
24 files changed, 64 insertions(+), 59 deletions(-)
diff --git a/_typos.toml b/_typos.toml
index 452e0848498..7bef9eacdad 100644
--- a/_typos.toml
+++ b/_typos.toml
@@ -19,6 +19,11 @@ nd = "nd"
PN = "PN"
tro = "tro"
COMMAN = "COMMAN"
+FO = "FO"
+UE = "UE"
+portait = "portait"
+indictor = "indictor"
+heigh = "heigh"
[files]
extend-exclude = [
diff --git a/docs/resources/index.md b/docs/resources/index.md
index a2d4bd91f14..4b6897e6ec2 100644
--- a/docs/resources/index.md
+++ b/docs/resources/index.md
@@ -152,7 +152,7 @@ If you cannot find something, please contribute what you are looking for!
As a result, many automation software systems believe that it is impossible to reuse resource definitions.
In contrast, PyLabRobot is convinced that carefully created resource definitions combined with smart automation can be reused most of the time.
- PLR is actively addressing these resource resuse constraints in numerous ways:
+ PLR is actively addressing these resource reuse constraints in numerous ways:
- Development of self-correcting machine backend methods.
- Using Coordinate Measurement Machine-based generation of resource "ground truths" (e.g., via liquid handler-based resource probing or 3D scanning).
diff --git a/docs/resources/library/eppendorf.md b/docs/resources/library/eppendorf.md
index 0ceabd1e5ab..24827cc7d34 100644
--- a/docs/resources/library/eppendorf.md
+++ b/docs/resources/library/eppendorf.md
@@ -12,7 +12,7 @@ Company page: [Eppendorf Wikipedia](https://en.wikipedia.org/wiki/Eppendorf_(com
| Description | Image | PLR definition |
|--------------------|--------------------|--------------------|
-| 'Eppendorf_96_wellplate_250ul_Vb'
Part no.: 0030133374
[manufacturer website](https://www.eppendorf.com/gb-en/Products/Laboratory-Consumables/Plates/Eppendorf-twintec-PCR-Plates-p-0030133374)
- Material: polycarbonate (frame), polypropylene (wells)
- part of the twin.tec(R) product line
- WARNING: not ANSI/SLAS 1-2004 footprint dimenions (123x81 mm^2!) ==> requires `PlateAdapter`
- 'Can be divided into 4 segments of 24 wells each to prevent waste and save money'. |   | `Eppendorf_96_wellplate_250ul_Vb` |
+| 'Eppendorf_96_wellplate_250ul_Vb'
Part no.: 0030133374
[manufacturer website](https://www.eppendorf.com/gb-en/Products/Laboratory-Consumables/Plates/Eppendorf-twintec-PCR-Plates-p-0030133374)
- Material: polycarbonate (frame), polypropylene (wells)
- part of the twin.tec(R) product line
- WARNING: not ANSI/SLAS 1-2004 footprint dimensions (123x81 mm^2!) ==> requires `PlateAdapter`
- 'Can be divided into 4 segments of 24 wells each to prevent waste and save money'. |   | `Eppendorf_96_wellplate_250ul_Vb` |
## Tubes
diff --git a/docs/resources/library/porvair.md b/docs/resources/library/porvair.md
index 97f4343e04c..cb3b8d531ab 100644
--- a/docs/resources/library/porvair.md
+++ b/docs/resources/library/porvair.md
@@ -2,7 +2,7 @@
Company history: [Porvair Filtration Group](https://www.porvairfiltration.com/about/our-history/)
-> Porvair Filtration Group, a wholly owned subsidiary of Porvair plc, is a specialist filtration and environmental technology group involved in developing, designing and manufacturing filtration and separation solutions to industry sectors such as the aviation, molten metal, energy, water treatment and life sciences markets. Porvair plc is a publically owned company with four principal subsidiaries: Porvair Filtration Group Ltd., Porvair Sciences Ltd., Selee Corporation and Seal Analytical Ltd.
+> Porvair Filtration Group, a wholly owned subsidiary of Porvair plc, is a specialist filtration and environmental technology group involved in developing, designing and manufacturing filtration and separation solutions to industry sectors such as the aviation, molten metal, energy, water treatment and life sciences markets. Porvair plc is a publicly owned company with four principal subsidiaries: Porvair Filtration Group Ltd., Porvair Sciences Ltd., Selee Corporation and Seal Analytical Ltd.
## Plates
diff --git a/docs/user_guide/00_liquid-handling/hamilton-star/hardware/replacing-iswap.md b/docs/user_guide/00_liquid-handling/hamilton-star/hardware/replacing-iswap.md
index c1d3b0b087d..6f900171c8c 100644
--- a/docs/user_guide/00_liquid-handling/hamilton-star/hardware/replacing-iswap.md
+++ b/docs/user_guide/00_liquid-handling/hamilton-star/hardware/replacing-iswap.md
@@ -2,7 +2,7 @@
This guide provides instructions for replacing the iSWAP arm on a Hamilton STAR liquid handling system.
-Caution/Disclaimer:
+Caution/Disclaimer:
1. This procedure is a work in progress and the user assumes all responsibility for any damage that may be done as a result.
2. This procedure should not be performed on any system that are either under the OEM Warranty period or currently on a service contract with the OEM or any third party service organization. This will certainly void the OEM Warranty/Service contract and likely invalidate any service agreement with third parties.
3. This procedure DOES NOT encapsulate the entire OEM adjustment procedure which includes specialized tooling and software to perform. Consult [iSWAP Auto Adjustment Guide](adjusting-iswap.md) for auto-calibrating arm after installation proceduce.
@@ -39,9 +39,9 @@ Note: Due to the way the iSWAP is taught, the calibration positions from machine
## Attaching the New iSWAP Arm and rough leveling
-6. Place the replacement arm on the system, insert and tighten the two fixing screws, reattach the comunication and Y-drive ribon cables.
+6. Place the replacement arm on the system, insert and tighten the two fixing screws, reattach the communication and Y-drive ribon cables.
-Note: Once physically installed on the system it is recomended that you level the arm in relation to the deck.
+Note: Once physically installed on the system it is recommended that you level the arm in relation to the deck.
7. Loosen the two fixing screws until the iSWAP is fixed in position but can still be rotated about the X Axis (left to right) of the machine.
8. Manually position the X-Arm in the center of the machine and the iSWAP in the middle of the X-Arm.
diff --git a/docs/user_guide/00_liquid-handling/hamilton-star/iswap-module.md b/docs/user_guide/00_liquid-handling/hamilton-star/iswap-module.md
index 9752da16667..9e749f5e8e0 100644
--- a/docs/user_guide/00_liquid-handling/hamilton-star/iswap-module.md
+++ b/docs/user_guide/00_liquid-handling/hamilton-star/iswap-module.md
@@ -22,7 +22,7 @@ await star.iswap_open_gripper()
## Rotations
-You can rotate the iSWAP to 12 predifined positions using {meth}`~pylabrobot.liquid_handling.backends.hamilton.STAR_backend.STARBackend.iswap_rotate`.
+You can rotate the iSWAP to 12 predefined positions using {meth}`~pylabrobot.liquid_handling.backends.hamilton.STAR_backend.STARBackend.iswap_rotate`.
the positions and their corresponding integer specifications are shown visually here.
diff --git a/docs/user_guide/00_liquid-handling/hamilton-star/star_lld.md b/docs/user_guide/00_liquid-handling/hamilton-star/star_lld.md
index b892b98d31d..29a9a8f3ab7 100644
--- a/docs/user_guide/00_liquid-handling/hamilton-star/star_lld.md
+++ b/docs/user_guide/00_liquid-handling/hamilton-star/star_lld.md
@@ -19,7 +19,7 @@ The `lld_mode` parameter can be one of the following:
The `lld_mode` parameter is a list, so you can specify a different LLD mode for each channel.
```{note}
-The `lld_mode` parameter is only avilable when using the `STAR` backend.
+The `lld_mode` parameter is only available when using the `STAR` backend.
```
## Catching errors
diff --git a/docs/user_guide/_getting-started/plr-architecture.rst b/docs/user_guide/_getting-started/plr-architecture.rst
index 1ba5bba84b6..7d25ee885ad 100644
--- a/docs/user_guide/_getting-started/plr-architecture.rst
+++ b/docs/user_guide/_getting-started/plr-architecture.rst
@@ -61,7 +61,7 @@ Integrating New Machines
-For detailed information on how to integrate new machiens into PLR ecosystem,
+For detailed information on how to integrate new machines into PLR ecosystem,
and contribute to the PLR project, please refer to `Contributor Guide`:
diff --git a/pylabrobot/centrifuge/vspin_backend.py b/pylabrobot/centrifuge/vspin_backend.py
index 4546ac3a674..824559d0aa3 100644
--- a/pylabrobot/centrifuge/vspin_backend.py
+++ b/pylabrobot/centrifuge/vspin_backend.py
@@ -146,7 +146,7 @@ def __init__(self, calibration_offset: int, device_id: Optional[str] = None):
async def setup(self):
await self.io.setup()
- # TODO: add functionality where if robot has been intialized before nothing needs to happen
+ # TODO: add functionality where if robot has been initialized before nothing needs to happen
for _ in range(3):
await self.configure_and_initialize()
await self.send(b"\xaa\x00\x21\x01\xff\x21")
diff --git a/pylabrobot/liquid_handling/backends/hamilton/STAR_backend.py b/pylabrobot/liquid_handling/backends/hamilton/STAR_backend.py
index 8dabb27a2fc..d033ea3dde1 100644
--- a/pylabrobot/liquid_handling/backends/hamilton/STAR_backend.py
+++ b/pylabrobot/liquid_handling/backends/hamilton/STAR_backend.py
@@ -471,7 +471,7 @@ class ElementStillHoldingError(STARModuleError):
"""Element still holding
Possible cause(s):
- "Get command" is sent twice or element is not droped expected element is missing (lost)
+ "Get command" is sent twice or element is not dropped expected element is missing (lost)
Code: 22
"""
@@ -895,14 +895,14 @@ def trace_information_to_string(module_identifier: str, trace_information: int)
62: "Z-drive movement error",
63: "Z-drive limit stop not found",
70: "No liquid level found (possibly because no liquid was present)",
- 71: "Not enough liquid present (Immersion depth or surface following position possiby"
+ 71: "Not enough liquid present (Immersion depth or surface following position possibly"
"below minimal access range)",
72: "Auto calibration at pressure (Sensor not possible)",
73: "No liquid level found with dual LLD",
74: "Liquid at a not allowed position detected",
75: "No tip picked up, possibly because no was present at specified position",
76: "Tip already picked up",
- 77: "Tip not droped",
+ 77: "Tip not dropped",
78: "Wrong tip picked up",
80: "Liquid not correctly aspirated",
81: "Clot detected",
@@ -912,9 +912,9 @@ def trace_information_to_string(module_identifier: str, trace_information: int)
85: "No communication to digital potentiometer",
86: "ADC algorithm error",
87: "2nd phase of liquid nt found",
- 88: "Not enough liquid present (Immersion depth or surface following position possiby"
+ 88: "Not enough liquid present (Immersion depth or surface following position possibly"
"below minimal access range)",
- 90: "Limit curve not resetable",
+ 90: "Limit curve not resettable",
91: "Limit curve not programmable",
92: "Limit curve not found",
93: "Limit curve data incorrect",
@@ -1176,7 +1176,7 @@ def num_channels(self) -> int:
def set_minimum_traversal_height(self, traversal_height: float):
raise NotImplementedError(
- "set_minimum_traversal_height is depricated. use set_minimum_channel_traversal_height or "
+ "set_minimum_traversal_height is deprecated. use set_minimum_channel_traversal_height or "
"set_minimum_iswap_traversal_height instead."
)
@@ -2737,7 +2737,7 @@ async def core_move_picked_up_resource(
acceleration_index: int = 4,
z_speed: float = 50.0,
):
- """After a ressource is picked up, move it to a new location but don't release it yet.
+ """After a resource is picked up, move it to a new location but don't release it yet.
Low level component of :meth:`move_resource`
Args:
@@ -6750,7 +6750,7 @@ async def iswap_rotate(
wrist_protection: Literal[0, 1, 2, 3, 4, 5, 6, 7] = 5,
):
"""
- Rotate the iswap to a predifined position.
+ Rotate the iswap to a predefined position.
Velocity units are "incr/sec"
Acceleration units are "1_000 incr/sec**2"
For a list of the possible positions see the pylabrobot documentation on the R0 module.
@@ -6868,7 +6868,7 @@ async def move_plate_to_position(
ga=collision_control_level,
xe=f"{acceleration_index_high_acc} {acceleration_index_low_acc}",
)
- # Once the command has completed successfuly, set _iswap_parked to false
+ # Once the command has completed successfully, set _iswap_parked to false
self._iswap_parked = False
return command_output
@@ -7520,7 +7520,7 @@ async def position_channels_in_y_direction(self, ys: Dict[int, float], make_spac
make_space: If True, the channels will be moved to ensure they are at least 9mm apart and in
descending order, after the channels in `ys` have been put at the desired locations. Note
that an error may still be raised, if there is insufficient space to move the channels or
- if the requested locations are not valid. Set this to False if you wan to aviod inadvertently
+ if the requested locations are not valid. Set this to False if you wan to avoid inadvertently
moving other channels.
"""
@@ -7797,7 +7797,7 @@ async def send_hhs_command(self, index: int, command: str, **kwargs) -> str:
class UnSafe:
"""
- Namespace for actions that are unsafe to perfom.
+ Namespace for actions that are unsafe to perform.
For example, actions that send the iSWAP outside of the Hamilton Deck
"""
diff --git a/pylabrobot/liquid_handling/backends/hamilton/vantage_backend.py b/pylabrobot/liquid_handling/backends/hamilton/vantage_backend.py
index c929a5e09f0..4a6fafcdbcb 100644
--- a/pylabrobot/liquid_handling/backends/hamilton/vantage_backend.py
+++ b/pylabrobot/liquid_handling/backends/hamilton/vantage_backend.py
@@ -149,7 +149,7 @@ def parse_vantage_fw_string(s: str, fmt: Optional[Dict[str, str]] = None) -> dic
82: "TADM measurement out of lower limit curve",
83: "TADM measurement out of upper limit curve",
84: "Not enough memory for TADM measurement",
- 90: "Limit curve not resetable",
+ 90: "Limit curve not resettable",
91: "Limit curve not programmable",
92: "Limit curve name not found",
93: "Limit curve data incorrect",
@@ -212,7 +212,7 @@ def parse_vantage_fw_string(s: str, fmt: Optional[Dict[str, str]] = None) -> dic
84: "Not enough memory for TADM measurement",
85: "Jet dispense pressure not reached",
86: "ADC algorithm error",
- 90: "Limit curve not resetable",
+ 90: "Limit curve not resettable",
91: "Limit curve not programmable",
92: "Limit curve name not found",
93: "Limit curve data incorrect",
diff --git a/pylabrobot/liquid_handling/backends/opentrons_backend.py b/pylabrobot/liquid_handling/backends/opentrons_backend.py
index dfe83af5a30..2ceda0547c2 100644
--- a/pylabrobot/liquid_handling/backends/opentrons_backend.py
+++ b/pylabrobot/liquid_handling/backends/opentrons_backend.py
@@ -625,7 +625,7 @@ async def move_pipette_head(
pipette_id: Optional[str] = None,
force_direct: bool = False,
):
- """Move the pipette head to the specified location. Whe a tip is mounted, the location refers
+ """Move the pipette head to the specified location. When a tip is mounted, the location refers
to the bottom of the tip. If no tip is mounted, the location refers to the bottom of the
pipette head.
diff --git a/pylabrobot/liquid_handling/backends/tecan/EVO_backend.py b/pylabrobot/liquid_handling/backends/tecan/EVO_backend.py
index 99ad42fa6c3..e18fb469fe1 100644
--- a/pylabrobot/liquid_handling/backends/tecan/EVO_backend.py
+++ b/pylabrobot/liquid_handling/backends/tecan/EVO_backend.py
@@ -554,7 +554,7 @@ async def drop_tips(self, ops: List[Drop], use_channels: List[int]):
)
# TODO check channel positions match resource positions for z-axis
- await self.liha._drop_disposable_tip(self._bin_use_channels(use_channels), discard_hight=0)
+ await self.liha._drop_disposable_tip(self._bin_use_channels(use_channels), discard_height=0)
async def pick_up_tips96(self, pickup: PickupTipRack):
raise NotImplementedError("MCA not implemented yet")
@@ -718,7 +718,7 @@ def _aspirate_airgap(
airgap: `lag` for leading airgap, `tag` for trailing airgap.
Returns:
- pvl: position_valve_logial
+ pvl: position_valve_logical
sep: set_end_speed_plunger
ppr: move_plunger_relative
"""
@@ -976,7 +976,7 @@ async def position_absolute_all_axis(self, x: int, y: int, ys: int, z: List[int]
"""Position absolute for all LiHa axes.
Args:
- x: aboslute x position in 1/10 mm, must be in allowed machine range
+ x: absolute x position in 1/10 mm, must be in allowed machine range
y: absolute y position in 1/10 mm, must be in allowed machine range
ys: absolute y spacing in 1/10 mm, must be between 90 and 380
z: absolute z position in 1/10 mm for each channel, must be in
@@ -1179,23 +1179,23 @@ async def get_disposable_tip(self, tips, z_start, z_search):
async def discard_disposable_tip_high(self, tips):
"""Drops tips
- Discards at the Z-axes initialization hight
+ Discards at the Z-axes initialization height
Args:
tips: binary coded tip select
"""
await self.backend.send_command(module=self.module, command="ADT", params=[tips])
- async def _drop_disposable_tip(self, tips, discard_hight):
+ async def _drop_disposable_tip(self, tips, discard_height):
"""Drops tips
Discards at a variable Z-axis initialization height
Args:
tips: binary coded tip select
- discard_hight: binary. 0 above tip rack, 1 in tip rack
+ discard_height: binary. 0 above tip rack, 1 in tip rack
"""
- await self.backend.send_command(module=self.module, command="AST", params=[tips, discard_hight])
+ await self.backend.send_command(module=self.module, command="AST", params=[tips, discard_height])
class Mca(EVOArm):
@@ -1307,11 +1307,11 @@ async def set_vector_coordinate_position(
Args:
v: vector to be defined, must be between 1 and 100
- x: aboslute x position in 1/10 mm
- y: aboslute y position in 1/10 mm
- z: aboslute z position in 1/10 mm
- r: aboslute r position in 1/10 mm
- g: aboslute g position in 1/10 mm
+ x: absolute x position in 1/10 mm
+ y: absolute y position in 1/10 mm
+ z: absolute z position in 1/10 mm
+ r: absolute r position in 1/10 mm
+ g: absolute g position in 1/10 mm
speed: speed select, 0 - slow, 1 - fast
tw: target window class, set with STW
diff --git a/pylabrobot/liquid_handling/liquid_classes/hamilton/star.py b/pylabrobot/liquid_handling/liquid_classes/hamilton/star.py
index 93b20a4d08a..ac1d91f9a1a 100644
--- a/pylabrobot/liquid_handling/liquid_classes/hamilton/star.py
+++ b/pylabrobot/liquid_handling/liquid_classes/hamilton/star.py
@@ -4212,7 +4212,7 @@ def get_star_liquid_class(
# because the channel is not enough saturated
# - To protect, the distance from Asp. to Disp. should be as short as possible,
# because Chloroform could be drop out in a long way!
-# - a break time after dispense with about 10s time counter, makes shure the drop which residue
+# - a break time after dispense with about 10s time counter, makes sure the drop which residue
# after dispense drops back into the probetube
# - some droplets on tip after dispense are also with more air transport volume not avoidable
# - sometimes it helpes using Filtertips
@@ -5474,7 +5474,7 @@ def get_star_liquid_class(
)
-# V1.1: Set mix flow rate to 120, Clot retract hight = 0
+# V1.1: Set mix flow rate to 120, Clot retract height = 0
star_mapping[(1000, False, True, True, Liquid.WATER, False, False)] = (
HighVolumeFilter_Water_DispenseSurface
) = HamiltonLiquidClass(
diff --git a/pylabrobot/liquid_handling/liquid_classes/hamilton/vantage.py b/pylabrobot/liquid_handling/liquid_classes/hamilton/vantage.py
index fce7d72a7a2..a1de635ef6c 100644
--- a/pylabrobot/liquid_handling/liquid_classes/hamilton/vantage.py
+++ b/pylabrobot/liquid_handling/liquid_classes/hamilton/vantage.py
@@ -5148,7 +5148,7 @@ def get_vantage_liquid_class(
)
-# V1.1: Set mix flow rate to 120, Clot retract hight = 0
+# V1.1: Set mix flow rate to 120, Clot retract height = 0
vantage_mapping[(1000, False, True, True, Liquid.WATER, False, False)] = (
HighVolumeFilter_Water_DispenseSurface
) = HamiltonLiquidClass(
diff --git a/pylabrobot/liquid_handling/liquid_handler_tests.py b/pylabrobot/liquid_handling/liquid_handler_tests.py
index 3e3d546c8d5..5589518f4bd 100644
--- a/pylabrobot/liquid_handling/liquid_handler_tests.py
+++ b/pylabrobot/liquid_handling/liquid_handler_tests.py
@@ -1091,7 +1091,7 @@ async def error_func(*args, **kwargs):
assert self.lh.head[0].get_tip().tracker.get_used_volume() == 200
with self.assertRaises(ChannelizedError):
await self.lh.dispense([well], vols=[60])
- # test volume doens't change on failed dispense
+ # test volume doesn't change on failed dispense
assert self.lh.head[0].get_tip().tracker.get_used_volume() == 200
async def test_96_head_volume_tracking_multi_container(self):
diff --git a/pylabrobot/powder_dispensing/chemspeed/crystal_powderdose.py b/pylabrobot/powder_dispensing/chemspeed/crystal_powderdose.py
index d7373b4473c..1f2b6a22159 100644
--- a/pylabrobot/powder_dispensing/chemspeed/crystal_powderdose.py
+++ b/pylabrobot/powder_dispensing/chemspeed/crystal_powderdose.py
@@ -6,8 +6,8 @@
class CrystalPowderdose(PowderDispenserBackend):
"""A powder dispenser backend for Chemspeed Crystal Powderdose."""
- def __init__(self, arksuite_adress: str) -> None:
- self.arksuite_adress = arksuite_adress
+ def __init__(self, arksuite_address: str) -> None:
+ self.arksuite_address = arksuite_address
async def setup(self) -> None:
raise NotImplementedError("CrystalPowderdose not implemented yet")
@@ -18,5 +18,5 @@ async def stop(self) -> None:
def serialize(self) -> dict:
return {
**super().serialize(),
- "arksuite_adress": self.arksuite_adress,
+ "arksuite_address": self.arksuite_address,
}
diff --git a/pylabrobot/resources/carrier.py b/pylabrobot/resources/carrier.py
index 2efa3bdfe63..18ff78cffd8 100644
--- a/pylabrobot/resources/carrier.py
+++ b/pylabrobot/resources/carrier.py
@@ -236,7 +236,7 @@ def _update_resource_stack_location(self, resource: Resource):
location of the ResourceStack itself to make sure we take into account sinking of the plate.
Args:
- resource: The Resource on the ResourceStack tht was assigned.
+ resource: The Resource on the ResourceStack that was assigned.
"""
resource_stack = resource.parent
assert isinstance(resource_stack, ResourceStack)
diff --git a/pylabrobot/resources/hamilton/trough_carriers.py b/pylabrobot/resources/hamilton/trough_carriers.py
index 30eb1593dae..74ee65b0a7a 100644
--- a/pylabrobot/resources/hamilton/trough_carriers.py
+++ b/pylabrobot/resources/hamilton/trough_carriers.py
@@ -17,7 +17,7 @@ def Trough_CAR_4R200_A00(name: str) -> TroughCarrier:
carrier_site_pedestal_bottom = 132.5
pedestal_z_height = 1.5
true_dz = 1.2
- trought_z_thickness = 1.4
+ trough_z_thickness = 1.4
"""
return TroughCarrier(
name=name,
diff --git a/pylabrobot/resources/height_volume_functions.py b/pylabrobot/resources/height_volume_functions.py
index cbf02947617..ee5e53f0cc0 100644
--- a/pylabrobot/resources/height_volume_functions.py
+++ b/pylabrobot/resources/height_volume_functions.py
@@ -127,7 +127,7 @@ def calculate_liquid_volume_container_2segments_square_vbottom(
if liquid_height > h_pyramid + h_cube:
raise ValueError(
"""WARNING: Liquid overflow detected;
- check your labware definiton and/or that you are using the right labware."""
+ check your labware definition and/or that you are using the right labware."""
)
# Calculating the base area
@@ -210,7 +210,7 @@ def calculate_liquid_volume_container_2segments_square_ubottom(
if liquid_height > h_cuboid + x / 2:
raise ValueError(
"""WARNING: Liquid overflow detected;
- check your labware definiton and/or that you are using the right labware."""
+ check your labware definition and/or that you are using the right labware."""
)
r = x / 2 # Radius of the hemisphere
@@ -298,7 +298,7 @@ def calculate_liquid_volume_container_2segments_round_vbottom(
if liquid_height > h_cone + h_cylinder:
raise ValueError(
"""WARNING: Liquid overflow detected;
- check your labware definiton and/or that you are using the right labware."""
+ check your labware definition and/or that you are using the right labware."""
)
r = d / 2
@@ -386,7 +386,7 @@ def calculate_liquid_volume_container_2segments_round_ubottom(
if liquid_height > h_cylinder + r:
raise ValueError(
"""WARNING: Liquid overflow detected;
- check your labware definiton and/or that you are using the right labware."""
+ check your labware definition and/or that you are using the right labware."""
)
# Calculating the full volume of the hemisphere
@@ -451,7 +451,7 @@ def calculate_liquid_volume_container_1segment_round_fbottom(
if liquid_height > h_cylinder:
raise ValueError(
"""WARNING: Liquid overflow detected;
- check your labware definiton and/or that you are using the right labware."""
+ check your labware definition and/or that you are using the right labware."""
)
cylinder_liquid_volume = math.pi * r**2 * liquid_height
@@ -460,7 +460,7 @@ def calculate_liquid_volume_container_1segment_round_fbottom(
### Example of usage using a lambda function:
# def Rectangular_Reservoir(name: str) -> Plate:
-# """ An 8 well resevoir with a 30mL volume. """
+# """ An 8 well reservoir with a 30mL volume. """
# WELL_WIDTH = 8.08
# WELL_LENGTH = 107.4
# return Plate(
diff --git a/pylabrobot/resources/resource.py b/pylabrobot/resources/resource.py
index 2f0bb772cb3..0d981ee74a6 100644
--- a/pylabrobot/resources/resource.py
+++ b/pylabrobot/resources/resource.py
@@ -800,9 +800,9 @@ def get_highest_known_point(self) -> float:
this method might not return the correct value.
```
"""
- heighest_point = self.get_absolute_location(z="t").z
+ highest_point = self.get_absolute_location(z="t").z
if self.name == "deck":
- heighest_point = 0
+ highest_point = 0
for resource in self.children:
- heighest_point = max(heighest_point, resource.get_highest_known_point())
- return heighest_point
+ highest_point = max(highest_point, resource.get_highest_known_point())
+ return highest_point
diff --git a/pylabrobot/resources/utils.py b/pylabrobot/resources/utils.py
index f098344b546..5cb8859ba64 100644
--- a/pylabrobot/resources/utils.py
+++ b/pylabrobot/resources/utils.py
@@ -65,7 +65,7 @@ def create_equally_spaced_x(
item_dx: float,
**kwargs,
) -> List[T]:
- """Make equally spaced resources over the x-axis. See :meth:`create_equaly_spaced_2d` for more
+ """Make equally spaced resources over the x-axis. See :meth:`create_equally_spaced_2d` for more
details.
Args:
@@ -104,7 +104,7 @@ def create_equally_spaced_y(
item_dy: float,
**kwargs,
) -> List[T]:
- """Make equally spaced resources over the y-axis. See :meth:`create_equaly_spaced_2d` for more
+ """Make equally spaced resources over the y-axis. See :meth:`create_equally_spaced_2d` for more
details.
Args:
diff --git a/pylabrobot/storage/cytomat/cytomat.py b/pylabrobot/storage/cytomat/cytomat.py
index 71ccc855932..f9a378f89e4 100644
--- a/pylabrobot/storage/cytomat/cytomat.py
+++ b/pylabrobot/storage/cytomat/cytomat.py
@@ -122,7 +122,7 @@ async def _send_command(command_str) -> str:
await self.reset_error_register()
raise Exception(f"Unknown cytomat error code in response: {resp}")
- logging.error("Command %s recieved an unknown response: '%s'", command_str, resp)
+ logging.error("Command %s received an unknown response: '%s'", command_str, resp)
await self.reset_error_register()
raise Exception(f"Unknown response from cytomat: {resp}")
diff --git a/pylabrobot/tilting/hamilton_backend.py b/pylabrobot/tilting/hamilton_backend.py
index 76972bf208f..5bfd74c6662 100644
--- a/pylabrobot/tilting/hamilton_backend.py
+++ b/pylabrobot/tilting/hamilton_backend.py
@@ -231,7 +231,7 @@ async def tilt_set_temperature(self, temperature: float):
"""Tilt set the temperature 10.. 50 Grad C [1/10 Grad C]
Args:
- temperature: temperature in Celcius, between 10 and 50
+ temperature: temperature in Celsisu, between 10 and 50
"""
assert 10 <= temperature <= 50, "Temperature must be between 10 and 50."
From e704b89112c2f415fbdba628b9e53449dfff3b3d Mon Sep 17 00:00:00 2001
From: AFg6K7h4fhy2 <127630341+AFg6K7h4fhy2@users.noreply.github.com>
Date: Sun, 17 Aug 2025 19:03:14 -0400
Subject: [PATCH 04/13] format files using ruff
---
.../heating_shaking/hamilton_backend.py | 2 +-
pylabrobot/io/usb.py | 8 +-
.../backends/chatterbox_backend.py | 2 +-
.../backends/hamilton/STAR_backend.py | 781 +++++++++---------
.../backends/hamilton/STAR_tests.py | 2 +-
.../backends/hamilton/vantage_backend.py | 29 +-
.../backends/tecan/EVO_backend.py | 22 +-
.../liquid_classes/hamilton/star.py | 386 ++++-----
pylabrobot/liquid_handling/liquid_handler.py | 20 +-
pylabrobot/plate_reading/biotek_backend.py | 22 +-
.../plate_reading/clario_star_backend.py | 4 +-
pylabrobot/plate_reading/imager.py | 2 +-
pylabrobot/pumps/pumparray.py | 2 +-
pylabrobot/resources/corning/costar/plates.py | 2 +-
pylabrobot/resources/corning/falcon/plates.py | 2 +-
pylabrobot/resources/corning/falcon/tubes.py | 8 +-
pylabrobot/resources/corning/plates.py | 2 +-
.../resources/hamilton/hamilton_decks.py | 8 +-
pylabrobot/resources/itemized_resource.py | 6 +-
pylabrobot/resources/tecan/tecan_decks.py | 5 +-
pylabrobot/resources/utils.py | 2 +-
pylabrobot/resources/volume_tracker.py | 6 +-
pylabrobot/scales/scale_backend.py | 6 +-
pylabrobot/sealing/backend.py | 9 +-
pylabrobot/storage/cytomat/cytomat.py | 2 +-
pylabrobot/tilting/tilter.py | 12 +-
pylabrobot/visualizer/visualizer.py | 2 +-
27 files changed, 671 insertions(+), 683 deletions(-)
diff --git a/pylabrobot/heating_shaking/hamilton_backend.py b/pylabrobot/heating_shaking/hamilton_backend.py
index ef4abc27833..04df5bbcf54 100644
--- a/pylabrobot/heating_shaking/hamilton_backend.py
+++ b/pylabrobot/heating_shaking/hamilton_backend.py
@@ -169,7 +169,7 @@ async def _wait_for_stop(self):
async def set_temperature(self, temperature: float):
"""set temperature in Celsius"""
assert 0 < temperature <= 105
- temp_str = f"{round(10*temperature):04d}"
+ temp_str = f"{round(10 * temperature):04d}"
return await self.interface.send_hhs_command(index=self.index, command="TA", ta=temp_str)
async def _get_current_temperature(self) -> Dict[str, float]:
diff --git a/pylabrobot/io/usb.py b/pylabrobot/io/usb.py
index 679ab12bb39..3f02e301aae 100644
--- a/pylabrobot/io/usb.py
+++ b/pylabrobot/io/usb.py
@@ -70,9 +70,9 @@ def __init__(
if get_capture_or_validation_active():
raise RuntimeError("Cannot create a new USB object while capture or validation is active")
- assert (
- packet_read_timeout < read_timeout
- ), "packet_read_timeout must be smaller than read_timeout."
+ assert packet_read_timeout < read_timeout, (
+ "packet_read_timeout must be smaller than read_timeout."
+ )
self._id_vendor = id_vendor
self._id_product = id_product
@@ -215,7 +215,7 @@ def get_available_devices(self) -> List["usb.core.Device"]:
if self._serial_number is not None:
if dev._serial_number is None:
raise RuntimeError(
- "A serial number was specified, but the device does not have a serial " "number."
+ "A serial number was specified, but the device does not have a serial number."
)
if dev.serial_number != self._serial_number:
diff --git a/pylabrobot/liquid_handling/backends/chatterbox_backend.py b/pylabrobot/liquid_handling/backends/chatterbox_backend.py
index 31863c8b2ca..708ff3e54f1 100644
--- a/pylabrobot/liquid_handling/backends/chatterbox_backend.py
+++ b/pylabrobot/liquid_handling/backends/chatterbox_backend.py
@@ -1,5 +1,5 @@
class ChatterBoxBackend:
def __init__(self, num_channels: int = 8):
raise NotImplementedError(
- "ChatterBoxBackend is deprecated. " "Use LiquidHandlerChatterboxBackend instead."
+ "ChatterBoxBackend is deprecated. Use LiquidHandlerChatterboxBackend instead."
)
diff --git a/pylabrobot/liquid_handling/backends/hamilton/STAR_backend.py b/pylabrobot/liquid_handling/backends/hamilton/STAR_backend.py
index d033ea3dde1..0658b82facd 100644
--- a/pylabrobot/liquid_handling/backends/hamilton/STAR_backend.py
+++ b/pylabrobot/liquid_handling/backends/hamilton/STAR_backend.py
@@ -880,8 +880,7 @@ def trace_information_to_string(module_identifier: str, trace_information: int)
35: "Voltages outside permitted range",
36: "Stop during execution of command",
37: "Stop during execution of command",
- 40: "No parallel processes permitted (Two or more commands sent for the same control"
- "process)",
+ 40: "No parallel processes permitted (Two or more commands sent for the same controlprocess)",
50: "Dispensing drive init. position not found",
51: "Dispensing drive not initialized",
52: "Dispensing drive movement error",
@@ -3222,7 +3221,7 @@ async def core_check_resource_exists_at_location_center(
elif user_prompt == "abort":
raise ValueError(
f"Resource '{resource.name}' not found at center"
- f" location {(center.x,center.y,center.z)}"
+ f" location {(center.x, center.y, center.z)}"
" & error not resolved -> aborted resource movement."
)
else:
@@ -3650,44 +3649,44 @@ async def set_instrument_configuration(
and 9999. Default 60.
"""
- assert (
- 1 <= instrument_size_in_slots_x_range <= 9
- ), "instrument_size_in_slots_x_range must be between 1 and 99"
+ assert 1 <= instrument_size_in_slots_x_range <= 9, (
+ "instrument_size_in_slots_x_range must be between 1 and 99"
+ )
assert 1 <= auto_load_size_in_slots <= 54, "auto_load_size_in_slots must be between 1 and 54"
assert 1000 <= tip_waste_x_position <= 25000, "tip_waste_x_position must be between 1 and 25000"
- assert (
- 0 <= right_x_drive_configuration_byte_1 <= 1
- ), "right_x_drive_configuration_byte_1 must be between 0 and 1"
- assert (
- 0 <= right_x_drive_configuration_byte_2 <= 1
- ), "right_x_drive_configuration_byte_2 must be between 0 and must1"
- assert (
- 0 <= minimal_iswap_collision_free_position <= 30000
- ), "minimal_iswap_collision_free_position must be between 0 and 30000"
- assert (
- 0 <= maximal_iswap_collision_free_position <= 30000
- ), "maximal_iswap_collision_free_position must be between 0 and 30000"
+ assert 0 <= right_x_drive_configuration_byte_1 <= 1, (
+ "right_x_drive_configuration_byte_1 must be between 0 and 1"
+ )
+ assert 0 <= right_x_drive_configuration_byte_2 <= 1, (
+ "right_x_drive_configuration_byte_2 must be between 0 and must1"
+ )
+ assert 0 <= minimal_iswap_collision_free_position <= 30000, (
+ "minimal_iswap_collision_free_position must be between 0 and 30000"
+ )
+ assert 0 <= maximal_iswap_collision_free_position <= 30000, (
+ "maximal_iswap_collision_free_position must be between 0 and 30000"
+ )
assert 0 <= left_x_arm_width <= 9999, "left_x_arm_width must be between 0 and 9999"
assert 0 <= right_x_arm_width <= 9999, "right_x_arm_width must be between 0 and 9999"
assert 0 <= num_pip_channels <= 16, "num_pip_channels must be between 0 and 16"
assert 0 <= num_xl_channels <= 8, "num_xl_channels must be between 0 and 8"
assert 0 <= num_robotic_channels <= 8, "num_robotic_channels must be between 0 and 8"
- assert (
- 0 <= minimal_raster_pitch_of_pip_channels <= 999
- ), "minimal_raster_pitch_of_pip_channels must be between 0 and 999"
- assert (
- 0 <= minimal_raster_pitch_of_xl_channels <= 999
- ), "minimal_raster_pitch_of_xl_channels must be between 0 and 999"
- assert (
- 0 <= minimal_raster_pitch_of_robotic_channels <= 999
- ), "minimal_raster_pitch_of_robotic_channels must be between 0 and 999"
+ assert 0 <= minimal_raster_pitch_of_pip_channels <= 999, (
+ "minimal_raster_pitch_of_pip_channels must be between 0 and 999"
+ )
+ assert 0 <= minimal_raster_pitch_of_xl_channels <= 999, (
+ "minimal_raster_pitch_of_xl_channels must be between 0 and 999"
+ )
+ assert 0 <= minimal_raster_pitch_of_robotic_channels <= 999, (
+ "minimal_raster_pitch_of_robotic_channels must be between 0 and 999"
+ )
assert 0 <= pip_maximal_y_position <= 9999, "pip_maximal_y_position must be between 0 and 9999"
- assert (
- 0 <= left_arm_minimal_y_position <= 9999
- ), "left_arm_minimal_y_position must be between 0 and 9999"
- assert (
- 0 <= right_arm_minimal_y_position <= 9999
- ), "right_arm_minimal_y_position must be between 0 and 9999"
+ assert 0 <= left_arm_minimal_y_position <= 9999, (
+ "left_arm_minimal_y_position must be between 0 and 9999"
+ )
+ assert 0 <= right_arm_minimal_y_position <= 9999, (
+ "right_arm_minimal_y_position must be between 0 and 9999"
+ )
return await self.send_command(
module="C0",
@@ -3938,17 +3937,17 @@ async def occupy_and_provide_area_for_external_access(
1) all arms left. 2) all arms right.
"""
- assert (
- 0 <= taken_area_identification_number <= 9999
- ), "taken_area_identification_number must be between 0 and 9999"
+ assert 0 <= taken_area_identification_number <= 9999, (
+ "taken_area_identification_number must be between 0 and 9999"
+ )
assert 0 <= taken_area_left_margin <= 99, "taken_area_left_margin must be between 0 and 99"
- assert (
- 0 <= taken_area_left_margin_direction <= 1
- ), "taken_area_left_margin_direction must be between 0 and 1"
+ assert 0 <= taken_area_left_margin_direction <= 1, (
+ "taken_area_left_margin_direction must be between 0 and 1"
+ )
assert 0 <= taken_area_size <= 50000, "taken_area_size must be between 0 and 50000"
- assert (
- 0 <= arm_preposition_mode_related_to_taken_areas <= 2
- ), "arm_preposition_mode_related_to_taken_areas must be between 0 and 2"
+ assert 0 <= arm_preposition_mode_related_to_taken_areas <= 2, (
+ "arm_preposition_mode_related_to_taken_areas must be between 0 and 2"
+ )
return await self.send_command(
module="C0",
@@ -3968,9 +3967,9 @@ async def release_occupied_area(self, taken_area_identification_number: int = 0)
Must be between 0 and 9999. Default 0.
"""
- assert (
- 0 <= taken_area_identification_number <= 999
- ), "taken_area_identification_number must be between 0 and 9999"
+ assert 0 <= taken_area_identification_number <= 999, (
+ "taken_area_identification_number must be between 0 and 9999"
+ )
return await self.send_command(
module="C0",
@@ -4064,15 +4063,15 @@ async def initialize_pipetting_channels(
assert all(0 <= xp <= 25000 for xp in x_positions), "x_positions must be between 0 and 25000"
assert all(0 <= yp <= 6500 for yp in y_positions), "y_positions must be between 0 and 6500"
- assert (
- 0 <= begin_of_tip_deposit_process <= 3600
- ), "begin_of_tip_deposit_process must be between 0 and 3600"
- assert (
- 0 <= end_of_tip_deposit_process <= 3600
- ), "end_of_tip_deposit_process must be between 0 and 3600"
- assert (
- 0 <= z_position_at_end_of_a_command <= 3600
- ), "z_position_at_end_of_a_command must be between 0 and 3600"
+ assert 0 <= begin_of_tip_deposit_process <= 3600, (
+ "begin_of_tip_deposit_process must be between 0 and 3600"
+ )
+ assert 0 <= end_of_tip_deposit_process <= 3600, (
+ "end_of_tip_deposit_process must be between 0 and 3600"
+ )
+ assert 0 <= z_position_at_end_of_a_command <= 3600, (
+ "z_position_at_end_of_a_command must be between 0 and 3600"
+ )
assert 0 <= tip_type <= 99, "tip must be between 0 and 99"
assert 0 <= discarding_method <= 1, "discarding_method must be between 0 and 1"
@@ -4123,15 +4122,15 @@ async def pick_up_tip(
assert all(0 <= xp <= 25000 for xp in x_positions), "x_positions must be between 0 and 25000"
assert all(0 <= yp <= 6500 for yp in y_positions), "y_positions must be between 0 and 6500"
- assert (
- 0 <= begin_tip_pick_up_process <= 3600
- ), "begin_tip_pick_up_process must be between 0 and 3600"
- assert (
- 0 <= end_tip_pick_up_process <= 3600
- ), "end_tip_pick_up_process must be between 0 and 3600"
- assert (
- 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600
- ), "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
+ assert 0 <= begin_tip_pick_up_process <= 3600, (
+ "begin_tip_pick_up_process must be between 0 and 3600"
+ )
+ assert 0 <= end_tip_pick_up_process <= 3600, (
+ "end_tip_pick_up_process must be between 0 and 3600"
+ )
+ assert 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600, (
+ "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
+ )
return await self.send_command(
module="C0",
@@ -4185,18 +4184,18 @@ async def discard_tip(
assert all(0 <= xp <= 25000 for xp in x_positions), "x_positions must be between 0 and 25000"
assert all(0 <= yp <= 6500 for yp in y_positions), "y_positions must be between 0 and 6500"
- assert (
- 0 <= begin_tip_deposit_process <= 3600
- ), "begin_tip_deposit_process must be between 0 and 3600"
- assert (
- 0 <= end_tip_deposit_process <= 3600
- ), "end_tip_deposit_process must be between 0 and 3600"
- assert (
- 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600
- ), "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
- assert (
- 0 <= z_position_at_end_of_a_command <= 3600
- ), "z_position_at_end_of_a_command must be between 0 and 3600"
+ assert 0 <= begin_tip_deposit_process <= 3600, (
+ "begin_tip_deposit_process must be between 0 and 3600"
+ )
+ assert 0 <= end_tip_deposit_process <= 3600, (
+ "end_tip_deposit_process must be between 0 and 3600"
+ )
+ assert 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600, (
+ "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
+ )
+ assert 0 <= z_position_at_end_of_a_command <= 3600, (
+ "z_position_at_end_of_a_command must be between 0 and 3600"
+ )
return await self.send_command(
module="C0",
@@ -4358,100 +4357,100 @@ async def aspirate_pip(
assert all(0 <= x <= 2 for x in aspiration_type), "aspiration_type must be between 0 and 2"
assert all(0 <= xp <= 25000 for xp in x_positions), "x_positions must be between 0 and 25000"
assert all(0 <= yp <= 6500 for yp in y_positions), "y_positions must be between 0 and 6500"
- assert (
- 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600
- ), "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
+ assert 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600, (
+ "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
+ )
assert 0 <= min_z_endpos <= 3600, "min_z_endpos must be between 0 and 3600"
- assert all(
- 0 <= x <= 3600 for x in lld_search_height
- ), "lld_search_height must be between 0 and 3600"
- assert all(
- 0 <= x <= 500 for x in clot_detection_height
- ), "clot_detection_height must be between 0 and 500"
- assert all(
- 0 <= x <= 3600 for x in liquid_surface_no_lld
- ), "liquid_surface_no_lld must be between 0 and 3600"
- assert all(
- 0 <= x <= 3600 for x in pull_out_distance_transport_air
- ), "pull_out_distance_transport_air must be between 0 and 3600"
- assert all(
- 0 <= x <= 3600 for x in second_section_height
- ), "second_section_height must be between 0 and 3600"
- assert all(
- 0 <= x <= 10000 for x in second_section_ratio
- ), "second_section_ratio must be between 0 and 10000"
+ assert all(0 <= x <= 3600 for x in lld_search_height), (
+ "lld_search_height must be between 0 and 3600"
+ )
+ assert all(0 <= x <= 500 for x in clot_detection_height), (
+ "clot_detection_height must be between 0 and 500"
+ )
+ assert all(0 <= x <= 3600 for x in liquid_surface_no_lld), (
+ "liquid_surface_no_lld must be between 0 and 3600"
+ )
+ assert all(0 <= x <= 3600 for x in pull_out_distance_transport_air), (
+ "pull_out_distance_transport_air must be between 0 and 3600"
+ )
+ assert all(0 <= x <= 3600 for x in second_section_height), (
+ "second_section_height must be between 0 and 3600"
+ )
+ assert all(0 <= x <= 10000 for x in second_section_ratio), (
+ "second_section_ratio must be between 0 and 10000"
+ )
assert all(0 <= x <= 3600 for x in minimum_height), "minimum_height must be between 0 and 3600"
- assert all(
- 0 <= x <= 3600 for x in immersion_depth
- ), "immersion_depth must be between 0 and 3600"
- assert all(
- 0 <= x <= 1 for x in immersion_depth_direction
- ), "immersion_depth_direction must be between 0 and 1"
- assert all(
- 0 <= x <= 3600 for x in surface_following_distance
- ), "surface_following_distance must be between 0 and 3600"
- assert all(
- 0 <= x <= 12500 for x in aspiration_volumes
- ), "aspiration_volumes must be between 0 and 12500"
- assert all(
- 4 <= x <= 5000 for x in aspiration_speed
- ), "aspiration_speed must be between 4 and 5000"
- assert all(
- 0 <= x <= 500 for x in transport_air_volume
- ), "transport_air_volume must be between 0 and 500"
- assert all(
- 0 <= x <= 9999 for x in blow_out_air_volume
- ), "blow_out_air_volume must be between 0 and 9999"
- assert all(
- 0 <= x <= 999 for x in pre_wetting_volume
- ), "pre_wetting_volume must be between 0 and 999"
+ assert all(0 <= x <= 3600 for x in immersion_depth), (
+ "immersion_depth must be between 0 and 3600"
+ )
+ assert all(0 <= x <= 1 for x in immersion_depth_direction), (
+ "immersion_depth_direction must be between 0 and 1"
+ )
+ assert all(0 <= x <= 3600 for x in surface_following_distance), (
+ "surface_following_distance must be between 0 and 3600"
+ )
+ assert all(0 <= x <= 12500 for x in aspiration_volumes), (
+ "aspiration_volumes must be between 0 and 12500"
+ )
+ assert all(4 <= x <= 5000 for x in aspiration_speed), (
+ "aspiration_speed must be between 4 and 5000"
+ )
+ assert all(0 <= x <= 500 for x in transport_air_volume), (
+ "transport_air_volume must be between 0 and 500"
+ )
+ assert all(0 <= x <= 9999 for x in blow_out_air_volume), (
+ "blow_out_air_volume must be between 0 and 9999"
+ )
+ assert all(0 <= x <= 999 for x in pre_wetting_volume), (
+ "pre_wetting_volume must be between 0 and 999"
+ )
assert all(0 <= x <= 4 for x in lld_mode), "lld_mode must be between 0 and 4"
- assert all(
- 1 <= x <= 4 for x in gamma_lld_sensitivity
- ), "gamma_lld_sensitivity must be between 1 and 4"
- assert all(
- 1 <= x <= 4 for x in dp_lld_sensitivity
- ), "dp_lld_sensitivity must be between 1 and 4"
- assert all(
- 0 <= x <= 100 for x in aspirate_position_above_z_touch_off
- ), "aspirate_position_above_z_touch_off must be between 0 and 100"
- assert all(
- 0 <= x <= 99 for x in detection_height_difference_for_dual_lld
- ), "detection_height_difference_for_dual_lld must be between 0 and 99"
+ assert all(1 <= x <= 4 for x in gamma_lld_sensitivity), (
+ "gamma_lld_sensitivity must be between 1 and 4"
+ )
+ assert all(1 <= x <= 4 for x in dp_lld_sensitivity), (
+ "dp_lld_sensitivity must be between 1 and 4"
+ )
+ assert all(0 <= x <= 100 for x in aspirate_position_above_z_touch_off), (
+ "aspirate_position_above_z_touch_off must be between 0 and 100"
+ )
+ assert all(0 <= x <= 99 for x in detection_height_difference_for_dual_lld), (
+ "detection_height_difference_for_dual_lld must be between 0 and 99"
+ )
assert all(3 <= x <= 1600 for x in swap_speed), "swap_speed must be between 3 and 1600"
assert all(0 <= x <= 99 for x in settling_time), "settling_time must be between 0 and 99"
assert all(0 <= x <= 12500 for x in mix_volume), "mix_volume must be between 0 and 12500"
assert all(0 <= x <= 99 for x in mix_cycles), "mix_cycles must be between 0 and 99"
- assert all(
- 0 <= x <= 900 for x in mix_position_from_liquid_surface
- ), "mix_position_from_liquid_surface must be between 0 and 900"
+ assert all(0 <= x <= 900 for x in mix_position_from_liquid_surface), (
+ "mix_position_from_liquid_surface must be between 0 and 900"
+ )
assert all(4 <= x <= 5000 for x in mix_speed), "mix_speed must be between 4 and 5000"
- assert all(
- 0 <= x <= 3600 for x in mix_surface_following_distance
- ), "mix_surface_following_distance must be between 0 and 3600"
- assert all(
- 0 <= x <= 999 for x in limit_curve_index
- ), "limit_curve_index must be between 0 and 999"
+ assert all(0 <= x <= 3600 for x in mix_surface_following_distance), (
+ "mix_surface_following_distance must be between 0 and 3600"
+ )
+ assert all(0 <= x <= 999 for x in limit_curve_index), (
+ "limit_curve_index must be between 0 and 999"
+ )
assert 0 <= recording_mode <= 2, "recording_mode must be between 0 and 2"
- assert all(
- 0 <= x <= 3600 for x in retract_height_over_2nd_section_to_empty_tip
- ), "retract_height_over_2nd_section_to_empty_tip must be between 0 and 3600"
- assert all(
- 4 <= x <= 5000 for x in dispensation_speed_during_emptying_tip
- ), "dispensation_speed_during_emptying_tip must be between 4 and 5000"
- assert all(
- 4 <= x <= 5000 for x in dosing_drive_speed_during_2nd_section_search
- ), "dosing_drive_speed_during_2nd_section_search must be between 4 and 5000"
- assert all(
- 3 <= x <= 1600 for x in z_drive_speed_during_2nd_section_search
- ), "z_drive_speed_during_2nd_section_search must be between 3 and 1600"
+ assert all(0 <= x <= 3600 for x in retract_height_over_2nd_section_to_empty_tip), (
+ "retract_height_over_2nd_section_to_empty_tip must be between 0 and 3600"
+ )
+ assert all(4 <= x <= 5000 for x in dispensation_speed_during_emptying_tip), (
+ "dispensation_speed_during_emptying_tip must be between 4 and 5000"
+ )
+ assert all(4 <= x <= 5000 for x in dosing_drive_speed_during_2nd_section_search), (
+ "dosing_drive_speed_during_2nd_section_search must be between 4 and 5000"
+ )
+ assert all(3 <= x <= 1600 for x in z_drive_speed_during_2nd_section_search), (
+ "z_drive_speed_during_2nd_section_search must be between 3 and 1600"
+ )
assert all(0 <= x <= 3600 for x in cup_upper_edge), "cup_upper_edge must be between 0 and 3600"
- assert all(
- 0 <= x <= 5000 for x in ratio_liquid_rise_to_tip_deep_in
- ), "ratio_liquid_rise_to_tip_deep_in must be between 0 and 50000"
- assert all(
- 0 <= x <= 3600 for x in immersion_depth_2nd_section
- ), "immersion_depth_2nd_section must be between 0 and 3600"
+ assert all(0 <= x <= 5000 for x in ratio_liquid_rise_to_tip_deep_in), (
+ "ratio_liquid_rise_to_tip_deep_in must be between 0 and 50000"
+ )
+ assert all(0 <= x <= 3600 for x in immersion_depth_2nd_section), (
+ "immersion_depth_2nd_section must be between 0 and 3600"
+ )
return await self.send_command(
module="C0",
@@ -4618,73 +4617,73 @@ async def dispense_pip(
assert all(0 <= xp <= 25000 for xp in x_positions), "x_positions must be between 0 and 25000"
assert all(0 <= yp <= 6500 for yp in y_positions), "y_positions must be between 0 and 6500"
assert any(0 <= x <= 3600 for x in minimum_height), "minimum_height must be between 0 and 3600"
- assert any(
- 0 <= x <= 3600 for x in lld_search_height
- ), "lld_search_height must be between 0 and 3600"
- assert any(
- 0 <= x <= 3600 for x in liquid_surface_no_lld
- ), "liquid_surface_no_lld must be between 0 and 3600"
- assert any(
- 0 <= x <= 3600 for x in pull_out_distance_transport_air
- ), "pull_out_distance_transport_air must be between 0 and 3600"
- assert any(
- 0 <= x <= 3600 for x in immersion_depth
- ), "immersion_depth must be between 0 and 3600"
- assert any(
- 0 <= x <= 1 for x in immersion_depth_direction
- ), "immersion_depth_direction must be between 0 and 1"
- assert any(
- 0 <= x <= 3600 for x in surface_following_distance
- ), "surface_following_distance must be between 0 and 3600"
- assert any(
- 0 <= x <= 3600 for x in second_section_height
- ), "second_section_height must be between 0 and 3600"
- assert any(
- 0 <= x <= 10000 for x in second_section_ratio
- ), "second_section_ratio must be between 0 and 10000"
- assert (
- 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600
- ), "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
+ assert any(0 <= x <= 3600 for x in lld_search_height), (
+ "lld_search_height must be between 0 and 3600"
+ )
+ assert any(0 <= x <= 3600 for x in liquid_surface_no_lld), (
+ "liquid_surface_no_lld must be between 0 and 3600"
+ )
+ assert any(0 <= x <= 3600 for x in pull_out_distance_transport_air), (
+ "pull_out_distance_transport_air must be between 0 and 3600"
+ )
+ assert any(0 <= x <= 3600 for x in immersion_depth), (
+ "immersion_depth must be between 0 and 3600"
+ )
+ assert any(0 <= x <= 1 for x in immersion_depth_direction), (
+ "immersion_depth_direction must be between 0 and 1"
+ )
+ assert any(0 <= x <= 3600 for x in surface_following_distance), (
+ "surface_following_distance must be between 0 and 3600"
+ )
+ assert any(0 <= x <= 3600 for x in second_section_height), (
+ "second_section_height must be between 0 and 3600"
+ )
+ assert any(0 <= x <= 10000 for x in second_section_ratio), (
+ "second_section_ratio must be between 0 and 10000"
+ )
+ assert 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600, (
+ "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
+ )
assert 0 <= min_z_endpos <= 3600, "min_z_endpos must be between 0 and 3600"
- assert any(
- 0 <= x <= 12500 for x in dispense_volumes
- ), "dispense_volume must be between 0 and 12500"
+ assert any(0 <= x <= 12500 for x in dispense_volumes), (
+ "dispense_volume must be between 0 and 12500"
+ )
assert any(4 <= x <= 5000 for x in dispense_speed), "dispense_speed must be between 4 and 5000"
assert any(4 <= x <= 5000 for x in cut_off_speed), "cut_off_speed must be between 4 and 5000"
- assert any(
- 0 <= x <= 180 for x in stop_back_volume
- ), "stop_back_volume must be between 0 and 180"
- assert any(
- 0 <= x <= 500 for x in transport_air_volume
- ), "transport_air_volume must be between 0 and 500"
- assert any(
- 0 <= x <= 9999 for x in blow_out_air_volume
- ), "blow_out_air_volume must be between 0 and 9999"
+ assert any(0 <= x <= 180 for x in stop_back_volume), (
+ "stop_back_volume must be between 0 and 180"
+ )
+ assert any(0 <= x <= 500 for x in transport_air_volume), (
+ "transport_air_volume must be between 0 and 500"
+ )
+ assert any(0 <= x <= 9999 for x in blow_out_air_volume), (
+ "blow_out_air_volume must be between 0 and 9999"
+ )
assert any(0 <= x <= 4 for x in lld_mode), "lld_mode must be between 0 and 4"
assert 0 <= side_touch_off_distance <= 45, "side_touch_off_distance must be between 0 and 45"
- assert any(
- 0 <= x <= 100 for x in dispense_position_above_z_touch_off
- ), "dispense_position_above_z_touch_off must be between 0 and 100"
- assert any(
- 1 <= x <= 4 for x in gamma_lld_sensitivity
- ), "gamma_lld_sensitivity must be between 1 and 4"
- assert any(
- 1 <= x <= 4 for x in dp_lld_sensitivity
- ), "dp_lld_sensitivity must be between 1 and 4"
+ assert any(0 <= x <= 100 for x in dispense_position_above_z_touch_off), (
+ "dispense_position_above_z_touch_off must be between 0 and 100"
+ )
+ assert any(1 <= x <= 4 for x in gamma_lld_sensitivity), (
+ "gamma_lld_sensitivity must be between 1 and 4"
+ )
+ assert any(1 <= x <= 4 for x in dp_lld_sensitivity), (
+ "dp_lld_sensitivity must be between 1 and 4"
+ )
assert any(3 <= x <= 1600 for x in swap_speed), "swap_speed must be between 3 and 1600"
assert any(0 <= x <= 99 for x in settling_time), "settling_time must be between 0 and 99"
assert any(0 <= x <= 12500 for x in mix_volume), "mix_volume must be between 0 and 12500"
assert any(0 <= x <= 99 for x in mix_cycles), "mix_cycles must be between 0 and 99"
- assert any(
- 0 <= x <= 900 for x in mix_position_from_liquid_surface
- ), "mix_position_from_liquid_surface must be between 0 and 900"
+ assert any(0 <= x <= 900 for x in mix_position_from_liquid_surface), (
+ "mix_position_from_liquid_surface must be between 0 and 900"
+ )
assert any(4 <= x <= 5000 for x in mix_speed), "mix_speed must be between 4 and 5000"
- assert any(
- 0 <= x <= 3600 for x in mix_surface_following_distance
- ), "mix_surface_following_distance must be between 0 and 3600"
- assert any(
- 0 <= x <= 999 for x in limit_curve_index
- ), "limit_curve_index must be between 0 and 999"
+ assert any(0 <= x <= 3600 for x in mix_surface_following_distance), (
+ "mix_surface_following_distance must be between 0 and 3600"
+ )
+ assert any(0 <= x <= 999 for x in limit_curve_index), (
+ "limit_curve_index must be between 0 and 999"
+ )
assert 0 <= recording_mode <= 2, "recording_mode must be between 0 and 2"
return await self.send_command(
@@ -4830,12 +4829,12 @@ async def core_get_plate(
assert 0 <= open_gripper_position <= 9999, "open_gripper_position must be between 0 and 9999"
assert 0 <= plate_width <= 9999, "plate_width must be between 0 and 9999"
assert 0 <= grip_strength <= 99, "grip_strength must be between 0 and 99"
- assert (
- 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600
- ), "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
- assert (
- 0 <= minimum_z_position_at_the_command_end <= 3600
- ), "minimum_z_position_at_the_command_end must be between 0 and 3600"
+ assert 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600, (
+ "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
+ )
+ assert 0 <= minimum_z_position_at_the_command_end <= 3600, (
+ "minimum_z_position_at_the_command_end must be between 0 and 3600"
+ )
command_output = await self.send_command(
module="C0",
@@ -4878,12 +4877,12 @@ async def core_put_plate(
assert 0 <= z_press_on_distance <= 50, "z_press_on_distance must be between 0 and 999"
assert 0 <= z_speed <= 1600, "z_speed must be between 0 and 1600"
assert 0 <= open_gripper_position <= 9999, "open_gripper_position must be between 0 and 9999"
- assert (
- 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600
- ), "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
- assert (
- 0 <= z_position_at_the_command_end <= 3600
- ), "z_position_at_the_command_end must be between 0 and 3600"
+ assert 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600, (
+ "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
+ )
+ assert 0 <= z_position_at_the_command_end <= 3600, (
+ "z_position_at_the_command_end must be between 0 and 3600"
+ )
command_output = await self.send_command(
module="C0",
@@ -4945,9 +4944,9 @@ async def position_single_pipetting_channel_in_y_direction(
y_position: y position [0.1mm]. Must be between 0 and 6500.
"""
- assert (
- 1 <= pipetting_channel_index <= self.num_channels
- ), "pipetting_channel_index must be between 1 and self"
+ assert 1 <= pipetting_channel_index <= self.num_channels, (
+ "pipetting_channel_index must be between 1 and self"
+ )
assert 0 <= y_position <= 6500, "y_position must be between 0 and 6500"
return await self.send_command(
@@ -4970,9 +4969,9 @@ async def position_single_pipetting_channel_in_z_direction(
3347 is the max.
"""
- assert (
- 1 <= pipetting_channel_index <= self.num_channels
- ), "pipetting_channel_index must be between 1 and self.num_channels"
+ assert 1 <= pipetting_channel_index <= self.num_channels, (
+ "pipetting_channel_index must be between 1 and self.num_channels"
+ )
# docs say 3600, but empirically 3347 is the max
assert 0 <= z_position <= 3347, "z_position must be between 0 and 3347"
@@ -4993,9 +4992,9 @@ async def search_for_teach_in_signal_using_pipetting_channel_n_in_x_direction(
x_position: x position [0.1mm]. Must be between 0 and 30000.
"""
- assert (
- 1 <= pipetting_channel_index <= self.num_channels
- ), "pipetting_channel_index must be between 1 and self.num_channels"
+ assert 1 <= pipetting_channel_index <= self.num_channels, (
+ "pipetting_channel_index must be between 1 and self.num_channels"
+ )
assert 0 <= x_position <= 30000, "x_position must be between 0 and 30000"
return await self.send_command(
@@ -5034,9 +5033,9 @@ async def move_all_pipetting_channels_to_defined_position(
assert 0 <= x_positions <= 25000, "x_positions must be between 0 and 25000"
assert 0 <= y_positions <= 6500, "y_positions must be between 0 and 6500"
- assert (
- 0 <= minimum_traverse_height_at_beginning_of_command <= 3600
- ), "minimum_traverse_height_at_beginning_of_command must be between 0 and 3600"
+ assert 0 <= minimum_traverse_height_at_beginning_of_command <= 3600, (
+ "minimum_traverse_height_at_beginning_of_command must be between 0 and 3600"
+ )
assert 0 <= z_endpos <= 3600, "z_endpos must be between 0 and 3600"
return await self.send_command(
@@ -5059,9 +5058,9 @@ async def position_max_free_y_for_n(self, pipetting_channel_index: int):
pipetting_channel_index: Index of pipetting channel. Must be between 0 and self.num_channels.
"""
- assert (
- 0 <= pipetting_channel_index < self.num_channels
- ), "pipetting_channel_index must be between 1 and self.num_channels"
+ assert 0 <= pipetting_channel_index < self.num_channels, (
+ "pipetting_channel_index must be between 1 and self.num_channels"
+ )
# convert Python's 0-based indexing to Hamilton firmware's 1-based indexing
pipetting_channel_index = pipetting_channel_index + 1
@@ -5088,9 +5087,9 @@ async def request_y_pos_channel_n(self, pipetting_channel_index: int) -> float:
0 is the backmost channel.
"""
- assert (
- 0 <= pipetting_channel_index < self.num_channels
- ), "pipetting_channel_index must be between 0 and self.num_channels"
+ assert 0 <= pipetting_channel_index < self.num_channels, (
+ "pipetting_channel_index must be between 0 and self.num_channels"
+ )
# convert Python's 0-based indexing to Hamilton firmware's 1-based indexing
pipetting_channel_index = pipetting_channel_index + 1
@@ -5310,7 +5309,7 @@ async def initialize_core_96_head(
xd=0 if loc.x >= 0 else 1,
yh=f"{abs(round(loc.y * 10)):04}",
za=f"{round(loc.z * 10):04}",
- ze=f"{round(z_position_at_the_command_end*10):04}",
+ ze=f"{round(z_position_at_the_command_end * 10):04}",
)
async def move_core_96_to_safe_position(self):
@@ -5357,12 +5356,12 @@ async def pick_up_tips_core96(
assert 0 <= x_direction <= 1, "x_direction must be between 0 and 1"
assert 1080 <= y_position <= 5600, "y_position must be between 1080 and 5600"
assert 0 <= z_deposit_position <= 3425, "z_deposit_position must be between 0 and 3425"
- assert (
- 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3425
- ), "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3425"
- assert (
- 0 <= minimum_height_command_end <= 3425
- ), "minimum_height_command_end must be between 0 and 3425"
+ assert 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3425, (
+ "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3425"
+ )
+ assert 0 <= minimum_height_command_end <= 3425, (
+ "minimum_height_command_end must be between 0 and 3425"
+ )
return await self.send_command(
module="C0",
@@ -5407,12 +5406,12 @@ async def discard_tips_core96(
assert 0 <= x_direction <= 1, "x_direction must be between 0 and 1"
assert 1080 <= y_position <= 5600, "y_position must be between 1080 and 5600"
assert 0 <= z_deposit_position <= 3425, "z_deposit_position must be between 0 and 3425"
- assert (
- 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3425
- ), "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3425"
- assert (
- 0 <= minimum_height_command_end <= 3425
- ), "minimum_height_command_end must be between 0 and 3425"
+ assert 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3425, (
+ "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3425"
+ )
+ assert 0 <= minimum_height_command_end <= 3425, (
+ "minimum_height_command_end must be between 0 and 3425"
+ )
return await self.send_command(
module="C0",
@@ -5525,31 +5524,31 @@ async def aspirate_core_96(
assert 0 <= x_position <= 30000, "x_position must be between 0 and 30000"
assert 0 <= x_direction <= 1, "x_direction must be between 0 and 1"
assert 1080 <= y_positions <= 5600, "y_positions must be between 1080 and 5600"
- assert (
- 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3425
- ), "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3425"
+ assert 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3425, (
+ "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3425"
+ )
assert 0 <= minimal_end_height <= 3425, "minimal_end_height must be between 0 and 3425"
assert 0 <= lld_search_height <= 3425, "lld_search_height must be between 0 and 3425"
- assert (
- 0 <= liquid_surface_at_function_without_lld <= 3425
- ), "liquid_surface_at_function_without_lld must be between 0 and 3425"
- assert (
- 0 <= pull_out_distance_to_take_transport_air_in_function_without_lld <= 3425
- ), "pull_out_distance_to_take_transport_air_in_function_without_lld must be between 0 and 3425"
- assert (
- 0 <= maximum_immersion_depth <= 3425
- ), "maximum_immersion_depth must be between 0 and 3425"
- assert (
- 0 <= tube_2nd_section_height_measured_from_zm <= 3425
- ), "tube_2nd_section_height_measured_from_zm must be between 0 and 3425"
- assert (
- 0 <= tube_2nd_section_ratio <= 10000
- ), "tube_2nd_section_ratio must be between 0 and 10000"
+ assert 0 <= liquid_surface_at_function_without_lld <= 3425, (
+ "liquid_surface_at_function_without_lld must be between 0 and 3425"
+ )
+ assert 0 <= pull_out_distance_to_take_transport_air_in_function_without_lld <= 3425, (
+ "pull_out_distance_to_take_transport_air_in_function_without_lld must be between 0 and 3425"
+ )
+ assert 0 <= maximum_immersion_depth <= 3425, (
+ "maximum_immersion_depth must be between 0 and 3425"
+ )
+ assert 0 <= tube_2nd_section_height_measured_from_zm <= 3425, (
+ "tube_2nd_section_height_measured_from_zm must be between 0 and 3425"
+ )
+ assert 0 <= tube_2nd_section_ratio <= 10000, (
+ "tube_2nd_section_ratio must be between 0 and 10000"
+ )
assert 0 <= immersion_depth <= 3600, "immersion_depth must be between 0 and 3600"
assert 0 <= immersion_depth_direction <= 1, "immersion_depth_direction must be between 0 and 1"
- assert (
- 0 <= liquid_surface_sink_distance_at_the_end_of_aspiration <= 990
- ), "liquid_surface_sink_distance_at_the_end_of_aspiration must be between 0 and 990"
+ assert 0 <= liquid_surface_sink_distance_at_the_end_of_aspiration <= 990, (
+ "liquid_surface_sink_distance_at_the_end_of_aspiration must be between 0 and 990"
+ )
assert 0 <= aspiration_volumes <= 11500, "aspiration_volumes must be between 0 and 11500"
assert 3 <= aspiration_speed <= 5000, "aspiration_speed must be between 3 and 5000"
assert 0 <= transport_air_volume <= 500, "transport_air_volume must be between 0 and 500"
@@ -5561,12 +5560,12 @@ async def aspirate_core_96(
assert 0 <= settling_time <= 99, "settling_time must be between 0 and 99"
assert 0 <= mix_volume <= 11500, "mix_volume must be between 0 and 11500"
assert 0 <= mix_cycles <= 99, "mix_cycles must be between 0 and 99"
- assert (
- 0 <= mix_position_from_liquid_surface <= 990
- ), "mix_position_from_liquid_surface must be between 0 and 990"
- assert (
- 0 <= surface_following_distance_during_mix <= 990
- ), "surface_following_distance_during_mix must be between 0 and 990"
+ assert 0 <= mix_position_from_liquid_surface <= 990, (
+ "mix_position_from_liquid_surface must be between 0 and 990"
+ )
+ assert 0 <= surface_following_distance_during_mix <= 990, (
+ "surface_following_distance_during_mix must be between 0 and 990"
+ )
assert 3 <= speed_of_mix <= 5000, "speed_of_mix must be between 3 and 5000"
assert 0 <= limit_curve_index <= 999, "limit_curve_index must be between 0 and 999"
@@ -5717,30 +5716,30 @@ async def dispense_core_96(
assert 0 <= x_position <= 30000, "x_position must be between 0 and 30000"
assert 0 <= x_direction <= 1, "x_direction must be between 0 and 1"
assert 1080 <= y_position <= 5600, "y_position must be between 1080 and 5600"
- assert (
- 0 <= maximum_immersion_depth <= 3425
- ), "maximum_immersion_depth must be between 0 and 3425"
- assert (
- 0 <= tube_2nd_section_height_measured_from_zm <= 3425
- ), "tube_2nd_section_height_measured_from_zm must be between 0 and 3425"
- assert (
- 0 <= tube_2nd_section_ratio <= 10000
- ), "tube_2nd_section_ratio must be between 0 and 10000"
+ assert 0 <= maximum_immersion_depth <= 3425, (
+ "maximum_immersion_depth must be between 0 and 3425"
+ )
+ assert 0 <= tube_2nd_section_height_measured_from_zm <= 3425, (
+ "tube_2nd_section_height_measured_from_zm must be between 0 and 3425"
+ )
+ assert 0 <= tube_2nd_section_ratio <= 10000, (
+ "tube_2nd_section_ratio must be between 0 and 10000"
+ )
assert 0 <= lld_search_height <= 3425, "lld_search_height must be between 0 and 3425"
- assert (
- 0 <= liquid_surface_at_function_without_lld <= 3425
- ), "liquid_surface_at_function_without_lld must be between 0 and 3425"
- assert (
- 0 <= pull_out_distance_to_take_transport_air_in_function_without_lld <= 3425
- ), "pull_out_distance_to_take_transport_air_in_function_without_lld must be between 0 and 3425"
+ assert 0 <= liquid_surface_at_function_without_lld <= 3425, (
+ "liquid_surface_at_function_without_lld must be between 0 and 3425"
+ )
+ assert 0 <= pull_out_distance_to_take_transport_air_in_function_without_lld <= 3425, (
+ "pull_out_distance_to_take_transport_air_in_function_without_lld must be between 0 and 3425"
+ )
assert 0 <= immersion_depth <= 3600, "immersion_depth must be between 0 and 3600"
assert 0 <= immersion_depth_direction <= 1, "immersion_depth_direction must be between 0 and 1"
- assert (
- 0 <= liquid_surface_sink_distance_at_the_end_of_dispense <= 990
- ), "liquid_surface_sink_distance_at_the_end_of_dispense must be between 0 and 990"
- assert (
- 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3425
- ), "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3425"
+ assert 0 <= liquid_surface_sink_distance_at_the_end_of_dispense <= 990, (
+ "liquid_surface_sink_distance_at_the_end_of_dispense must be between 0 and 990"
+ )
+ assert 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3425, (
+ "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3425"
+ )
assert 0 <= minimal_end_height <= 3425, "minimal_end_height must be between 0 and 3425"
assert 0 <= dispense_volume <= 11500, "dispense_volume must be between 0 and 11500"
assert 3 <= dispense_speed <= 5000, "dispense_speed must be between 3 and 5000"
@@ -5755,12 +5754,12 @@ async def dispense_core_96(
assert 0 <= settling_time <= 99, "settling_time must be between 0 and 99"
assert 0 <= mixing_volume <= 11500, "mixing_volume must be between 0 and 11500"
assert 0 <= mixing_cycles <= 99, "mixing_cycles must be between 0 and 99"
- assert (
- 0 <= mixing_position_from_liquid_surface <= 990
- ), "mixing_position_from_liquid_surface must be between 0 and 990"
- assert (
- 0 <= surface_following_distance_during_mixing <= 990
- ), "surface_following_distance_during_mixing must be between 0 and 990"
+ assert 0 <= mixing_position_from_liquid_surface <= 990, (
+ "mixing_position_from_liquid_surface must be between 0 and 990"
+ )
+ assert 0 <= surface_following_distance_during_mixing <= 990, (
+ "surface_following_distance_during_mixing must be between 0 and 990"
+ )
assert 3 <= speed_of_mixing <= 5000, "speed_of_mixing must be between 3 and 5000"
assert 0 <= limit_curve_index <= 999, "limit_curve_index must be between 0 and 999"
assert 0 <= recording_mode <= 2, "recording_mode must be between 0 and 2"
@@ -5832,18 +5831,18 @@ async def move_core_96_head_to_defined_position(
# TODO: these are values for a STAR. Find them for a STARlet.
self._check_96_position_legal(Coordinate(x, y, z))
- assert (
- 0 <= minimum_height_at_beginning_of_a_command <= 342.5
- ), "minimum_height_at_beginning_of_a_command must be between 0 and 342.5"
+ assert 0 <= minimum_height_at_beginning_of_a_command <= 342.5, (
+ "minimum_height_at_beginning_of_a_command must be between 0 and 342.5"
+ )
return await self.send_command(
module="C0",
command="EM",
- xs=f"{abs(round(x*10)):05}",
+ xs=f"{abs(round(x * 10)):05}",
xd=0 if x >= 0 else 1,
- yh=f"{round(y*10):04}",
- za=f"{round(z*10):04}",
- zh=f"{round(minimum_height_at_beginning_of_a_command*10):04}",
+ yh=f"{round(y * 10):04}",
+ za=f"{round(z * 10):04}",
+ zh=f"{round(minimum_height_at_beginning_of_a_command * 10):04}",
)
async def move_core_96_head_x(self, x_position: float):
@@ -6540,9 +6539,9 @@ async def park_iswap(
of a command [0.1mm]. Must be between 0 and 3600. Default 3600.
"""
- assert (
- 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600
- ), "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
+ assert 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600, (
+ "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
+ )
command_output = await self.send_command(
module="C0",
@@ -6608,23 +6607,23 @@ async def iswap_get_plate(
assert 0 <= z_position <= 3600, "z_position must be between 0 and 3600"
assert 0 <= z_direction <= 1, "z_direction must be between 0 and 1"
assert 1 <= grip_direction <= 4, "grip_direction must be between 1 and 4"
- assert (
- 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600
- ), "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
- assert (
- 0 <= z_position_at_the_command_end <= 3600
- ), "z_position_at_the_command_end must be between 0 and 3600"
+ assert 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600, (
+ "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
+ )
+ assert 0 <= z_position_at_the_command_end <= 3600, (
+ "z_position_at_the_command_end must be between 0 and 3600"
+ )
assert 1 <= grip_strength <= 9, "grip_strength must be between 1 and 9"
assert 0 <= open_gripper_position <= 9999, "open_gripper_position must be between 0 and 9999"
assert 0 <= plate_width <= 9999, "plate_width must be between 0 and 9999"
assert 0 <= plate_width_tolerance <= 99, "plate_width_tolerance must be between 0 and 99"
assert 0 <= collision_control_level <= 1, "collision_control_level must be between 0 and 1"
- assert (
- 0 <= acceleration_index_high_acc <= 4
- ), "acceleration_index_high_acc must be between 0 and 4"
- assert (
- 0 <= acceleration_index_low_acc <= 4
- ), "acceleration_index_low_acc must be between 0 and 4"
+ assert 0 <= acceleration_index_high_acc <= 4, (
+ "acceleration_index_high_acc must be between 0 and 4"
+ )
+ assert 0 <= acceleration_index_low_acc <= 4, (
+ "acceleration_index_low_acc must be between 0 and 4"
+ )
command_output = await self.send_command(
module="C0",
@@ -6701,20 +6700,20 @@ async def iswap_put_plate(
assert 0 <= z_position <= 3600, "z_position must be between 0 and 3600"
assert 0 <= z_direction <= 1, "z_direction must be between 0 and 1"
assert 1 <= grip_direction <= 4, "grip_direction must be between 1 and 4"
- assert (
- 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600
- ), "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
- assert (
- 0 <= z_position_at_the_command_end <= 3600
- ), "z_position_at_the_command_end must be between 0 and 3600"
+ assert 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600, (
+ "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
+ )
+ assert 0 <= z_position_at_the_command_end <= 3600, (
+ "z_position_at_the_command_end must be between 0 and 3600"
+ )
assert 0 <= open_gripper_position <= 9999, "open_gripper_position must be between 0 and 9999"
assert 0 <= collision_control_level <= 1, "collision_control_level must be between 0 and 1"
- assert (
- 0 <= acceleration_index_high_acc <= 4
- ), "acceleration_index_high_acc must be between 0 and 4"
- assert (
- 0 <= acceleration_index_low_acc <= 4
- ), "acceleration_index_low_acc must be between 0 and 4"
+ assert 0 <= acceleration_index_high_acc <= 4, (
+ "acceleration_index_high_acc must be between 0 and 4"
+ )
+ assert 0 <= acceleration_index_low_acc <= 4, (
+ "acceleration_index_low_acc must be between 0 and 4"
+ )
command_output = await self.send_command(
module="C0",
@@ -6843,16 +6842,16 @@ async def move_plate_to_position(
assert 0 <= z_position <= 3600, "z_position must be between 0 and 3600"
assert 0 <= z_direction <= 1, "z_direction must be between 0 and 1"
assert 1 <= grip_direction <= 4, "grip_direction must be between 1 and 4"
- assert (
- 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600
- ), "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
+ assert 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600, (
+ "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
+ )
assert 0 <= collision_control_level <= 1, "collision_control_level must be between 0 and 1"
- assert (
- 0 <= acceleration_index_high_acc <= 4
- ), "acceleration_index_high_acc must be between 0 and 4"
- assert (
- 0 <= acceleration_index_low_acc <= 4
- ), "acceleration_index_low_acc must be between 0 and 4"
+ assert 0 <= acceleration_index_high_acc <= 4, (
+ "acceleration_index_high_acc must be between 0 and 4"
+ )
+ assert 0 <= acceleration_index_low_acc <= 4, (
+ "acceleration_index_low_acc must be between 0 and 4"
+ )
command_output = await self.send_command(
module="C0",
@@ -6886,9 +6885,9 @@ async def collapse_gripper_arm(
iswap_fold_up_sequence_at_the_end_of_process: fold up sequence at the end of process. Default False.
"""
- assert (
- 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600
- ), "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
+ assert 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600, (
+ "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
+ )
return await self.send_command(
module="C0",
@@ -6952,16 +6951,16 @@ async def prepare_iswap_teaching(
assert 0 <= z_direction <= 1, "z_direction must be between 0 and 1"
assert 0 <= location <= 1, "location must be between 0 and 1"
assert 0 <= hotel_depth <= 3000, "hotel_depth must be between 0 and 3000"
- assert (
- 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600
- ), "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
+ assert 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600, (
+ "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
+ )
assert 0 <= collision_control_level <= 1, "collision_control_level must be between 0 and 1"
- assert (
- 0 <= acceleration_index_high_acc <= 4
- ), "acceleration_index_high_acc must be between 0 and 4"
- assert (
- 0 <= acceleration_index_low_acc <= 4
- ), "acceleration_index_low_acc must be between 0 and 4"
+ assert 0 <= acceleration_index_high_acc <= 4, (
+ "acceleration_index_high_acc must be between 0 and 4"
+ )
+ assert 0 <= acceleration_index_low_acc <= 4, (
+ "acceleration_index_low_acc must be between 0 and 4"
+ )
return await self.send_command(
module="C0",
@@ -7219,15 +7218,15 @@ async def clld_probe_z_height_using_channel(
+ f"and {STAR.z_drive_increment_to_mm(15_000)} mm/sec, is {channel_speed} mm/sec"
)
assert 5 <= channel_acceleration_thousand_increments <= 150, (
- f"Channel acceleration must be between \n{STAR.z_drive_increment_to_mm(5*1_000)} "
- + f" and {STAR.z_drive_increment_to_mm(150*1_000)} mm/sec**2, is {channel_acceleration} mm/sec**2"
- )
- assert (
- 0 <= detection_edge <= 1_023
- ), "Edge steepness at capacitive LLD detection must be between 0 and 1023"
- assert (
- 0 <= detection_drop <= 1_023
- ), "Offset after capacitive LLD edge detection must be between 0 and 1023"
+ f"Channel acceleration must be between \n{STAR.z_drive_increment_to_mm(5 * 1_000)} "
+ + f" and {STAR.z_drive_increment_to_mm(150 * 1_000)} mm/sec**2, is {channel_acceleration} mm/sec**2"
+ )
+ assert 0 <= detection_edge <= 1_023, (
+ "Edge steepness at capacitive LLD detection must be between 0 and 1023"
+ )
+ assert 0 <= detection_drop <= 1_023, (
+ "Offset after capacitive LLD edge detection must be between 0 and 1023"
+ )
assert 0 <= post_detection_dist_increments <= 9_999, (
"Post cLLD-detection movement distance must be between \n0"
+ f" and {STAR.z_drive_increment_to_mm(9_999)} mm, is {post_detection_dist} mm"
@@ -7402,20 +7401,20 @@ async def ztouch_probe_z_height_using_channel(
+ f" and {STAR.z_drive_increment_to_mm(15_000)} mm/sec, is {channel_speed} mm/sec"
)
assert 5 <= channel_acceleration_thousand_increments <= 150, (
- f"Channel acceleration must be between \n{STAR.z_drive_increment_to_mm(5*1_000)}"
- + f" and {STAR.z_drive_increment_to_mm(150*1_000)} mm/sec**2, is {channel_speed} mm/sec**2"
+ f"Channel acceleration must be between \n{STAR.z_drive_increment_to_mm(5 * 1_000)}"
+ + f" and {STAR.z_drive_increment_to_mm(150 * 1_000)} mm/sec**2, is {channel_speed} mm/sec**2"
)
assert 20 <= channel_speed_upwards_increments <= 15_000, (
f"Channel retraction speed must be between \n{STAR.z_drive_increment_to_mm(20)}"
+ f" and {STAR.z_drive_increment_to_mm(15_000)} mm/sec, is {channel_speed_upwards} mm/sec"
)
- assert (
- 0 <= detection_limiter_in_PWM <= 125
- ), "Detection limiter value must be between 0 and 125 PWM."
+ assert 0 <= detection_limiter_in_PWM <= 125, (
+ "Detection limiter value must be between 0 and 125 PWM."
+ )
assert 0 <= push_down_force_in_PWM <= 125, "Push down force between 0 and 125 PWM values"
- assert (
- 0 <= post_detection_dist <= 245
- ), f"Post detection distance must be between 0 and 245 mm, is {post_detection_dist}"
+ assert 0 <= post_detection_dist <= 245, (
+ f"Post detection distance must be between 0 and 245 mm, is {post_detection_dist}"
+ )
lowest_immers_pos_str = f"{lowest_immers_pos_increments:05}"
start_pos_search_str = f"{start_pos_search_increments:05}"
@@ -7567,7 +7566,7 @@ async def position_channels_in_y_direction(self, ys: Dict[int, float], make_spac
):
raise ValueError("Channels must be at least 9mm apart and in descending order")
- yp = " ".join([f"{round(y*10):04}" for y in channel_locations.values()])
+ yp = " ".join([f"{round(y * 10):04}" for y in channel_locations.values()])
return await self.send_command(
module="C0",
command="JY",
@@ -7590,7 +7589,7 @@ async def position_channels_in_z_direction(self, zs: Dict[int, float]):
channel_locations[channel_idx] = z
return await self.send_command(
- module="C0", command="JZ", zp=[f"{round(z*10):04}" for z in channel_locations.values()]
+ module="C0", command="JZ", zp=[f"{round(z * 10):04}" for z in channel_locations.values()]
)
async def pierce_foil(
@@ -7641,9 +7640,9 @@ async def pierce_foil(
)
ys = [y + offset.y for offset in offsets]
else:
- assert (
- len(set(w.get_absolute_location().x for w in wells)) == 1
- ), "Wells must be on the same column"
+ assert len(set(w.get_absolute_location().x for w in wells)) == 1, (
+ "Wells must be on the same column"
+ )
absolute_center = wells[0].get_absolute_location("c", "c", "cavity_bottom")
x = absolute_center.x
ys = [well.get_absolute_location(x="c", y="c").y for well in wells]
@@ -7709,7 +7708,7 @@ async def step_off_foil(
if front_channel <= back_channel:
raise ValueError(
- "front_channel should be in front of back_channel. " "Channels are 0-indexed from the back."
+ "front_channel should be in front of back_channel. Channels are 0-indexed from the back."
)
if isinstance(wells, Well):
diff --git a/pylabrobot/liquid_handling/backends/hamilton/STAR_tests.py b/pylabrobot/liquid_handling/backends/hamilton/STAR_tests.py
index 757fb700d52..c836b7ff4ee 100644
--- a/pylabrobot/liquid_handling/backends/hamilton/STAR_tests.py
+++ b/pylabrobot/liquid_handling/backends/hamilton/STAR_tests.py
@@ -925,7 +925,7 @@ async def test_move_core(self):
"C0ZTid0001xs07975xd0ya1240yb1065pa07pb08tp2350tz2250th2800tt14"
),
_any_write_and_read_command_call(
- "C0ZPid0002xs03479xd0yj1142yv0050zj1876zy0500yo0885yg0825yw15" "th2800te2800"
+ "C0ZPid0002xs03479xd0yj1142yv0050zj1876zy0500yo0885yg0825yw15th2800te2800"
),
_any_write_and_read_command_call(
"C0ZRid0003xs03479xd0yj2102zj1876zi000zy0500yo0885th2800te2800"
diff --git a/pylabrobot/liquid_handling/backends/hamilton/vantage_backend.py b/pylabrobot/liquid_handling/backends/hamilton/vantage_backend.py
index 4a6fafcdbcb..b2ff6121964 100644
--- a/pylabrobot/liquid_handling/backends/hamilton/vantage_backend.py
+++ b/pylabrobot/liquid_handling/backends/hamilton/vantage_backend.py
@@ -1618,17 +1618,17 @@ async def define_tip_needle(
if not 0 <= tip_type_table_index <= 99:
raise ValueError(
- "tip_type_table_index must be between 0 and 99, but is " f"{tip_type_table_index}"
+ f"tip_type_table_index must be between 0 and 99, but is {tip_type_table_index}"
)
if not 0 <= tip_type_table_index <= 99:
raise ValueError(
- "tip_type_table_index must be between 0 and 99, but is " f"{tip_type_table_index}"
+ f"tip_type_table_index must be between 0 and 99, but is {tip_type_table_index}"
)
if not 1 <= tip_length <= 1999:
- raise ValueError("tip_length must be between 1 and 1999, but is " f"{tip_length}")
+ raise ValueError(f"tip_length must be between 1 and 1999, but is {tip_length}")
if not 1 <= maximum_tip_volume <= 56000:
raise ValueError(
- "maximum_tip_volume must be between 1 and 56000, but is " f"{maximum_tip_volume}"
+ f"maximum_tip_volume must be between 1 and 56000, but is {maximum_tip_volume}"
)
return await self.send_command(
@@ -1780,8 +1780,7 @@ async def pip_aspirate(
0 <= x <= 3600 for x in pull_out_distance_to_take_transport_air_in_function_without_lld
):
raise ValueError(
- "pull_out_distance_to_take_transport_air_in_function_without_lld must be "
- "in range 0 to 3600"
+ "pull_out_distance_to_take_transport_air_in_function_without_lld must be in range 0 to 3600"
)
if tube_2nd_section_height_measured_from_zm is None:
@@ -2095,8 +2094,7 @@ async def pip_dispense(
0 <= x <= 3600 for x in pull_out_distance_to_take_transport_air_in_function_without_lld
):
raise ValueError(
- "pull_out_distance_to_take_transport_air_in_function_without_lld must be "
- "in range 0 to 3600"
+ "pull_out_distance_to_take_transport_air_in_function_without_lld must be in range 0 to 3600"
)
if immersion_depth is None:
@@ -2436,8 +2434,7 @@ async def simultaneous_aspiration_dispensation_of_liquid(
0 <= x <= 3600 for x in pull_out_distance_to_take_transport_air_in_function_without_lld
):
raise ValueError(
- "pull_out_distance_to_take_transport_air_in_function_without_lld must be "
- "in range 0 to 3600"
+ "pull_out_distance_to_take_transport_air_in_function_without_lld must be in range 0 to 3600"
)
if minimum_height is None:
@@ -4049,8 +4046,7 @@ async def core96_aspiration_of_liquid(
if not 0 <= pull_out_distance_to_take_transport_air_in_function_without_lld <= 3900:
raise ValueError(
- "pull_out_distance_to_take_transport_air_in_function_without_lld must be in "
- "range 0 to 3900"
+ "pull_out_distance_to_take_transport_air_in_function_without_lld must be in range 0 to 3900"
)
if not 0 <= minimum_height <= 3900:
@@ -4117,7 +4113,7 @@ async def core96_aspiration_of_liquid(
tadm_channel_pattern = [True] * 96
elif not len(tadm_channel_pattern) < 24:
raise ValueError(
- "tadm_channel_pattern must be of length 24, but is " f"'{len(tadm_channel_pattern)}'"
+ f"tadm_channel_pattern must be of length 24, but is '{len(tadm_channel_pattern)}'"
)
tadm_channel_pattern_num = sum(2**i if tadm_channel_pattern[i] else 0 for i in range(96))
@@ -4270,8 +4266,7 @@ async def core96_dispensing_of_liquid(
if not 0 <= pull_out_distance_to_take_transport_air_in_function_without_lld <= 3900:
raise ValueError(
- "pull_out_distance_to_take_transport_air_in_function_without_lld must be in "
- "range 0 to 3900"
+ "pull_out_distance_to_take_transport_air_in_function_without_lld must be in range 0 to 3900"
)
if not -990 <= immersion_depth <= 990:
@@ -4341,7 +4336,7 @@ async def core96_dispensing_of_liquid(
tadm_channel_pattern = [True] * 96
elif not len(tadm_channel_pattern) < 24:
raise ValueError(
- "tadm_channel_pattern must be of length 24, but is " f"'{len(tadm_channel_pattern)}'"
+ f"tadm_channel_pattern must be of length 24, but is '{len(tadm_channel_pattern)}'"
)
tadm_channel_pattern_num = sum(2**i if tadm_channel_pattern[i] else 0 for i in range(96))
@@ -4683,7 +4678,7 @@ async def core96_request_tadm_error_status(
tadm_channel_pattern = [True] * 96
elif not len(tadm_channel_pattern) < 24:
raise ValueError(
- "tadm_channel_pattern must be of length 24, but is " f"'{len(tadm_channel_pattern)}'"
+ f"tadm_channel_pattern must be of length 24, but is '{len(tadm_channel_pattern)}'"
)
tadm_channel_pattern_num = sum(2**i if tadm_channel_pattern[i] else 0 for i in range(96))
diff --git a/pylabrobot/liquid_handling/backends/tecan/EVO_backend.py b/pylabrobot/liquid_handling/backends/tecan/EVO_backend.py
index e18fb469fe1..cf22cbc35eb 100644
--- a/pylabrobot/liquid_handling/backends/tecan/EVO_backend.py
+++ b/pylabrobot/liquid_handling/backends/tecan/EVO_backend.py
@@ -486,9 +486,9 @@ async def pick_up_tips(self, ops: List[Pickup], use_channels: List[int]):
use_channels: The channels to use for the pickup operations.
"""
- assert (
- min(use_channels) >= self.num_channels - self.diti_count
- ), f"DiTis can only be configured for the last {self.diti_count} channels"
+ assert min(use_channels) >= self.num_channels - self.diti_count, (
+ f"DiTis can only be configured for the last {self.diti_count} channels"
+ )
# Get positions including offsets
x_positions, y_positions, z_positions = self._liha_positions(ops, use_channels)
@@ -530,12 +530,12 @@ async def drop_tips(self, ops: List[Drop], use_channels: List[int]):
use_channels: The channels to use for the drop operations.
"""
- assert (
- min(use_channels) >= self.num_channels - self.diti_count
- ), f"DiTis can only be configured for the last {self.diti_count} channels"
- assert all(
- isinstance(op.resource, (Trash, TipSpot)) for op in ops
- ), "Must drop in waste container or tip rack"
+ assert min(use_channels) >= self.num_channels - self.diti_count, (
+ f"DiTis can only be configured for the last {self.diti_count} channels"
+ )
+ assert all(isinstance(op.resource, (Trash, TipSpot)) for op in ops), (
+ "Must drop in waste container or tip rack"
+ )
# Get positions including offsets
x_positions, y_positions, _ = self._liha_positions(ops, use_channels)
@@ -1195,7 +1195,9 @@ async def _drop_disposable_tip(self, tips, discard_height):
discard_height: binary. 0 above tip rack, 1 in tip rack
"""
- await self.backend.send_command(module=self.module, command="AST", params=[tips, discard_height])
+ await self.backend.send_command(
+ module=self.module, command="AST", params=[tips, discard_height]
+ )
class Mca(EVOArm):
diff --git a/pylabrobot/liquid_handling/liquid_classes/hamilton/star.py b/pylabrobot/liquid_handling/liquid_classes/hamilton/star.py
index ac1d91f9a1a..532fbb19170 100644
--- a/pylabrobot/liquid_handling/liquid_classes/hamilton/star.py
+++ b/pylabrobot/liquid_handling/liquid_classes/hamilton/star.py
@@ -3310,37 +3310,37 @@ def get_star_liquid_class(
)
-star_mapping[(5000, False, True, False, Liquid.DMSO, True, True)] = (
- _5mlT_DMSO_DispenseJet_Empty
-) = HamiltonLiquidClass(
- curve={
- 500.0: 540.0,
- 50.0: 62.0,
- 5000.0: 5095.0,
- 4000.0: 4075.0,
- 0.0: 0.0,
- 3000.0: 3065.0,
- 100.0: 117.0,
- 2000.0: 2060.0,
- 1000.0: 1060.0,
- },
- aspiration_flow_rate=2000.0,
- aspiration_mix_flow_rate=500.0,
- aspiration_air_transport_volume=20.0,
- aspiration_blow_out_volume=50.0,
- aspiration_swap_speed=2.0,
- aspiration_settling_time=1.0,
- aspiration_over_aspirate_volume=0.0,
- aspiration_clot_retract_height=0.0,
- dispense_flow_rate=1000.0,
- dispense_mode=3.0,
- dispense_mix_flow_rate=100.0,
- dispense_air_transport_volume=20.0,
- dispense_blow_out_volume=50.0,
- dispense_swap_speed=1.0,
- dispense_settling_time=0.0,
- dispense_stop_flow_rate=400.0,
- dispense_stop_back_volume=0.0,
+star_mapping[(5000, False, True, False, Liquid.DMSO, True, True)] = _5mlT_DMSO_DispenseJet_Empty = (
+ HamiltonLiquidClass(
+ curve={
+ 500.0: 540.0,
+ 50.0: 62.0,
+ 5000.0: 5095.0,
+ 4000.0: 4075.0,
+ 0.0: 0.0,
+ 3000.0: 3065.0,
+ 100.0: 117.0,
+ 2000.0: 2060.0,
+ 1000.0: 1060.0,
+ },
+ aspiration_flow_rate=2000.0,
+ aspiration_mix_flow_rate=500.0,
+ aspiration_air_transport_volume=20.0,
+ aspiration_blow_out_volume=50.0,
+ aspiration_swap_speed=2.0,
+ aspiration_settling_time=1.0,
+ aspiration_over_aspirate_volume=0.0,
+ aspiration_clot_retract_height=0.0,
+ dispense_flow_rate=1000.0,
+ dispense_mode=3.0,
+ dispense_mix_flow_rate=100.0,
+ dispense_air_transport_volume=20.0,
+ dispense_blow_out_volume=50.0,
+ dispense_swap_speed=1.0,
+ dispense_settling_time=0.0,
+ dispense_stop_flow_rate=400.0,
+ dispense_stop_back_volume=0.0,
+ )
)
@@ -4122,36 +4122,36 @@ def get_star_liquid_class(
# - Submerge depth: Aspiration 2.0mm
# (bei Schaumbildung durch mischen/vorbenetzen evtl.5mm, LLD-Erkennung)
# - Mischen 3-5 x 950µl, mix position 0.5mm, je nach Volumen im Tube
-star_mapping[(1000, False, True, False, Liquid.BLOOD, True, False)] = (
- HighVolumeBloodDispenseJet
-) = HamiltonLiquidClass(
- curve={
- 500.0: 536.3,
- 250.0: 275.6,
- 50.0: 59.8,
- 0.0: 0.0,
- 20.0: 26.2,
- 100.0: 115.3,
- 10.0: 12.2,
- 1000.0: 1061.6,
- },
- aspiration_flow_rate=250.0,
- aspiration_mix_flow_rate=250.0,
- aspiration_air_transport_volume=5.0,
- aspiration_blow_out_volume=50.0,
- aspiration_swap_speed=2.0,
- aspiration_settling_time=2.0,
- aspiration_over_aspirate_volume=0.0,
- aspiration_clot_retract_height=0.0,
- dispense_flow_rate=400.0,
- dispense_mode=0.0,
- dispense_mix_flow_rate=250.0,
- dispense_air_transport_volume=5.0,
- dispense_blow_out_volume=50.0,
- dispense_swap_speed=2.0,
- dispense_settling_time=0.0,
- dispense_stop_flow_rate=300.0,
- dispense_stop_back_volume=0.0,
+star_mapping[(1000, False, True, False, Liquid.BLOOD, True, False)] = HighVolumeBloodDispenseJet = (
+ HamiltonLiquidClass(
+ curve={
+ 500.0: 536.3,
+ 250.0: 275.6,
+ 50.0: 59.8,
+ 0.0: 0.0,
+ 20.0: 26.2,
+ 100.0: 115.3,
+ 10.0: 12.2,
+ 1000.0: 1061.6,
+ },
+ aspiration_flow_rate=250.0,
+ aspiration_mix_flow_rate=250.0,
+ aspiration_air_transport_volume=5.0,
+ aspiration_blow_out_volume=50.0,
+ aspiration_swap_speed=2.0,
+ aspiration_settling_time=2.0,
+ aspiration_over_aspirate_volume=0.0,
+ aspiration_clot_retract_height=0.0,
+ dispense_flow_rate=400.0,
+ dispense_mode=0.0,
+ dispense_mix_flow_rate=250.0,
+ dispense_air_transport_volume=5.0,
+ dispense_blow_out_volume=50.0,
+ dispense_swap_speed=2.0,
+ dispense_settling_time=0.0,
+ dispense_stop_flow_rate=300.0,
+ dispense_stop_back_volume=0.0,
+ )
)
@@ -4268,37 +4268,37 @@ def get_star_liquid_class(
# 100 ( 9 Aliquots) 0.25 -4.81
#
#
-star_mapping[(1000, False, True, False, Liquid.DMSO, True, False)] = (
- HighVolumeDMSOAliquotJet
-) = HamiltonLiquidClass(
- curve={
- 500.0: 500.0,
- 250.0: 250.0,
- 0.0: 0.0,
- 30.0: 30.0,
- 20.0: 20.0,
- 100.0: 100.0,
- 10.0: 10.0,
- 750.0: 750.0,
- 1000.0: 1000.0,
- },
- aspiration_flow_rate=250.0,
- aspiration_mix_flow_rate=250.0,
- aspiration_air_transport_volume=0.0,
- aspiration_blow_out_volume=50.0,
- aspiration_swap_speed=2.0,
- aspiration_settling_time=1.0,
- aspiration_over_aspirate_volume=0.0,
- aspiration_clot_retract_height=0.0,
- dispense_flow_rate=300.0,
- dispense_mode=0.0,
- dispense_mix_flow_rate=250.0,
- dispense_air_transport_volume=0.0,
- dispense_blow_out_volume=50.0,
- dispense_swap_speed=2.0,
- dispense_settling_time=0.0,
- dispense_stop_flow_rate=200.0,
- dispense_stop_back_volume=10.0,
+star_mapping[(1000, False, True, False, Liquid.DMSO, True, False)] = HighVolumeDMSOAliquotJet = (
+ HamiltonLiquidClass(
+ curve={
+ 500.0: 500.0,
+ 250.0: 250.0,
+ 0.0: 0.0,
+ 30.0: 30.0,
+ 20.0: 20.0,
+ 100.0: 100.0,
+ 10.0: 10.0,
+ 750.0: 750.0,
+ 1000.0: 1000.0,
+ },
+ aspiration_flow_rate=250.0,
+ aspiration_mix_flow_rate=250.0,
+ aspiration_air_transport_volume=0.0,
+ aspiration_blow_out_volume=50.0,
+ aspiration_swap_speed=2.0,
+ aspiration_settling_time=1.0,
+ aspiration_over_aspirate_volume=0.0,
+ aspiration_clot_retract_height=0.0,
+ dispense_flow_rate=300.0,
+ dispense_mode=0.0,
+ dispense_mix_flow_rate=250.0,
+ dispense_air_transport_volume=0.0,
+ dispense_blow_out_volume=50.0,
+ dispense_swap_speed=2.0,
+ dispense_settling_time=0.0,
+ dispense_stop_flow_rate=200.0,
+ dispense_stop_back_volume=10.0,
+ )
)
@@ -6217,37 +6217,37 @@ def get_star_liquid_class(
# V1.1: Set mix flow rate to 250
-star_mapping[(1000, False, True, False, Liquid.DMSO, True, False)] = (
- HighVolume_DMSO_DispenseJet
-) = HamiltonLiquidClass(
- curve={
- 5.0: 5.1,
- 500.0: 511.2,
- 250.0: 256.2,
- 50.0: 52.2,
- 0.0: 0.0,
- 20.0: 21.3,
- 100.0: 103.4,
- 10.0: 10.7,
- 1000.0: 1021.0,
- },
- aspiration_flow_rate=250.0,
- aspiration_mix_flow_rate=250.0,
- aspiration_air_transport_volume=5.0,
- aspiration_blow_out_volume=40.0,
- aspiration_swap_speed=2.0,
- aspiration_settling_time=1.0,
- aspiration_over_aspirate_volume=0.0,
- aspiration_clot_retract_height=0.0,
- dispense_flow_rate=400.0,
- dispense_mode=0.0,
- dispense_mix_flow_rate=250.0,
- dispense_air_transport_volume=5.0,
- dispense_blow_out_volume=40.0,
- dispense_swap_speed=2.0,
- dispense_settling_time=0.0,
- dispense_stop_flow_rate=250.0,
- dispense_stop_back_volume=0.0,
+star_mapping[(1000, False, True, False, Liquid.DMSO, True, False)] = HighVolume_DMSO_DispenseJet = (
+ HamiltonLiquidClass(
+ curve={
+ 5.0: 5.1,
+ 500.0: 511.2,
+ 250.0: 256.2,
+ 50.0: 52.2,
+ 0.0: 0.0,
+ 20.0: 21.3,
+ 100.0: 103.4,
+ 10.0: 10.7,
+ 1000.0: 1021.0,
+ },
+ aspiration_flow_rate=250.0,
+ aspiration_mix_flow_rate=250.0,
+ aspiration_air_transport_volume=5.0,
+ aspiration_blow_out_volume=40.0,
+ aspiration_swap_speed=2.0,
+ aspiration_settling_time=1.0,
+ aspiration_over_aspirate_volume=0.0,
+ aspiration_clot_retract_height=0.0,
+ dispense_flow_rate=400.0,
+ dispense_mode=0.0,
+ dispense_mix_flow_rate=250.0,
+ dispense_air_transport_volume=5.0,
+ dispense_blow_out_volume=40.0,
+ dispense_swap_speed=2.0,
+ dispense_settling_time=0.0,
+ dispense_stop_flow_rate=250.0,
+ dispense_stop_back_volume=0.0,
+ )
)
@@ -7422,27 +7422,27 @@ def get_star_liquid_class(
)
-star_mapping[(10, False, False, False, Liquid.WATER, True, False)] = (
- LowNeedle_Water_DispenseJet
-) = HamiltonLiquidClass(
- curve={50.0: 52.7, 30.0: 31.7, 0.0: 0.0, 20.0: 20.5, 10.0: 10.3},
- aspiration_flow_rate=100.0,
- aspiration_mix_flow_rate=100.0,
- aspiration_air_transport_volume=15.0,
- aspiration_blow_out_volume=30.0,
- aspiration_swap_speed=2.0,
- aspiration_settling_time=1.0,
- aspiration_over_aspirate_volume=0.0,
- aspiration_clot_retract_height=0.0,
- dispense_flow_rate=200.0,
- dispense_mode=0.0,
- dispense_mix_flow_rate=100.0,
- dispense_air_transport_volume=15.0,
- dispense_blow_out_volume=30.0,
- dispense_swap_speed=2.0,
- dispense_settling_time=0.0,
- dispense_stop_flow_rate=150.0,
- dispense_stop_back_volume=0.0,
+star_mapping[(10, False, False, False, Liquid.WATER, True, False)] = LowNeedle_Water_DispenseJet = (
+ HamiltonLiquidClass(
+ curve={50.0: 52.7, 30.0: 31.7, 0.0: 0.0, 20.0: 20.5, 10.0: 10.3},
+ aspiration_flow_rate=100.0,
+ aspiration_mix_flow_rate=100.0,
+ aspiration_air_transport_volume=15.0,
+ aspiration_blow_out_volume=30.0,
+ aspiration_swap_speed=2.0,
+ aspiration_settling_time=1.0,
+ aspiration_over_aspirate_volume=0.0,
+ aspiration_clot_retract_height=0.0,
+ dispense_flow_rate=200.0,
+ dispense_mode=0.0,
+ dispense_mix_flow_rate=100.0,
+ dispense_air_transport_volume=15.0,
+ dispense_blow_out_volume=30.0,
+ dispense_swap_speed=2.0,
+ dispense_settling_time=0.0,
+ dispense_stop_flow_rate=150.0,
+ dispense_stop_back_volume=0.0,
+ )
)
@@ -9738,34 +9738,34 @@ def get_star_liquid_class(
)
-star_mapping[(300, True, True, False, Liquid.DMSO, True, True)] = (
- SlimTip_DMSO_DispenseJet_Empty
-) = HamiltonLiquidClass(
- curve={
- 300.0: 309.5,
- 50.0: 54.7,
- 0.0: 0.0,
- 100.0: 107.2,
- 20.0: 22.5,
- 200.0: 209.7,
- },
- aspiration_flow_rate=250.0,
- aspiration_mix_flow_rate=250.0,
- aspiration_air_transport_volume=5.0,
- aspiration_blow_out_volume=10.0,
- aspiration_swap_speed=2.0,
- aspiration_settling_time=1.0,
- aspiration_over_aspirate_volume=0.0,
- aspiration_clot_retract_height=0.0,
- dispense_flow_rate=250.0,
- dispense_mode=3.0,
- dispense_mix_flow_rate=1.0,
- dispense_air_transport_volume=5.0,
- dispense_blow_out_volume=10.0,
- dispense_swap_speed=1.0,
- dispense_settling_time=0.0,
- dispense_stop_flow_rate=100.0,
- dispense_stop_back_volume=0.0,
+star_mapping[(300, True, True, False, Liquid.DMSO, True, True)] = SlimTip_DMSO_DispenseJet_Empty = (
+ HamiltonLiquidClass(
+ curve={
+ 300.0: 309.5,
+ 50.0: 54.7,
+ 0.0: 0.0,
+ 100.0: 107.2,
+ 20.0: 22.5,
+ 200.0: 209.7,
+ },
+ aspiration_flow_rate=250.0,
+ aspiration_mix_flow_rate=250.0,
+ aspiration_air_transport_volume=5.0,
+ aspiration_blow_out_volume=10.0,
+ aspiration_swap_speed=2.0,
+ aspiration_settling_time=1.0,
+ aspiration_over_aspirate_volume=0.0,
+ aspiration_clot_retract_height=0.0,
+ dispense_flow_rate=250.0,
+ dispense_mode=3.0,
+ dispense_mix_flow_rate=1.0,
+ dispense_air_transport_volume=5.0,
+ dispense_blow_out_volume=10.0,
+ dispense_swap_speed=1.0,
+ dispense_settling_time=0.0,
+ dispense_stop_flow_rate=100.0,
+ dispense_stop_back_volume=0.0,
+ )
)
@@ -10587,27 +10587,27 @@ def get_star_liquid_class(
# 20 (12 Aliquots) 2.53 -2.97
# 50 ( 4 Aliquots) 0.84 -2.57
#
-star_mapping[(300, False, True, False, Liquid.DMSO, True, False)] = (
- StandardVolumeDMSOAliquotJet
-) = HamiltonLiquidClass(
- curve={350.0: 350.0, 30.0: 30.0, 0.0: 0.0, 20.0: 20.0, 10.0: 10.0},
- aspiration_flow_rate=100.0,
- aspiration_mix_flow_rate=100.0,
- aspiration_air_transport_volume=0.0,
- aspiration_blow_out_volume=0.0,
- aspiration_swap_speed=2.0,
- aspiration_settling_time=1.0,
- aspiration_over_aspirate_volume=0.0,
- aspiration_clot_retract_height=0.0,
- dispense_flow_rate=250.0,
- dispense_mode=0.0,
- dispense_mix_flow_rate=100.0,
- dispense_air_transport_volume=0.0,
- dispense_blow_out_volume=0.0,
- dispense_swap_speed=0.3,
- dispense_settling_time=0.0,
- dispense_stop_flow_rate=200.0,
- dispense_stop_back_volume=10.0,
+star_mapping[(300, False, True, False, Liquid.DMSO, True, False)] = StandardVolumeDMSOAliquotJet = (
+ HamiltonLiquidClass(
+ curve={350.0: 350.0, 30.0: 30.0, 0.0: 0.0, 20.0: 20.0, 10.0: 10.0},
+ aspiration_flow_rate=100.0,
+ aspiration_mix_flow_rate=100.0,
+ aspiration_air_transport_volume=0.0,
+ aspiration_blow_out_volume=0.0,
+ aspiration_swap_speed=2.0,
+ aspiration_settling_time=1.0,
+ aspiration_over_aspirate_volume=0.0,
+ aspiration_clot_retract_height=0.0,
+ dispense_flow_rate=250.0,
+ dispense_mode=0.0,
+ dispense_mix_flow_rate=100.0,
+ dispense_air_transport_volume=0.0,
+ dispense_blow_out_volume=0.0,
+ dispense_swap_speed=0.3,
+ dispense_settling_time=0.0,
+ dispense_stop_flow_rate=200.0,
+ dispense_stop_back_volume=10.0,
+ )
)
diff --git a/pylabrobot/liquid_handling/liquid_handler.py b/pylabrobot/liquid_handling/liquid_handler.py
index e8b7d7450ef..9e5dc079add 100644
--- a/pylabrobot/liquid_handling/liquid_handler.py
+++ b/pylabrobot/liquid_handling/liquid_handler.py
@@ -441,9 +441,9 @@ async def pick_up_tips(
# checks
self._assert_resources_exist(tip_spots)
self._make_sure_channels_exist(use_channels)
- assert (
- len(tip_spots) == len(offsets) == len(use_channels)
- ), "Number of tips and offsets and use_channels must be equal."
+ assert len(tip_spots) == len(offsets) == len(use_channels), (
+ "Number of tips and offsets and use_channels must be equal."
+ )
# create operations
pickups = [
@@ -570,9 +570,9 @@ async def drop_tips(
# checks
self._assert_resources_exist(tip_spots)
self._make_sure_channels_exist(use_channels)
- assert (
- len(tip_spots) == len(offsets) == len(use_channels) == len(tips)
- ), "Number of channels and offsets and use_channels and tips must be equal."
+ assert len(tip_spots) == len(offsets) == len(use_channels) == len(tips), (
+ "Number of channels and offsets and use_channels and tips must be equal."
+ )
# create operations
drops = [
@@ -1989,9 +1989,9 @@ async def drop_resource(
# get the location of the destination
if isinstance(destination, ResourceStack):
- assert (
- destination.direction == "z"
- ), "Only ResourceStacks with direction 'z' are currently supported"
+ assert destination.direction == "z", (
+ "Only ResourceStacks with direction 'z' are currently supported"
+ )
# the resource can be rotated wrt the ResourceStack. This is allowed as long
# as it's in multiples of 180 degrees. 90 degrees is not allowed.
@@ -2643,7 +2643,7 @@ def key_for_tip_spot(tip_spot: TipSpot) -> Tuple[str, float]:
# 6: Execute tip movement/consolidation
for idx, target_tip_spots in enumerate(merged_target_tip_clusters):
- print(f" - tip transfer cycle: {idx+1} / {len_transfers}")
+ print(f" - tip transfer cycle: {idx + 1} / {len_transfers}")
origin_tip_spots = [all_origin_tip_spots.pop(0) for _ in range(len(target_tip_spots))]
diff --git a/pylabrobot/plate_reading/biotek_backend.py b/pylabrobot/plate_reading/biotek_backend.py
index e6867243e5a..f1d2455d4fe 100644
--- a/pylabrobot/plate_reading/biotek_backend.py
+++ b/pylabrobot/plate_reading/biotek_backend.py
@@ -206,7 +206,7 @@ async def setup(self, use_cam: bool = False) -> None:
if self.cam is None:
raise RuntimeError(
- "No camera found. Make sure the camera is connected and the serial " "number is correct."
+ "No camera found. Make sure the camera is connected and the serial number is correct."
)
# -- Initialize camera --
@@ -229,7 +229,7 @@ async def setup(self, use_cam: bool = False) -> None:
ptr_trigger_selector = PySpin.CEnumerationPtr(nodemap.GetNode("TriggerSelector"))
if not PySpin.IsReadable(ptr_trigger_selector) or not PySpin.IsWritable(ptr_trigger_selector):
raise RuntimeError(
- "unable to configure TriggerSelector " "(can't read or write TriggerSelector)"
+ "unable to configure TriggerSelector (can't read or write TriggerSelector)"
)
ptr_frame_start = PySpin.CEnumEntryPtr(ptr_trigger_selector.GetEntryByName("FrameStart"))
if not PySpin.IsReadable(ptr_frame_start):
@@ -600,13 +600,13 @@ async def set_plate(self, plate: Plate):
cmd = (
f"{rows:02}"
f"{columns:02}"
- f"{int(top_left_well_center_y*100):05}"
- f"{int(bottom_right_well_center_y*100):05}"
- f"{int(top_left_well_center.x*100):05}"
- f"{int(bottom_right_well_center.x*100):05}"
- f"{int(plate_size_y*100):05}"
- f"{int(plate_size_x*100):05}"
- f"{int(plate_size_z*100):04}"
+ f"{int(top_left_well_center_y * 100):05}"
+ f"{int(bottom_right_well_center_y * 100):05}"
+ f"{int(top_left_well_center.x * 100):05}"
+ f"{int(bottom_right_well_center.x * 100):05}"
+ f"{int(plate_size_y * 100):05}"
+ f"{int(plate_size_x * 100):05}"
+ f"{int(plate_size_z * 100):04}"
"\x03"
)
@@ -640,7 +640,7 @@ async def read_luminescence(self, plate: Plate, focal_height: float) -> List[Lis
await self.set_plate(plate)
- cmd = f"3{14220 + int(1000*focal_height)}\x03"
+ cmd = f"3{14220 + int(1000 * focal_height)}\x03"
await self.send_command("t", cmd)
cmd = "008401010108120001200100001100100000123000500200200-001000-00300000000000000000001351092"
@@ -669,7 +669,7 @@ async def read_fluorescence(
await self.set_plate(plate)
- cmd = f"{614220 + int(1000*focal_height)}\x03"
+ cmd = f"{614220 + int(1000 * focal_height)}\x03"
await self.send_command("t", cmd)
excitation_wavelength_str = str(excitation_wavelength).zfill(4)
diff --git a/pylabrobot/plate_reading/clario_star_backend.py b/pylabrobot/plate_reading/clario_star_backend.py
index 85e0727faf6..10a52a4287b 100644
--- a/pylabrobot/plate_reading/clario_star_backend.py
+++ b/pylabrobot/plate_reading/clario_star_backend.py
@@ -110,7 +110,7 @@ async def _wait_for_ready_and_return(self, ret, timeout=150):
if len(command_status) != 24:
logger.warning(
- "unexpected response %s. I think a command status response is always 24 " "bytes",
+ "unexpected response %s. I think a command status response is always 24 bytes",
command_status,
)
continue
@@ -123,7 +123,7 @@ async def _wait_for_ready_and_return(self, ret, timeout=150):
if command_status[2] != 0x18 or command_status[3] != 0x0C or command_status[4] != 0x01:
logger.warning(
- "unexpected response %s. I think 18 0c 01 indicates a command status " "response",
+ "unexpected response %s. I think 18 0c 01 indicates a command status response",
command_status,
)
diff --git a/pylabrobot/plate_reading/imager.py b/pylabrobot/plate_reading/imager.py
index 9928fd0f12b..ad9e48f2701 100644
--- a/pylabrobot/plate_reading/imager.py
+++ b/pylabrobot/plate_reading/imager.py
@@ -52,7 +52,7 @@ def __init__(
def _will_assign_resource(self, resource: Resource):
if len(self.children) >= 1:
raise ValueError(
- f"Imager {self} already has a plate assigned " f"(attempting to assign {resource})"
+ f"Imager {self} already has a plate assigned (attempting to assign {resource})"
)
def get_plate(self) -> Plate:
diff --git a/pylabrobot/pumps/pumparray.py b/pylabrobot/pumps/pumparray.py
index decee204dbf..daedb626a46 100644
--- a/pylabrobot/pumps/pumparray.py
+++ b/pylabrobot/pumps/pumparray.py
@@ -151,7 +151,7 @@ async def pump_volume(
if self.calibration is None:
raise NotCalibratedError(
- "Pump is not calibrated. Volume based pumping and related functions " "unavailable."
+ "Pump is not calibrated. Volume based pumping and related functions unavailable."
)
if isinstance(use_channels, int):
use_channels = [use_channels]
diff --git a/pylabrobot/resources/corning/costar/plates.py b/pylabrobot/resources/corning/costar/plates.py
index 0d3a4f90944..598d79a8c9b 100644
--- a/pylabrobot/resources/corning/costar/plates.py
+++ b/pylabrobot/resources/corning/costar/plates.py
@@ -1,4 +1,4 @@
-""" Corning-Costar plates. """
+"""Corning-Costar plates."""
from typing import Optional
diff --git a/pylabrobot/resources/corning/falcon/plates.py b/pylabrobot/resources/corning/falcon/plates.py
index 0c95baa8676..c16fa12523d 100644
--- a/pylabrobot/resources/corning/falcon/plates.py
+++ b/pylabrobot/resources/corning/falcon/plates.py
@@ -1,4 +1,4 @@
-""" Corning-Falcon Plates"""
+"""Corning-Falcon Plates"""
from typing import Optional
diff --git a/pylabrobot/resources/corning/falcon/tubes.py b/pylabrobot/resources/corning/falcon/tubes.py
index 4e390d6c04d..8929b0d93ff 100644
--- a/pylabrobot/resources/corning/falcon/tubes.py
+++ b/pylabrobot/resources/corning/falcon/tubes.py
@@ -1,4 +1,4 @@
-""" Corning-Falcon Tubes"""
+"""Corning-Falcon Tubes"""
from pylabrobot.resources.tube import Tube
@@ -84,17 +84,17 @@ def Cor_Falcon_tube_14mL_Rb(name: str) -> Tube:
def falcon_tube_50mL(name: str) -> Tube:
raise NotImplementedError(
- "falcon_tube_50mL definition is deprecated. Use " "Cor_Falcon_tube_50mL instead."
+ "falcon_tube_50mL definition is deprecated. Use Cor_Falcon_tube_50mL instead."
)
def falcon_tube_15mL(name: str) -> Tube:
raise NotImplementedError(
- "falcon_tube_15mL definition is deprecated. Use " "Cor_Falcon_tube_15mL_Vb instead."
+ "falcon_tube_15mL definition is deprecated. Use Cor_Falcon_tube_15mL_Vb instead."
)
def Falcon_tube_14mL_Rb(name: str) -> Tube:
raise NotImplementedError(
- "Falcon_tube_14mL_Rb definition is deprecated. Use " "Cor_Falcon_tube_14mL_Rb instead."
+ "Falcon_tube_14mL_Rb definition is deprecated. Use Cor_Falcon_tube_14mL_Rb instead."
)
diff --git a/pylabrobot/resources/corning/plates.py b/pylabrobot/resources/corning/plates.py
index 7b2d5e802aa..5b0dd7d6e36 100644
--- a/pylabrobot/resources/corning/plates.py
+++ b/pylabrobot/resources/corning/plates.py
@@ -1,4 +1,4 @@
-""" Corning plates. """
+"""Corning plates."""
from pylabrobot.resources.height_volume_functions import (
calculate_liquid_height_in_container_2segments_square_vbottom,
diff --git a/pylabrobot/resources/hamilton/hamilton_decks.py b/pylabrobot/resources/hamilton/hamilton_decks.py
index aa68aa04858..b875f91bc32 100644
--- a/pylabrobot/resources/hamilton/hamilton_decks.py
+++ b/pylabrobot/resources/hamilton/hamilton_decks.py
@@ -88,15 +88,14 @@ def check_z_height(resource: Resource):
if z_top > Z_MOVEMENT_LIMIT:
logger.warning(
- "Resource '%s' is very high on the deck: %s mm. Be careful when " "traversing the deck.",
+ "Resource '%s' is very high on the deck: %s mm. Be careful when traversing the deck.",
resource.name,
z_top,
)
if z_top > Z_GRAB_LIMIT:
logger.warning(
- "Resource '%s' is very high on the deck: %s mm. Be careful when "
- "grabbing this resource.",
+ "Resource '%s' is very high on the deck: %s mm. Be careful when grabbing this resource.",
resource.name,
z_top,
)
@@ -201,8 +200,7 @@ def assign_child_resource(
]
):
raise ValueError(
- f"Location {resource_location} is already occupied by resource "
- f"'{og_resource.name}'."
+ f"Location {resource_location} is already occupied by resource '{og_resource.name}'."
)
return super().assign_child_resource(resource, location=resource_location, reassign=reassign)
diff --git a/pylabrobot/resources/itemized_resource.py b/pylabrobot/resources/itemized_resource.py
index 37501ae944e..5711b369b5f 100644
--- a/pylabrobot/resources/itemized_resource.py
+++ b/pylabrobot/resources/itemized_resource.py
@@ -194,12 +194,12 @@ def get_item(self, identifier: Union[str, int, Tuple[int, int]]) -> T:
identifier = list(self._ordering.keys()).index(identifier)
except ValueError as e:
raise IndexError(
- f"Item with identifier '{identifier}' does not exist on " f"resource '{self.name}'."
+ f"Item with identifier '{identifier}' does not exist on resource '{self.name}'."
) from e
if not 0 <= identifier < self.num_items:
raise IndexError(
- f"Item with identifier '{identifier}' does not exist on " f"resource '{self.name}'."
+ f"Item with identifier '{identifier}' does not exist on resource '{self.name}'."
)
# Cast child to item type. Children will always be `T`, but the type checker doesn't know that.
@@ -392,7 +392,7 @@ def summary(self, occupied_func=None):
# Create the header row with numbers aligned to the columns.
# Use right-alignment specifier.
- header_row = " " + " ".join(f"{i+1:<{max_digits}}" for i in range(self.num_items_x))
+ header_row = " " + " ".join(f"{i + 1:<{max_digits}}" for i in range(self.num_items_x))
# Create the item grid with resource absence/presence information.
item_grid = [
diff --git a/pylabrobot/resources/tecan/tecan_decks.py b/pylabrobot/resources/tecan/tecan_decks.py
index 656314bba89..453273e372b 100644
--- a/pylabrobot/resources/tecan/tecan_decks.py
+++ b/pylabrobot/resources/tecan/tecan_decks.py
@@ -100,7 +100,7 @@ def assign_child_resource(
and rails is not None
):
raise ValueError(
- f"Resource with width {resource.get_absolute_size_x()} does not " f"fit at rails {rails}."
+ f"Resource with width {resource.get_absolute_size_x()} does not fit at rails {rails}."
)
# Check if there is space for this new resource.
@@ -122,8 +122,7 @@ def assign_child_resource(
< og_y + og_resource.get_absolute_size_y()
):
raise ValueError(
- f"Location {resource_location} is already occupied by resource "
- f"'{og_resource.name}'."
+ f"Location {resource_location} is already occupied by resource '{og_resource.name}'."
)
return super().assign_child_resource(resource, location=resource_location)
diff --git a/pylabrobot/resources/utils.py b/pylabrobot/resources/utils.py
index 5cb8859ba64..363bd8557b9 100644
--- a/pylabrobot/resources/utils.py
+++ b/pylabrobot/resources/utils.py
@@ -175,7 +175,7 @@ def create_ordered_items_2d(
item_dy=item_dy,
**kwargs,
)
- keys = [f"{LETTERS[j]}{i+1}" for i in range(num_items_x) for j in range(num_items_y)]
+ keys = [f"{LETTERS[j]}{i + 1}" for i in range(num_items_x) for j in range(num_items_y)]
return dict(zip(keys, [item for sublist in items for item in sublist]))
diff --git a/pylabrobot/resources/volume_tracker.py b/pylabrobot/resources/volume_tracker.py
index 75a9ad6bf8b..0ca9491506e 100644
--- a/pylabrobot/resources/volume_tracker.py
+++ b/pylabrobot/resources/volume_tracker.py
@@ -40,9 +40,9 @@ def no_volume_tracking():
def set_cross_contamination_tracking(enabled: bool):
if enabled:
- assert (
- this.volume_tracking_enabled
- ), "Cross contamination tracking only possible if volume tracking active."
+ assert this.volume_tracking_enabled, (
+ "Cross contamination tracking only possible if volume tracking active."
+ )
this.cross_contamination_tracking_enabled = enabled # type: ignore
diff --git a/pylabrobot/scales/scale_backend.py b/pylabrobot/scales/scale_backend.py
index ce18cadcbb0..ba9c7ce2cd5 100644
--- a/pylabrobot/scales/scale_backend.py
+++ b/pylabrobot/scales/scale_backend.py
@@ -7,13 +7,11 @@ class ScaleBackend(MachineBackend, metaclass=ABCMeta):
"""Backend for a scale"""
@abstractmethod
- async def tare(self):
- ...
+ async def tare(self): ...
@abstractmethod
async def get_weight(self) -> float:
"""Get the weight in grams"""
@abstractmethod
- async def zero(self):
- ...
+ async def zero(self): ...
diff --git a/pylabrobot/sealing/backend.py b/pylabrobot/sealing/backend.py
index b1b79da6e1c..0e9e8c01b45 100644
--- a/pylabrobot/sealing/backend.py
+++ b/pylabrobot/sealing/backend.py
@@ -7,16 +7,13 @@ class SealerBackend(MachineBackend, metaclass=ABCMeta):
"""Backend for a sealer machine"""
@abstractmethod
- async def seal(self, temperature: int, duration: float):
- ...
+ async def seal(self, temperature: int, duration: float): ...
@abstractmethod
- async def open(self):
- ...
+ async def open(self): ...
@abstractmethod
- async def close(self):
- ...
+ async def close(self): ...
@abstractmethod
async def set_temperature(self, temperature: float):
diff --git a/pylabrobot/storage/cytomat/cytomat.py b/pylabrobot/storage/cytomat/cytomat.py
index f9a378f89e4..d8386f3d40d 100644
--- a/pylabrobot/storage/cytomat/cytomat.py
+++ b/pylabrobot/storage/cytomat/cytomat.py
@@ -368,7 +368,7 @@ async def set_shaking_frequency(
) -> List[str]:
shakers = shakers or [1, 2]
assert all(shaker in [1, 2] for shaker in shakers), "Shaker index must be 1 or 2"
- return [await self.send_command("se", f"pb 2{idx-1}", f"{frequency:04}") for idx in shakers]
+ return [await self.send_command("se", f"pb 2{idx - 1}", f"{frequency:04}") for idx in shakers]
async def get_incubation_query(
self, query: Literal["ic", "ih", "io", "it"]
diff --git a/pylabrobot/tilting/tilter.py b/pylabrobot/tilting/tilter.py
index e8293a0ad34..c833181186e 100644
--- a/pylabrobot/tilting/tilter.py
+++ b/pylabrobot/tilting/tilter.py
@@ -146,17 +146,17 @@ def experimental_get_well_drain_offsets(
well_drain_offsets = []
for well in wells:
- assert (
- well.cross_section_type == CrossSectionType.CIRCLE
- ), "Wells must have circular cross-section"
+ assert well.cross_section_type == CrossSectionType.CIRCLE, (
+ "Wells must have circular cross-section"
+ )
diameter = well.get_absolute_size_x() # assuming circular well
radius = diameter / 2
if n_tips > 1:
- assert (
- (n_tips - 1) * min_tip_distance <= diameter
- ), f"Cannot fit {n_tips} tips in a well with diameter {diameter} mm"
+ assert (n_tips - 1) * min_tip_distance <= diameter, (
+ f"Cannot fit {n_tips} tips in a well with diameter {diameter} mm"
+ )
y_offsets = [
((n_tips - 1) / 2 - tip_index) * min_tip_distance for tip_index in range(n_tips)
diff --git a/pylabrobot/visualizer/visualizer.py b/pylabrobot/visualizer/visualizer.py
index 73732582a2f..46147795c3e 100644
--- a/pylabrobot/visualizer/visualizer.py
+++ b/pylabrobot/visualizer/visualizer.py
@@ -319,7 +319,7 @@ def _run_file_server(self):
path = os.path.join(dirname, ".")
if not os.path.exists(path):
raise RuntimeError(
- "Could not find Visualizer files. Please run from the root of the " "repository."
+ "Could not find Visualizer files. Please run from the root of the repository."
)
def start_server(lock):
From d61bcb909b294c81da9842c189623218f237a35a Mon Sep 17 00:00:00 2001
From: AFg6K7h4fhy2 <127630341+AFg6K7h4fhy2@users.noreply.github.com>
Date: Mon, 18 Aug 2025 00:35:35 -0400
Subject: [PATCH 05/13] Revert "format files using ruff"
This reverts commit e704b89112c2f415fbdba628b9e53449dfff3b3d.
---
.../heating_shaking/hamilton_backend.py | 2 +-
pylabrobot/io/usb.py | 8 +-
.../backends/chatterbox_backend.py | 2 +-
.../backends/hamilton/STAR_backend.py | 781 +++++++++---------
.../backends/hamilton/STAR_tests.py | 2 +-
.../backends/hamilton/vantage_backend.py | 29 +-
.../backends/tecan/EVO_backend.py | 22 +-
.../liquid_classes/hamilton/star.py | 386 ++++-----
pylabrobot/liquid_handling/liquid_handler.py | 20 +-
pylabrobot/plate_reading/biotek_backend.py | 22 +-
.../plate_reading/clario_star_backend.py | 4 +-
pylabrobot/plate_reading/imager.py | 2 +-
pylabrobot/pumps/pumparray.py | 2 +-
pylabrobot/resources/corning/costar/plates.py | 2 +-
pylabrobot/resources/corning/falcon/plates.py | 2 +-
pylabrobot/resources/corning/falcon/tubes.py | 8 +-
pylabrobot/resources/corning/plates.py | 2 +-
.../resources/hamilton/hamilton_decks.py | 8 +-
pylabrobot/resources/itemized_resource.py | 6 +-
pylabrobot/resources/tecan/tecan_decks.py | 5 +-
pylabrobot/resources/utils.py | 2 +-
pylabrobot/resources/volume_tracker.py | 6 +-
pylabrobot/scales/scale_backend.py | 6 +-
pylabrobot/sealing/backend.py | 9 +-
pylabrobot/storage/cytomat/cytomat.py | 2 +-
pylabrobot/tilting/tilter.py | 12 +-
pylabrobot/visualizer/visualizer.py | 2 +-
27 files changed, 683 insertions(+), 671 deletions(-)
diff --git a/pylabrobot/heating_shaking/hamilton_backend.py b/pylabrobot/heating_shaking/hamilton_backend.py
index 04df5bbcf54..ef4abc27833 100644
--- a/pylabrobot/heating_shaking/hamilton_backend.py
+++ b/pylabrobot/heating_shaking/hamilton_backend.py
@@ -169,7 +169,7 @@ async def _wait_for_stop(self):
async def set_temperature(self, temperature: float):
"""set temperature in Celsius"""
assert 0 < temperature <= 105
- temp_str = f"{round(10 * temperature):04d}"
+ temp_str = f"{round(10*temperature):04d}"
return await self.interface.send_hhs_command(index=self.index, command="TA", ta=temp_str)
async def _get_current_temperature(self) -> Dict[str, float]:
diff --git a/pylabrobot/io/usb.py b/pylabrobot/io/usb.py
index 3f02e301aae..679ab12bb39 100644
--- a/pylabrobot/io/usb.py
+++ b/pylabrobot/io/usb.py
@@ -70,9 +70,9 @@ def __init__(
if get_capture_or_validation_active():
raise RuntimeError("Cannot create a new USB object while capture or validation is active")
- assert packet_read_timeout < read_timeout, (
- "packet_read_timeout must be smaller than read_timeout."
- )
+ assert (
+ packet_read_timeout < read_timeout
+ ), "packet_read_timeout must be smaller than read_timeout."
self._id_vendor = id_vendor
self._id_product = id_product
@@ -215,7 +215,7 @@ def get_available_devices(self) -> List["usb.core.Device"]:
if self._serial_number is not None:
if dev._serial_number is None:
raise RuntimeError(
- "A serial number was specified, but the device does not have a serial number."
+ "A serial number was specified, but the device does not have a serial " "number."
)
if dev.serial_number != self._serial_number:
diff --git a/pylabrobot/liquid_handling/backends/chatterbox_backend.py b/pylabrobot/liquid_handling/backends/chatterbox_backend.py
index 708ff3e54f1..31863c8b2ca 100644
--- a/pylabrobot/liquid_handling/backends/chatterbox_backend.py
+++ b/pylabrobot/liquid_handling/backends/chatterbox_backend.py
@@ -1,5 +1,5 @@
class ChatterBoxBackend:
def __init__(self, num_channels: int = 8):
raise NotImplementedError(
- "ChatterBoxBackend is deprecated. Use LiquidHandlerChatterboxBackend instead."
+ "ChatterBoxBackend is deprecated. " "Use LiquidHandlerChatterboxBackend instead."
)
diff --git a/pylabrobot/liquid_handling/backends/hamilton/STAR_backend.py b/pylabrobot/liquid_handling/backends/hamilton/STAR_backend.py
index 0658b82facd..d033ea3dde1 100644
--- a/pylabrobot/liquid_handling/backends/hamilton/STAR_backend.py
+++ b/pylabrobot/liquid_handling/backends/hamilton/STAR_backend.py
@@ -880,7 +880,8 @@ def trace_information_to_string(module_identifier: str, trace_information: int)
35: "Voltages outside permitted range",
36: "Stop during execution of command",
37: "Stop during execution of command",
- 40: "No parallel processes permitted (Two or more commands sent for the same controlprocess)",
+ 40: "No parallel processes permitted (Two or more commands sent for the same control"
+ "process)",
50: "Dispensing drive init. position not found",
51: "Dispensing drive not initialized",
52: "Dispensing drive movement error",
@@ -3221,7 +3222,7 @@ async def core_check_resource_exists_at_location_center(
elif user_prompt == "abort":
raise ValueError(
f"Resource '{resource.name}' not found at center"
- f" location {(center.x, center.y, center.z)}"
+ f" location {(center.x,center.y,center.z)}"
" & error not resolved -> aborted resource movement."
)
else:
@@ -3649,44 +3650,44 @@ async def set_instrument_configuration(
and 9999. Default 60.
"""
- assert 1 <= instrument_size_in_slots_x_range <= 9, (
- "instrument_size_in_slots_x_range must be between 1 and 99"
- )
+ assert (
+ 1 <= instrument_size_in_slots_x_range <= 9
+ ), "instrument_size_in_slots_x_range must be between 1 and 99"
assert 1 <= auto_load_size_in_slots <= 54, "auto_load_size_in_slots must be between 1 and 54"
assert 1000 <= tip_waste_x_position <= 25000, "tip_waste_x_position must be between 1 and 25000"
- assert 0 <= right_x_drive_configuration_byte_1 <= 1, (
- "right_x_drive_configuration_byte_1 must be between 0 and 1"
- )
- assert 0 <= right_x_drive_configuration_byte_2 <= 1, (
- "right_x_drive_configuration_byte_2 must be between 0 and must1"
- )
- assert 0 <= minimal_iswap_collision_free_position <= 30000, (
- "minimal_iswap_collision_free_position must be between 0 and 30000"
- )
- assert 0 <= maximal_iswap_collision_free_position <= 30000, (
- "maximal_iswap_collision_free_position must be between 0 and 30000"
- )
+ assert (
+ 0 <= right_x_drive_configuration_byte_1 <= 1
+ ), "right_x_drive_configuration_byte_1 must be between 0 and 1"
+ assert (
+ 0 <= right_x_drive_configuration_byte_2 <= 1
+ ), "right_x_drive_configuration_byte_2 must be between 0 and must1"
+ assert (
+ 0 <= minimal_iswap_collision_free_position <= 30000
+ ), "minimal_iswap_collision_free_position must be between 0 and 30000"
+ assert (
+ 0 <= maximal_iswap_collision_free_position <= 30000
+ ), "maximal_iswap_collision_free_position must be between 0 and 30000"
assert 0 <= left_x_arm_width <= 9999, "left_x_arm_width must be between 0 and 9999"
assert 0 <= right_x_arm_width <= 9999, "right_x_arm_width must be between 0 and 9999"
assert 0 <= num_pip_channels <= 16, "num_pip_channels must be between 0 and 16"
assert 0 <= num_xl_channels <= 8, "num_xl_channels must be between 0 and 8"
assert 0 <= num_robotic_channels <= 8, "num_robotic_channels must be between 0 and 8"
- assert 0 <= minimal_raster_pitch_of_pip_channels <= 999, (
- "minimal_raster_pitch_of_pip_channels must be between 0 and 999"
- )
- assert 0 <= minimal_raster_pitch_of_xl_channels <= 999, (
- "minimal_raster_pitch_of_xl_channels must be between 0 and 999"
- )
- assert 0 <= minimal_raster_pitch_of_robotic_channels <= 999, (
- "minimal_raster_pitch_of_robotic_channels must be between 0 and 999"
- )
+ assert (
+ 0 <= minimal_raster_pitch_of_pip_channels <= 999
+ ), "minimal_raster_pitch_of_pip_channels must be between 0 and 999"
+ assert (
+ 0 <= minimal_raster_pitch_of_xl_channels <= 999
+ ), "minimal_raster_pitch_of_xl_channels must be between 0 and 999"
+ assert (
+ 0 <= minimal_raster_pitch_of_robotic_channels <= 999
+ ), "minimal_raster_pitch_of_robotic_channels must be between 0 and 999"
assert 0 <= pip_maximal_y_position <= 9999, "pip_maximal_y_position must be between 0 and 9999"
- assert 0 <= left_arm_minimal_y_position <= 9999, (
- "left_arm_minimal_y_position must be between 0 and 9999"
- )
- assert 0 <= right_arm_minimal_y_position <= 9999, (
- "right_arm_minimal_y_position must be between 0 and 9999"
- )
+ assert (
+ 0 <= left_arm_minimal_y_position <= 9999
+ ), "left_arm_minimal_y_position must be between 0 and 9999"
+ assert (
+ 0 <= right_arm_minimal_y_position <= 9999
+ ), "right_arm_minimal_y_position must be between 0 and 9999"
return await self.send_command(
module="C0",
@@ -3937,17 +3938,17 @@ async def occupy_and_provide_area_for_external_access(
1) all arms left. 2) all arms right.
"""
- assert 0 <= taken_area_identification_number <= 9999, (
- "taken_area_identification_number must be between 0 and 9999"
- )
+ assert (
+ 0 <= taken_area_identification_number <= 9999
+ ), "taken_area_identification_number must be between 0 and 9999"
assert 0 <= taken_area_left_margin <= 99, "taken_area_left_margin must be between 0 and 99"
- assert 0 <= taken_area_left_margin_direction <= 1, (
- "taken_area_left_margin_direction must be between 0 and 1"
- )
+ assert (
+ 0 <= taken_area_left_margin_direction <= 1
+ ), "taken_area_left_margin_direction must be between 0 and 1"
assert 0 <= taken_area_size <= 50000, "taken_area_size must be between 0 and 50000"
- assert 0 <= arm_preposition_mode_related_to_taken_areas <= 2, (
- "arm_preposition_mode_related_to_taken_areas must be between 0 and 2"
- )
+ assert (
+ 0 <= arm_preposition_mode_related_to_taken_areas <= 2
+ ), "arm_preposition_mode_related_to_taken_areas must be between 0 and 2"
return await self.send_command(
module="C0",
@@ -3967,9 +3968,9 @@ async def release_occupied_area(self, taken_area_identification_number: int = 0)
Must be between 0 and 9999. Default 0.
"""
- assert 0 <= taken_area_identification_number <= 999, (
- "taken_area_identification_number must be between 0 and 9999"
- )
+ assert (
+ 0 <= taken_area_identification_number <= 999
+ ), "taken_area_identification_number must be between 0 and 9999"
return await self.send_command(
module="C0",
@@ -4063,15 +4064,15 @@ async def initialize_pipetting_channels(
assert all(0 <= xp <= 25000 for xp in x_positions), "x_positions must be between 0 and 25000"
assert all(0 <= yp <= 6500 for yp in y_positions), "y_positions must be between 0 and 6500"
- assert 0 <= begin_of_tip_deposit_process <= 3600, (
- "begin_of_tip_deposit_process must be between 0 and 3600"
- )
- assert 0 <= end_of_tip_deposit_process <= 3600, (
- "end_of_tip_deposit_process must be between 0 and 3600"
- )
- assert 0 <= z_position_at_end_of_a_command <= 3600, (
- "z_position_at_end_of_a_command must be between 0 and 3600"
- )
+ assert (
+ 0 <= begin_of_tip_deposit_process <= 3600
+ ), "begin_of_tip_deposit_process must be between 0 and 3600"
+ assert (
+ 0 <= end_of_tip_deposit_process <= 3600
+ ), "end_of_tip_deposit_process must be between 0 and 3600"
+ assert (
+ 0 <= z_position_at_end_of_a_command <= 3600
+ ), "z_position_at_end_of_a_command must be between 0 and 3600"
assert 0 <= tip_type <= 99, "tip must be between 0 and 99"
assert 0 <= discarding_method <= 1, "discarding_method must be between 0 and 1"
@@ -4122,15 +4123,15 @@ async def pick_up_tip(
assert all(0 <= xp <= 25000 for xp in x_positions), "x_positions must be between 0 and 25000"
assert all(0 <= yp <= 6500 for yp in y_positions), "y_positions must be between 0 and 6500"
- assert 0 <= begin_tip_pick_up_process <= 3600, (
- "begin_tip_pick_up_process must be between 0 and 3600"
- )
- assert 0 <= end_tip_pick_up_process <= 3600, (
- "end_tip_pick_up_process must be between 0 and 3600"
- )
- assert 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600, (
- "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
- )
+ assert (
+ 0 <= begin_tip_pick_up_process <= 3600
+ ), "begin_tip_pick_up_process must be between 0 and 3600"
+ assert (
+ 0 <= end_tip_pick_up_process <= 3600
+ ), "end_tip_pick_up_process must be between 0 and 3600"
+ assert (
+ 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600
+ ), "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
return await self.send_command(
module="C0",
@@ -4184,18 +4185,18 @@ async def discard_tip(
assert all(0 <= xp <= 25000 for xp in x_positions), "x_positions must be between 0 and 25000"
assert all(0 <= yp <= 6500 for yp in y_positions), "y_positions must be between 0 and 6500"
- assert 0 <= begin_tip_deposit_process <= 3600, (
- "begin_tip_deposit_process must be between 0 and 3600"
- )
- assert 0 <= end_tip_deposit_process <= 3600, (
- "end_tip_deposit_process must be between 0 and 3600"
- )
- assert 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600, (
- "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
- )
- assert 0 <= z_position_at_end_of_a_command <= 3600, (
- "z_position_at_end_of_a_command must be between 0 and 3600"
- )
+ assert (
+ 0 <= begin_tip_deposit_process <= 3600
+ ), "begin_tip_deposit_process must be between 0 and 3600"
+ assert (
+ 0 <= end_tip_deposit_process <= 3600
+ ), "end_tip_deposit_process must be between 0 and 3600"
+ assert (
+ 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600
+ ), "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
+ assert (
+ 0 <= z_position_at_end_of_a_command <= 3600
+ ), "z_position_at_end_of_a_command must be between 0 and 3600"
return await self.send_command(
module="C0",
@@ -4357,100 +4358,100 @@ async def aspirate_pip(
assert all(0 <= x <= 2 for x in aspiration_type), "aspiration_type must be between 0 and 2"
assert all(0 <= xp <= 25000 for xp in x_positions), "x_positions must be between 0 and 25000"
assert all(0 <= yp <= 6500 for yp in y_positions), "y_positions must be between 0 and 6500"
- assert 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600, (
- "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
- )
+ assert (
+ 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600
+ ), "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
assert 0 <= min_z_endpos <= 3600, "min_z_endpos must be between 0 and 3600"
- assert all(0 <= x <= 3600 for x in lld_search_height), (
- "lld_search_height must be between 0 and 3600"
- )
- assert all(0 <= x <= 500 for x in clot_detection_height), (
- "clot_detection_height must be between 0 and 500"
- )
- assert all(0 <= x <= 3600 for x in liquid_surface_no_lld), (
- "liquid_surface_no_lld must be between 0 and 3600"
- )
- assert all(0 <= x <= 3600 for x in pull_out_distance_transport_air), (
- "pull_out_distance_transport_air must be between 0 and 3600"
- )
- assert all(0 <= x <= 3600 for x in second_section_height), (
- "second_section_height must be between 0 and 3600"
- )
- assert all(0 <= x <= 10000 for x in second_section_ratio), (
- "second_section_ratio must be between 0 and 10000"
- )
+ assert all(
+ 0 <= x <= 3600 for x in lld_search_height
+ ), "lld_search_height must be between 0 and 3600"
+ assert all(
+ 0 <= x <= 500 for x in clot_detection_height
+ ), "clot_detection_height must be between 0 and 500"
+ assert all(
+ 0 <= x <= 3600 for x in liquid_surface_no_lld
+ ), "liquid_surface_no_lld must be between 0 and 3600"
+ assert all(
+ 0 <= x <= 3600 for x in pull_out_distance_transport_air
+ ), "pull_out_distance_transport_air must be between 0 and 3600"
+ assert all(
+ 0 <= x <= 3600 for x in second_section_height
+ ), "second_section_height must be between 0 and 3600"
+ assert all(
+ 0 <= x <= 10000 for x in second_section_ratio
+ ), "second_section_ratio must be between 0 and 10000"
assert all(0 <= x <= 3600 for x in minimum_height), "minimum_height must be between 0 and 3600"
- assert all(0 <= x <= 3600 for x in immersion_depth), (
- "immersion_depth must be between 0 and 3600"
- )
- assert all(0 <= x <= 1 for x in immersion_depth_direction), (
- "immersion_depth_direction must be between 0 and 1"
- )
- assert all(0 <= x <= 3600 for x in surface_following_distance), (
- "surface_following_distance must be between 0 and 3600"
- )
- assert all(0 <= x <= 12500 for x in aspiration_volumes), (
- "aspiration_volumes must be between 0 and 12500"
- )
- assert all(4 <= x <= 5000 for x in aspiration_speed), (
- "aspiration_speed must be between 4 and 5000"
- )
- assert all(0 <= x <= 500 for x in transport_air_volume), (
- "transport_air_volume must be between 0 and 500"
- )
- assert all(0 <= x <= 9999 for x in blow_out_air_volume), (
- "blow_out_air_volume must be between 0 and 9999"
- )
- assert all(0 <= x <= 999 for x in pre_wetting_volume), (
- "pre_wetting_volume must be between 0 and 999"
- )
+ assert all(
+ 0 <= x <= 3600 for x in immersion_depth
+ ), "immersion_depth must be between 0 and 3600"
+ assert all(
+ 0 <= x <= 1 for x in immersion_depth_direction
+ ), "immersion_depth_direction must be between 0 and 1"
+ assert all(
+ 0 <= x <= 3600 for x in surface_following_distance
+ ), "surface_following_distance must be between 0 and 3600"
+ assert all(
+ 0 <= x <= 12500 for x in aspiration_volumes
+ ), "aspiration_volumes must be between 0 and 12500"
+ assert all(
+ 4 <= x <= 5000 for x in aspiration_speed
+ ), "aspiration_speed must be between 4 and 5000"
+ assert all(
+ 0 <= x <= 500 for x in transport_air_volume
+ ), "transport_air_volume must be between 0 and 500"
+ assert all(
+ 0 <= x <= 9999 for x in blow_out_air_volume
+ ), "blow_out_air_volume must be between 0 and 9999"
+ assert all(
+ 0 <= x <= 999 for x in pre_wetting_volume
+ ), "pre_wetting_volume must be between 0 and 999"
assert all(0 <= x <= 4 for x in lld_mode), "lld_mode must be between 0 and 4"
- assert all(1 <= x <= 4 for x in gamma_lld_sensitivity), (
- "gamma_lld_sensitivity must be between 1 and 4"
- )
- assert all(1 <= x <= 4 for x in dp_lld_sensitivity), (
- "dp_lld_sensitivity must be between 1 and 4"
- )
- assert all(0 <= x <= 100 for x in aspirate_position_above_z_touch_off), (
- "aspirate_position_above_z_touch_off must be between 0 and 100"
- )
- assert all(0 <= x <= 99 for x in detection_height_difference_for_dual_lld), (
- "detection_height_difference_for_dual_lld must be between 0 and 99"
- )
+ assert all(
+ 1 <= x <= 4 for x in gamma_lld_sensitivity
+ ), "gamma_lld_sensitivity must be between 1 and 4"
+ assert all(
+ 1 <= x <= 4 for x in dp_lld_sensitivity
+ ), "dp_lld_sensitivity must be between 1 and 4"
+ assert all(
+ 0 <= x <= 100 for x in aspirate_position_above_z_touch_off
+ ), "aspirate_position_above_z_touch_off must be between 0 and 100"
+ assert all(
+ 0 <= x <= 99 for x in detection_height_difference_for_dual_lld
+ ), "detection_height_difference_for_dual_lld must be between 0 and 99"
assert all(3 <= x <= 1600 for x in swap_speed), "swap_speed must be between 3 and 1600"
assert all(0 <= x <= 99 for x in settling_time), "settling_time must be between 0 and 99"
assert all(0 <= x <= 12500 for x in mix_volume), "mix_volume must be between 0 and 12500"
assert all(0 <= x <= 99 for x in mix_cycles), "mix_cycles must be between 0 and 99"
- assert all(0 <= x <= 900 for x in mix_position_from_liquid_surface), (
- "mix_position_from_liquid_surface must be between 0 and 900"
- )
+ assert all(
+ 0 <= x <= 900 for x in mix_position_from_liquid_surface
+ ), "mix_position_from_liquid_surface must be between 0 and 900"
assert all(4 <= x <= 5000 for x in mix_speed), "mix_speed must be between 4 and 5000"
- assert all(0 <= x <= 3600 for x in mix_surface_following_distance), (
- "mix_surface_following_distance must be between 0 and 3600"
- )
- assert all(0 <= x <= 999 for x in limit_curve_index), (
- "limit_curve_index must be between 0 and 999"
- )
+ assert all(
+ 0 <= x <= 3600 for x in mix_surface_following_distance
+ ), "mix_surface_following_distance must be between 0 and 3600"
+ assert all(
+ 0 <= x <= 999 for x in limit_curve_index
+ ), "limit_curve_index must be between 0 and 999"
assert 0 <= recording_mode <= 2, "recording_mode must be between 0 and 2"
- assert all(0 <= x <= 3600 for x in retract_height_over_2nd_section_to_empty_tip), (
- "retract_height_over_2nd_section_to_empty_tip must be between 0 and 3600"
- )
- assert all(4 <= x <= 5000 for x in dispensation_speed_during_emptying_tip), (
- "dispensation_speed_during_emptying_tip must be between 4 and 5000"
- )
- assert all(4 <= x <= 5000 for x in dosing_drive_speed_during_2nd_section_search), (
- "dosing_drive_speed_during_2nd_section_search must be between 4 and 5000"
- )
- assert all(3 <= x <= 1600 for x in z_drive_speed_during_2nd_section_search), (
- "z_drive_speed_during_2nd_section_search must be between 3 and 1600"
- )
+ assert all(
+ 0 <= x <= 3600 for x in retract_height_over_2nd_section_to_empty_tip
+ ), "retract_height_over_2nd_section_to_empty_tip must be between 0 and 3600"
+ assert all(
+ 4 <= x <= 5000 for x in dispensation_speed_during_emptying_tip
+ ), "dispensation_speed_during_emptying_tip must be between 4 and 5000"
+ assert all(
+ 4 <= x <= 5000 for x in dosing_drive_speed_during_2nd_section_search
+ ), "dosing_drive_speed_during_2nd_section_search must be between 4 and 5000"
+ assert all(
+ 3 <= x <= 1600 for x in z_drive_speed_during_2nd_section_search
+ ), "z_drive_speed_during_2nd_section_search must be between 3 and 1600"
assert all(0 <= x <= 3600 for x in cup_upper_edge), "cup_upper_edge must be between 0 and 3600"
- assert all(0 <= x <= 5000 for x in ratio_liquid_rise_to_tip_deep_in), (
- "ratio_liquid_rise_to_tip_deep_in must be between 0 and 50000"
- )
- assert all(0 <= x <= 3600 for x in immersion_depth_2nd_section), (
- "immersion_depth_2nd_section must be between 0 and 3600"
- )
+ assert all(
+ 0 <= x <= 5000 for x in ratio_liquid_rise_to_tip_deep_in
+ ), "ratio_liquid_rise_to_tip_deep_in must be between 0 and 50000"
+ assert all(
+ 0 <= x <= 3600 for x in immersion_depth_2nd_section
+ ), "immersion_depth_2nd_section must be between 0 and 3600"
return await self.send_command(
module="C0",
@@ -4617,73 +4618,73 @@ async def dispense_pip(
assert all(0 <= xp <= 25000 for xp in x_positions), "x_positions must be between 0 and 25000"
assert all(0 <= yp <= 6500 for yp in y_positions), "y_positions must be between 0 and 6500"
assert any(0 <= x <= 3600 for x in minimum_height), "minimum_height must be between 0 and 3600"
- assert any(0 <= x <= 3600 for x in lld_search_height), (
- "lld_search_height must be between 0 and 3600"
- )
- assert any(0 <= x <= 3600 for x in liquid_surface_no_lld), (
- "liquid_surface_no_lld must be between 0 and 3600"
- )
- assert any(0 <= x <= 3600 for x in pull_out_distance_transport_air), (
- "pull_out_distance_transport_air must be between 0 and 3600"
- )
- assert any(0 <= x <= 3600 for x in immersion_depth), (
- "immersion_depth must be between 0 and 3600"
- )
- assert any(0 <= x <= 1 for x in immersion_depth_direction), (
- "immersion_depth_direction must be between 0 and 1"
- )
- assert any(0 <= x <= 3600 for x in surface_following_distance), (
- "surface_following_distance must be between 0 and 3600"
- )
- assert any(0 <= x <= 3600 for x in second_section_height), (
- "second_section_height must be between 0 and 3600"
- )
- assert any(0 <= x <= 10000 for x in second_section_ratio), (
- "second_section_ratio must be between 0 and 10000"
- )
- assert 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600, (
- "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
- )
+ assert any(
+ 0 <= x <= 3600 for x in lld_search_height
+ ), "lld_search_height must be between 0 and 3600"
+ assert any(
+ 0 <= x <= 3600 for x in liquid_surface_no_lld
+ ), "liquid_surface_no_lld must be between 0 and 3600"
+ assert any(
+ 0 <= x <= 3600 for x in pull_out_distance_transport_air
+ ), "pull_out_distance_transport_air must be between 0 and 3600"
+ assert any(
+ 0 <= x <= 3600 for x in immersion_depth
+ ), "immersion_depth must be between 0 and 3600"
+ assert any(
+ 0 <= x <= 1 for x in immersion_depth_direction
+ ), "immersion_depth_direction must be between 0 and 1"
+ assert any(
+ 0 <= x <= 3600 for x in surface_following_distance
+ ), "surface_following_distance must be between 0 and 3600"
+ assert any(
+ 0 <= x <= 3600 for x in second_section_height
+ ), "second_section_height must be between 0 and 3600"
+ assert any(
+ 0 <= x <= 10000 for x in second_section_ratio
+ ), "second_section_ratio must be between 0 and 10000"
+ assert (
+ 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600
+ ), "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
assert 0 <= min_z_endpos <= 3600, "min_z_endpos must be between 0 and 3600"
- assert any(0 <= x <= 12500 for x in dispense_volumes), (
- "dispense_volume must be between 0 and 12500"
- )
+ assert any(
+ 0 <= x <= 12500 for x in dispense_volumes
+ ), "dispense_volume must be between 0 and 12500"
assert any(4 <= x <= 5000 for x in dispense_speed), "dispense_speed must be between 4 and 5000"
assert any(4 <= x <= 5000 for x in cut_off_speed), "cut_off_speed must be between 4 and 5000"
- assert any(0 <= x <= 180 for x in stop_back_volume), (
- "stop_back_volume must be between 0 and 180"
- )
- assert any(0 <= x <= 500 for x in transport_air_volume), (
- "transport_air_volume must be between 0 and 500"
- )
- assert any(0 <= x <= 9999 for x in blow_out_air_volume), (
- "blow_out_air_volume must be between 0 and 9999"
- )
+ assert any(
+ 0 <= x <= 180 for x in stop_back_volume
+ ), "stop_back_volume must be between 0 and 180"
+ assert any(
+ 0 <= x <= 500 for x in transport_air_volume
+ ), "transport_air_volume must be between 0 and 500"
+ assert any(
+ 0 <= x <= 9999 for x in blow_out_air_volume
+ ), "blow_out_air_volume must be between 0 and 9999"
assert any(0 <= x <= 4 for x in lld_mode), "lld_mode must be between 0 and 4"
assert 0 <= side_touch_off_distance <= 45, "side_touch_off_distance must be between 0 and 45"
- assert any(0 <= x <= 100 for x in dispense_position_above_z_touch_off), (
- "dispense_position_above_z_touch_off must be between 0 and 100"
- )
- assert any(1 <= x <= 4 for x in gamma_lld_sensitivity), (
- "gamma_lld_sensitivity must be between 1 and 4"
- )
- assert any(1 <= x <= 4 for x in dp_lld_sensitivity), (
- "dp_lld_sensitivity must be between 1 and 4"
- )
+ assert any(
+ 0 <= x <= 100 for x in dispense_position_above_z_touch_off
+ ), "dispense_position_above_z_touch_off must be between 0 and 100"
+ assert any(
+ 1 <= x <= 4 for x in gamma_lld_sensitivity
+ ), "gamma_lld_sensitivity must be between 1 and 4"
+ assert any(
+ 1 <= x <= 4 for x in dp_lld_sensitivity
+ ), "dp_lld_sensitivity must be between 1 and 4"
assert any(3 <= x <= 1600 for x in swap_speed), "swap_speed must be between 3 and 1600"
assert any(0 <= x <= 99 for x in settling_time), "settling_time must be between 0 and 99"
assert any(0 <= x <= 12500 for x in mix_volume), "mix_volume must be between 0 and 12500"
assert any(0 <= x <= 99 for x in mix_cycles), "mix_cycles must be between 0 and 99"
- assert any(0 <= x <= 900 for x in mix_position_from_liquid_surface), (
- "mix_position_from_liquid_surface must be between 0 and 900"
- )
+ assert any(
+ 0 <= x <= 900 for x in mix_position_from_liquid_surface
+ ), "mix_position_from_liquid_surface must be between 0 and 900"
assert any(4 <= x <= 5000 for x in mix_speed), "mix_speed must be between 4 and 5000"
- assert any(0 <= x <= 3600 for x in mix_surface_following_distance), (
- "mix_surface_following_distance must be between 0 and 3600"
- )
- assert any(0 <= x <= 999 for x in limit_curve_index), (
- "limit_curve_index must be between 0 and 999"
- )
+ assert any(
+ 0 <= x <= 3600 for x in mix_surface_following_distance
+ ), "mix_surface_following_distance must be between 0 and 3600"
+ assert any(
+ 0 <= x <= 999 for x in limit_curve_index
+ ), "limit_curve_index must be between 0 and 999"
assert 0 <= recording_mode <= 2, "recording_mode must be between 0 and 2"
return await self.send_command(
@@ -4829,12 +4830,12 @@ async def core_get_plate(
assert 0 <= open_gripper_position <= 9999, "open_gripper_position must be between 0 and 9999"
assert 0 <= plate_width <= 9999, "plate_width must be between 0 and 9999"
assert 0 <= grip_strength <= 99, "grip_strength must be between 0 and 99"
- assert 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600, (
- "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
- )
- assert 0 <= minimum_z_position_at_the_command_end <= 3600, (
- "minimum_z_position_at_the_command_end must be between 0 and 3600"
- )
+ assert (
+ 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600
+ ), "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
+ assert (
+ 0 <= minimum_z_position_at_the_command_end <= 3600
+ ), "minimum_z_position_at_the_command_end must be between 0 and 3600"
command_output = await self.send_command(
module="C0",
@@ -4877,12 +4878,12 @@ async def core_put_plate(
assert 0 <= z_press_on_distance <= 50, "z_press_on_distance must be between 0 and 999"
assert 0 <= z_speed <= 1600, "z_speed must be between 0 and 1600"
assert 0 <= open_gripper_position <= 9999, "open_gripper_position must be between 0 and 9999"
- assert 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600, (
- "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
- )
- assert 0 <= z_position_at_the_command_end <= 3600, (
- "z_position_at_the_command_end must be between 0 and 3600"
- )
+ assert (
+ 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600
+ ), "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
+ assert (
+ 0 <= z_position_at_the_command_end <= 3600
+ ), "z_position_at_the_command_end must be between 0 and 3600"
command_output = await self.send_command(
module="C0",
@@ -4944,9 +4945,9 @@ async def position_single_pipetting_channel_in_y_direction(
y_position: y position [0.1mm]. Must be between 0 and 6500.
"""
- assert 1 <= pipetting_channel_index <= self.num_channels, (
- "pipetting_channel_index must be between 1 and self"
- )
+ assert (
+ 1 <= pipetting_channel_index <= self.num_channels
+ ), "pipetting_channel_index must be between 1 and self"
assert 0 <= y_position <= 6500, "y_position must be between 0 and 6500"
return await self.send_command(
@@ -4969,9 +4970,9 @@ async def position_single_pipetting_channel_in_z_direction(
3347 is the max.
"""
- assert 1 <= pipetting_channel_index <= self.num_channels, (
- "pipetting_channel_index must be between 1 and self.num_channels"
- )
+ assert (
+ 1 <= pipetting_channel_index <= self.num_channels
+ ), "pipetting_channel_index must be between 1 and self.num_channels"
# docs say 3600, but empirically 3347 is the max
assert 0 <= z_position <= 3347, "z_position must be between 0 and 3347"
@@ -4992,9 +4993,9 @@ async def search_for_teach_in_signal_using_pipetting_channel_n_in_x_direction(
x_position: x position [0.1mm]. Must be between 0 and 30000.
"""
- assert 1 <= pipetting_channel_index <= self.num_channels, (
- "pipetting_channel_index must be between 1 and self.num_channels"
- )
+ assert (
+ 1 <= pipetting_channel_index <= self.num_channels
+ ), "pipetting_channel_index must be between 1 and self.num_channels"
assert 0 <= x_position <= 30000, "x_position must be between 0 and 30000"
return await self.send_command(
@@ -5033,9 +5034,9 @@ async def move_all_pipetting_channels_to_defined_position(
assert 0 <= x_positions <= 25000, "x_positions must be between 0 and 25000"
assert 0 <= y_positions <= 6500, "y_positions must be between 0 and 6500"
- assert 0 <= minimum_traverse_height_at_beginning_of_command <= 3600, (
- "minimum_traverse_height_at_beginning_of_command must be between 0 and 3600"
- )
+ assert (
+ 0 <= minimum_traverse_height_at_beginning_of_command <= 3600
+ ), "minimum_traverse_height_at_beginning_of_command must be between 0 and 3600"
assert 0 <= z_endpos <= 3600, "z_endpos must be between 0 and 3600"
return await self.send_command(
@@ -5058,9 +5059,9 @@ async def position_max_free_y_for_n(self, pipetting_channel_index: int):
pipetting_channel_index: Index of pipetting channel. Must be between 0 and self.num_channels.
"""
- assert 0 <= pipetting_channel_index < self.num_channels, (
- "pipetting_channel_index must be between 1 and self.num_channels"
- )
+ assert (
+ 0 <= pipetting_channel_index < self.num_channels
+ ), "pipetting_channel_index must be between 1 and self.num_channels"
# convert Python's 0-based indexing to Hamilton firmware's 1-based indexing
pipetting_channel_index = pipetting_channel_index + 1
@@ -5087,9 +5088,9 @@ async def request_y_pos_channel_n(self, pipetting_channel_index: int) -> float:
0 is the backmost channel.
"""
- assert 0 <= pipetting_channel_index < self.num_channels, (
- "pipetting_channel_index must be between 0 and self.num_channels"
- )
+ assert (
+ 0 <= pipetting_channel_index < self.num_channels
+ ), "pipetting_channel_index must be between 0 and self.num_channels"
# convert Python's 0-based indexing to Hamilton firmware's 1-based indexing
pipetting_channel_index = pipetting_channel_index + 1
@@ -5309,7 +5310,7 @@ async def initialize_core_96_head(
xd=0 if loc.x >= 0 else 1,
yh=f"{abs(round(loc.y * 10)):04}",
za=f"{round(loc.z * 10):04}",
- ze=f"{round(z_position_at_the_command_end * 10):04}",
+ ze=f"{round(z_position_at_the_command_end*10):04}",
)
async def move_core_96_to_safe_position(self):
@@ -5356,12 +5357,12 @@ async def pick_up_tips_core96(
assert 0 <= x_direction <= 1, "x_direction must be between 0 and 1"
assert 1080 <= y_position <= 5600, "y_position must be between 1080 and 5600"
assert 0 <= z_deposit_position <= 3425, "z_deposit_position must be between 0 and 3425"
- assert 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3425, (
- "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3425"
- )
- assert 0 <= minimum_height_command_end <= 3425, (
- "minimum_height_command_end must be between 0 and 3425"
- )
+ assert (
+ 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3425
+ ), "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3425"
+ assert (
+ 0 <= minimum_height_command_end <= 3425
+ ), "minimum_height_command_end must be between 0 and 3425"
return await self.send_command(
module="C0",
@@ -5406,12 +5407,12 @@ async def discard_tips_core96(
assert 0 <= x_direction <= 1, "x_direction must be between 0 and 1"
assert 1080 <= y_position <= 5600, "y_position must be between 1080 and 5600"
assert 0 <= z_deposit_position <= 3425, "z_deposit_position must be between 0 and 3425"
- assert 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3425, (
- "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3425"
- )
- assert 0 <= minimum_height_command_end <= 3425, (
- "minimum_height_command_end must be between 0 and 3425"
- )
+ assert (
+ 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3425
+ ), "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3425"
+ assert (
+ 0 <= minimum_height_command_end <= 3425
+ ), "minimum_height_command_end must be between 0 and 3425"
return await self.send_command(
module="C0",
@@ -5524,31 +5525,31 @@ async def aspirate_core_96(
assert 0 <= x_position <= 30000, "x_position must be between 0 and 30000"
assert 0 <= x_direction <= 1, "x_direction must be between 0 and 1"
assert 1080 <= y_positions <= 5600, "y_positions must be between 1080 and 5600"
- assert 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3425, (
- "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3425"
- )
+ assert (
+ 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3425
+ ), "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3425"
assert 0 <= minimal_end_height <= 3425, "minimal_end_height must be between 0 and 3425"
assert 0 <= lld_search_height <= 3425, "lld_search_height must be between 0 and 3425"
- assert 0 <= liquid_surface_at_function_without_lld <= 3425, (
- "liquid_surface_at_function_without_lld must be between 0 and 3425"
- )
- assert 0 <= pull_out_distance_to_take_transport_air_in_function_without_lld <= 3425, (
- "pull_out_distance_to_take_transport_air_in_function_without_lld must be between 0 and 3425"
- )
- assert 0 <= maximum_immersion_depth <= 3425, (
- "maximum_immersion_depth must be between 0 and 3425"
- )
- assert 0 <= tube_2nd_section_height_measured_from_zm <= 3425, (
- "tube_2nd_section_height_measured_from_zm must be between 0 and 3425"
- )
- assert 0 <= tube_2nd_section_ratio <= 10000, (
- "tube_2nd_section_ratio must be between 0 and 10000"
- )
+ assert (
+ 0 <= liquid_surface_at_function_without_lld <= 3425
+ ), "liquid_surface_at_function_without_lld must be between 0 and 3425"
+ assert (
+ 0 <= pull_out_distance_to_take_transport_air_in_function_without_lld <= 3425
+ ), "pull_out_distance_to_take_transport_air_in_function_without_lld must be between 0 and 3425"
+ assert (
+ 0 <= maximum_immersion_depth <= 3425
+ ), "maximum_immersion_depth must be between 0 and 3425"
+ assert (
+ 0 <= tube_2nd_section_height_measured_from_zm <= 3425
+ ), "tube_2nd_section_height_measured_from_zm must be between 0 and 3425"
+ assert (
+ 0 <= tube_2nd_section_ratio <= 10000
+ ), "tube_2nd_section_ratio must be between 0 and 10000"
assert 0 <= immersion_depth <= 3600, "immersion_depth must be between 0 and 3600"
assert 0 <= immersion_depth_direction <= 1, "immersion_depth_direction must be between 0 and 1"
- assert 0 <= liquid_surface_sink_distance_at_the_end_of_aspiration <= 990, (
- "liquid_surface_sink_distance_at_the_end_of_aspiration must be between 0 and 990"
- )
+ assert (
+ 0 <= liquid_surface_sink_distance_at_the_end_of_aspiration <= 990
+ ), "liquid_surface_sink_distance_at_the_end_of_aspiration must be between 0 and 990"
assert 0 <= aspiration_volumes <= 11500, "aspiration_volumes must be between 0 and 11500"
assert 3 <= aspiration_speed <= 5000, "aspiration_speed must be between 3 and 5000"
assert 0 <= transport_air_volume <= 500, "transport_air_volume must be between 0 and 500"
@@ -5560,12 +5561,12 @@ async def aspirate_core_96(
assert 0 <= settling_time <= 99, "settling_time must be between 0 and 99"
assert 0 <= mix_volume <= 11500, "mix_volume must be between 0 and 11500"
assert 0 <= mix_cycles <= 99, "mix_cycles must be between 0 and 99"
- assert 0 <= mix_position_from_liquid_surface <= 990, (
- "mix_position_from_liquid_surface must be between 0 and 990"
- )
- assert 0 <= surface_following_distance_during_mix <= 990, (
- "surface_following_distance_during_mix must be between 0 and 990"
- )
+ assert (
+ 0 <= mix_position_from_liquid_surface <= 990
+ ), "mix_position_from_liquid_surface must be between 0 and 990"
+ assert (
+ 0 <= surface_following_distance_during_mix <= 990
+ ), "surface_following_distance_during_mix must be between 0 and 990"
assert 3 <= speed_of_mix <= 5000, "speed_of_mix must be between 3 and 5000"
assert 0 <= limit_curve_index <= 999, "limit_curve_index must be between 0 and 999"
@@ -5716,30 +5717,30 @@ async def dispense_core_96(
assert 0 <= x_position <= 30000, "x_position must be between 0 and 30000"
assert 0 <= x_direction <= 1, "x_direction must be between 0 and 1"
assert 1080 <= y_position <= 5600, "y_position must be between 1080 and 5600"
- assert 0 <= maximum_immersion_depth <= 3425, (
- "maximum_immersion_depth must be between 0 and 3425"
- )
- assert 0 <= tube_2nd_section_height_measured_from_zm <= 3425, (
- "tube_2nd_section_height_measured_from_zm must be between 0 and 3425"
- )
- assert 0 <= tube_2nd_section_ratio <= 10000, (
- "tube_2nd_section_ratio must be between 0 and 10000"
- )
+ assert (
+ 0 <= maximum_immersion_depth <= 3425
+ ), "maximum_immersion_depth must be between 0 and 3425"
+ assert (
+ 0 <= tube_2nd_section_height_measured_from_zm <= 3425
+ ), "tube_2nd_section_height_measured_from_zm must be between 0 and 3425"
+ assert (
+ 0 <= tube_2nd_section_ratio <= 10000
+ ), "tube_2nd_section_ratio must be between 0 and 10000"
assert 0 <= lld_search_height <= 3425, "lld_search_height must be between 0 and 3425"
- assert 0 <= liquid_surface_at_function_without_lld <= 3425, (
- "liquid_surface_at_function_without_lld must be between 0 and 3425"
- )
- assert 0 <= pull_out_distance_to_take_transport_air_in_function_without_lld <= 3425, (
- "pull_out_distance_to_take_transport_air_in_function_without_lld must be between 0 and 3425"
- )
+ assert (
+ 0 <= liquid_surface_at_function_without_lld <= 3425
+ ), "liquid_surface_at_function_without_lld must be between 0 and 3425"
+ assert (
+ 0 <= pull_out_distance_to_take_transport_air_in_function_without_lld <= 3425
+ ), "pull_out_distance_to_take_transport_air_in_function_without_lld must be between 0 and 3425"
assert 0 <= immersion_depth <= 3600, "immersion_depth must be between 0 and 3600"
assert 0 <= immersion_depth_direction <= 1, "immersion_depth_direction must be between 0 and 1"
- assert 0 <= liquid_surface_sink_distance_at_the_end_of_dispense <= 990, (
- "liquid_surface_sink_distance_at_the_end_of_dispense must be between 0 and 990"
- )
- assert 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3425, (
- "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3425"
- )
+ assert (
+ 0 <= liquid_surface_sink_distance_at_the_end_of_dispense <= 990
+ ), "liquid_surface_sink_distance_at_the_end_of_dispense must be between 0 and 990"
+ assert (
+ 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3425
+ ), "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3425"
assert 0 <= minimal_end_height <= 3425, "minimal_end_height must be between 0 and 3425"
assert 0 <= dispense_volume <= 11500, "dispense_volume must be between 0 and 11500"
assert 3 <= dispense_speed <= 5000, "dispense_speed must be between 3 and 5000"
@@ -5754,12 +5755,12 @@ async def dispense_core_96(
assert 0 <= settling_time <= 99, "settling_time must be between 0 and 99"
assert 0 <= mixing_volume <= 11500, "mixing_volume must be between 0 and 11500"
assert 0 <= mixing_cycles <= 99, "mixing_cycles must be between 0 and 99"
- assert 0 <= mixing_position_from_liquid_surface <= 990, (
- "mixing_position_from_liquid_surface must be between 0 and 990"
- )
- assert 0 <= surface_following_distance_during_mixing <= 990, (
- "surface_following_distance_during_mixing must be between 0 and 990"
- )
+ assert (
+ 0 <= mixing_position_from_liquid_surface <= 990
+ ), "mixing_position_from_liquid_surface must be between 0 and 990"
+ assert (
+ 0 <= surface_following_distance_during_mixing <= 990
+ ), "surface_following_distance_during_mixing must be between 0 and 990"
assert 3 <= speed_of_mixing <= 5000, "speed_of_mixing must be between 3 and 5000"
assert 0 <= limit_curve_index <= 999, "limit_curve_index must be between 0 and 999"
assert 0 <= recording_mode <= 2, "recording_mode must be between 0 and 2"
@@ -5831,18 +5832,18 @@ async def move_core_96_head_to_defined_position(
# TODO: these are values for a STAR. Find them for a STARlet.
self._check_96_position_legal(Coordinate(x, y, z))
- assert 0 <= minimum_height_at_beginning_of_a_command <= 342.5, (
- "minimum_height_at_beginning_of_a_command must be between 0 and 342.5"
- )
+ assert (
+ 0 <= minimum_height_at_beginning_of_a_command <= 342.5
+ ), "minimum_height_at_beginning_of_a_command must be between 0 and 342.5"
return await self.send_command(
module="C0",
command="EM",
- xs=f"{abs(round(x * 10)):05}",
+ xs=f"{abs(round(x*10)):05}",
xd=0 if x >= 0 else 1,
- yh=f"{round(y * 10):04}",
- za=f"{round(z * 10):04}",
- zh=f"{round(minimum_height_at_beginning_of_a_command * 10):04}",
+ yh=f"{round(y*10):04}",
+ za=f"{round(z*10):04}",
+ zh=f"{round(minimum_height_at_beginning_of_a_command*10):04}",
)
async def move_core_96_head_x(self, x_position: float):
@@ -6539,9 +6540,9 @@ async def park_iswap(
of a command [0.1mm]. Must be between 0 and 3600. Default 3600.
"""
- assert 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600, (
- "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
- )
+ assert (
+ 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600
+ ), "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
command_output = await self.send_command(
module="C0",
@@ -6607,23 +6608,23 @@ async def iswap_get_plate(
assert 0 <= z_position <= 3600, "z_position must be between 0 and 3600"
assert 0 <= z_direction <= 1, "z_direction must be between 0 and 1"
assert 1 <= grip_direction <= 4, "grip_direction must be between 1 and 4"
- assert 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600, (
- "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
- )
- assert 0 <= z_position_at_the_command_end <= 3600, (
- "z_position_at_the_command_end must be between 0 and 3600"
- )
+ assert (
+ 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600
+ ), "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
+ assert (
+ 0 <= z_position_at_the_command_end <= 3600
+ ), "z_position_at_the_command_end must be between 0 and 3600"
assert 1 <= grip_strength <= 9, "grip_strength must be between 1 and 9"
assert 0 <= open_gripper_position <= 9999, "open_gripper_position must be between 0 and 9999"
assert 0 <= plate_width <= 9999, "plate_width must be between 0 and 9999"
assert 0 <= plate_width_tolerance <= 99, "plate_width_tolerance must be between 0 and 99"
assert 0 <= collision_control_level <= 1, "collision_control_level must be between 0 and 1"
- assert 0 <= acceleration_index_high_acc <= 4, (
- "acceleration_index_high_acc must be between 0 and 4"
- )
- assert 0 <= acceleration_index_low_acc <= 4, (
- "acceleration_index_low_acc must be between 0 and 4"
- )
+ assert (
+ 0 <= acceleration_index_high_acc <= 4
+ ), "acceleration_index_high_acc must be between 0 and 4"
+ assert (
+ 0 <= acceleration_index_low_acc <= 4
+ ), "acceleration_index_low_acc must be between 0 and 4"
command_output = await self.send_command(
module="C0",
@@ -6700,20 +6701,20 @@ async def iswap_put_plate(
assert 0 <= z_position <= 3600, "z_position must be between 0 and 3600"
assert 0 <= z_direction <= 1, "z_direction must be between 0 and 1"
assert 1 <= grip_direction <= 4, "grip_direction must be between 1 and 4"
- assert 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600, (
- "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
- )
- assert 0 <= z_position_at_the_command_end <= 3600, (
- "z_position_at_the_command_end must be between 0 and 3600"
- )
+ assert (
+ 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600
+ ), "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
+ assert (
+ 0 <= z_position_at_the_command_end <= 3600
+ ), "z_position_at_the_command_end must be between 0 and 3600"
assert 0 <= open_gripper_position <= 9999, "open_gripper_position must be between 0 and 9999"
assert 0 <= collision_control_level <= 1, "collision_control_level must be between 0 and 1"
- assert 0 <= acceleration_index_high_acc <= 4, (
- "acceleration_index_high_acc must be between 0 and 4"
- )
- assert 0 <= acceleration_index_low_acc <= 4, (
- "acceleration_index_low_acc must be between 0 and 4"
- )
+ assert (
+ 0 <= acceleration_index_high_acc <= 4
+ ), "acceleration_index_high_acc must be between 0 and 4"
+ assert (
+ 0 <= acceleration_index_low_acc <= 4
+ ), "acceleration_index_low_acc must be between 0 and 4"
command_output = await self.send_command(
module="C0",
@@ -6842,16 +6843,16 @@ async def move_plate_to_position(
assert 0 <= z_position <= 3600, "z_position must be between 0 and 3600"
assert 0 <= z_direction <= 1, "z_direction must be between 0 and 1"
assert 1 <= grip_direction <= 4, "grip_direction must be between 1 and 4"
- assert 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600, (
- "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
- )
+ assert (
+ 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600
+ ), "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
assert 0 <= collision_control_level <= 1, "collision_control_level must be between 0 and 1"
- assert 0 <= acceleration_index_high_acc <= 4, (
- "acceleration_index_high_acc must be between 0 and 4"
- )
- assert 0 <= acceleration_index_low_acc <= 4, (
- "acceleration_index_low_acc must be between 0 and 4"
- )
+ assert (
+ 0 <= acceleration_index_high_acc <= 4
+ ), "acceleration_index_high_acc must be between 0 and 4"
+ assert (
+ 0 <= acceleration_index_low_acc <= 4
+ ), "acceleration_index_low_acc must be between 0 and 4"
command_output = await self.send_command(
module="C0",
@@ -6885,9 +6886,9 @@ async def collapse_gripper_arm(
iswap_fold_up_sequence_at_the_end_of_process: fold up sequence at the end of process. Default False.
"""
- assert 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600, (
- "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
- )
+ assert (
+ 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600
+ ), "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
return await self.send_command(
module="C0",
@@ -6951,16 +6952,16 @@ async def prepare_iswap_teaching(
assert 0 <= z_direction <= 1, "z_direction must be between 0 and 1"
assert 0 <= location <= 1, "location must be between 0 and 1"
assert 0 <= hotel_depth <= 3000, "hotel_depth must be between 0 and 3000"
- assert 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600, (
- "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
- )
+ assert (
+ 0 <= minimum_traverse_height_at_beginning_of_a_command <= 3600
+ ), "minimum_traverse_height_at_beginning_of_a_command must be between 0 and 3600"
assert 0 <= collision_control_level <= 1, "collision_control_level must be between 0 and 1"
- assert 0 <= acceleration_index_high_acc <= 4, (
- "acceleration_index_high_acc must be between 0 and 4"
- )
- assert 0 <= acceleration_index_low_acc <= 4, (
- "acceleration_index_low_acc must be between 0 and 4"
- )
+ assert (
+ 0 <= acceleration_index_high_acc <= 4
+ ), "acceleration_index_high_acc must be between 0 and 4"
+ assert (
+ 0 <= acceleration_index_low_acc <= 4
+ ), "acceleration_index_low_acc must be between 0 and 4"
return await self.send_command(
module="C0",
@@ -7218,15 +7219,15 @@ async def clld_probe_z_height_using_channel(
+ f"and {STAR.z_drive_increment_to_mm(15_000)} mm/sec, is {channel_speed} mm/sec"
)
assert 5 <= channel_acceleration_thousand_increments <= 150, (
- f"Channel acceleration must be between \n{STAR.z_drive_increment_to_mm(5 * 1_000)} "
- + f" and {STAR.z_drive_increment_to_mm(150 * 1_000)} mm/sec**2, is {channel_acceleration} mm/sec**2"
- )
- assert 0 <= detection_edge <= 1_023, (
- "Edge steepness at capacitive LLD detection must be between 0 and 1023"
- )
- assert 0 <= detection_drop <= 1_023, (
- "Offset after capacitive LLD edge detection must be between 0 and 1023"
- )
+ f"Channel acceleration must be between \n{STAR.z_drive_increment_to_mm(5*1_000)} "
+ + f" and {STAR.z_drive_increment_to_mm(150*1_000)} mm/sec**2, is {channel_acceleration} mm/sec**2"
+ )
+ assert (
+ 0 <= detection_edge <= 1_023
+ ), "Edge steepness at capacitive LLD detection must be between 0 and 1023"
+ assert (
+ 0 <= detection_drop <= 1_023
+ ), "Offset after capacitive LLD edge detection must be between 0 and 1023"
assert 0 <= post_detection_dist_increments <= 9_999, (
"Post cLLD-detection movement distance must be between \n0"
+ f" and {STAR.z_drive_increment_to_mm(9_999)} mm, is {post_detection_dist} mm"
@@ -7401,20 +7402,20 @@ async def ztouch_probe_z_height_using_channel(
+ f" and {STAR.z_drive_increment_to_mm(15_000)} mm/sec, is {channel_speed} mm/sec"
)
assert 5 <= channel_acceleration_thousand_increments <= 150, (
- f"Channel acceleration must be between \n{STAR.z_drive_increment_to_mm(5 * 1_000)}"
- + f" and {STAR.z_drive_increment_to_mm(150 * 1_000)} mm/sec**2, is {channel_speed} mm/sec**2"
+ f"Channel acceleration must be between \n{STAR.z_drive_increment_to_mm(5*1_000)}"
+ + f" and {STAR.z_drive_increment_to_mm(150*1_000)} mm/sec**2, is {channel_speed} mm/sec**2"
)
assert 20 <= channel_speed_upwards_increments <= 15_000, (
f"Channel retraction speed must be between \n{STAR.z_drive_increment_to_mm(20)}"
+ f" and {STAR.z_drive_increment_to_mm(15_000)} mm/sec, is {channel_speed_upwards} mm/sec"
)
- assert 0 <= detection_limiter_in_PWM <= 125, (
- "Detection limiter value must be between 0 and 125 PWM."
- )
+ assert (
+ 0 <= detection_limiter_in_PWM <= 125
+ ), "Detection limiter value must be between 0 and 125 PWM."
assert 0 <= push_down_force_in_PWM <= 125, "Push down force between 0 and 125 PWM values"
- assert 0 <= post_detection_dist <= 245, (
- f"Post detection distance must be between 0 and 245 mm, is {post_detection_dist}"
- )
+ assert (
+ 0 <= post_detection_dist <= 245
+ ), f"Post detection distance must be between 0 and 245 mm, is {post_detection_dist}"
lowest_immers_pos_str = f"{lowest_immers_pos_increments:05}"
start_pos_search_str = f"{start_pos_search_increments:05}"
@@ -7566,7 +7567,7 @@ async def position_channels_in_y_direction(self, ys: Dict[int, float], make_spac
):
raise ValueError("Channels must be at least 9mm apart and in descending order")
- yp = " ".join([f"{round(y * 10):04}" for y in channel_locations.values()])
+ yp = " ".join([f"{round(y*10):04}" for y in channel_locations.values()])
return await self.send_command(
module="C0",
command="JY",
@@ -7589,7 +7590,7 @@ async def position_channels_in_z_direction(self, zs: Dict[int, float]):
channel_locations[channel_idx] = z
return await self.send_command(
- module="C0", command="JZ", zp=[f"{round(z * 10):04}" for z in channel_locations.values()]
+ module="C0", command="JZ", zp=[f"{round(z*10):04}" for z in channel_locations.values()]
)
async def pierce_foil(
@@ -7640,9 +7641,9 @@ async def pierce_foil(
)
ys = [y + offset.y for offset in offsets]
else:
- assert len(set(w.get_absolute_location().x for w in wells)) == 1, (
- "Wells must be on the same column"
- )
+ assert (
+ len(set(w.get_absolute_location().x for w in wells)) == 1
+ ), "Wells must be on the same column"
absolute_center = wells[0].get_absolute_location("c", "c", "cavity_bottom")
x = absolute_center.x
ys = [well.get_absolute_location(x="c", y="c").y for well in wells]
@@ -7708,7 +7709,7 @@ async def step_off_foil(
if front_channel <= back_channel:
raise ValueError(
- "front_channel should be in front of back_channel. Channels are 0-indexed from the back."
+ "front_channel should be in front of back_channel. " "Channels are 0-indexed from the back."
)
if isinstance(wells, Well):
diff --git a/pylabrobot/liquid_handling/backends/hamilton/STAR_tests.py b/pylabrobot/liquid_handling/backends/hamilton/STAR_tests.py
index c836b7ff4ee..757fb700d52 100644
--- a/pylabrobot/liquid_handling/backends/hamilton/STAR_tests.py
+++ b/pylabrobot/liquid_handling/backends/hamilton/STAR_tests.py
@@ -925,7 +925,7 @@ async def test_move_core(self):
"C0ZTid0001xs07975xd0ya1240yb1065pa07pb08tp2350tz2250th2800tt14"
),
_any_write_and_read_command_call(
- "C0ZPid0002xs03479xd0yj1142yv0050zj1876zy0500yo0885yg0825yw15th2800te2800"
+ "C0ZPid0002xs03479xd0yj1142yv0050zj1876zy0500yo0885yg0825yw15" "th2800te2800"
),
_any_write_and_read_command_call(
"C0ZRid0003xs03479xd0yj2102zj1876zi000zy0500yo0885th2800te2800"
diff --git a/pylabrobot/liquid_handling/backends/hamilton/vantage_backend.py b/pylabrobot/liquid_handling/backends/hamilton/vantage_backend.py
index b2ff6121964..4a6fafcdbcb 100644
--- a/pylabrobot/liquid_handling/backends/hamilton/vantage_backend.py
+++ b/pylabrobot/liquid_handling/backends/hamilton/vantage_backend.py
@@ -1618,17 +1618,17 @@ async def define_tip_needle(
if not 0 <= tip_type_table_index <= 99:
raise ValueError(
- f"tip_type_table_index must be between 0 and 99, but is {tip_type_table_index}"
+ "tip_type_table_index must be between 0 and 99, but is " f"{tip_type_table_index}"
)
if not 0 <= tip_type_table_index <= 99:
raise ValueError(
- f"tip_type_table_index must be between 0 and 99, but is {tip_type_table_index}"
+ "tip_type_table_index must be between 0 and 99, but is " f"{tip_type_table_index}"
)
if not 1 <= tip_length <= 1999:
- raise ValueError(f"tip_length must be between 1 and 1999, but is {tip_length}")
+ raise ValueError("tip_length must be between 1 and 1999, but is " f"{tip_length}")
if not 1 <= maximum_tip_volume <= 56000:
raise ValueError(
- f"maximum_tip_volume must be between 1 and 56000, but is {maximum_tip_volume}"
+ "maximum_tip_volume must be between 1 and 56000, but is " f"{maximum_tip_volume}"
)
return await self.send_command(
@@ -1780,7 +1780,8 @@ async def pip_aspirate(
0 <= x <= 3600 for x in pull_out_distance_to_take_transport_air_in_function_without_lld
):
raise ValueError(
- "pull_out_distance_to_take_transport_air_in_function_without_lld must be in range 0 to 3600"
+ "pull_out_distance_to_take_transport_air_in_function_without_lld must be "
+ "in range 0 to 3600"
)
if tube_2nd_section_height_measured_from_zm is None:
@@ -2094,7 +2095,8 @@ async def pip_dispense(
0 <= x <= 3600 for x in pull_out_distance_to_take_transport_air_in_function_without_lld
):
raise ValueError(
- "pull_out_distance_to_take_transport_air_in_function_without_lld must be in range 0 to 3600"
+ "pull_out_distance_to_take_transport_air_in_function_without_lld must be "
+ "in range 0 to 3600"
)
if immersion_depth is None:
@@ -2434,7 +2436,8 @@ async def simultaneous_aspiration_dispensation_of_liquid(
0 <= x <= 3600 for x in pull_out_distance_to_take_transport_air_in_function_without_lld
):
raise ValueError(
- "pull_out_distance_to_take_transport_air_in_function_without_lld must be in range 0 to 3600"
+ "pull_out_distance_to_take_transport_air_in_function_without_lld must be "
+ "in range 0 to 3600"
)
if minimum_height is None:
@@ -4046,7 +4049,8 @@ async def core96_aspiration_of_liquid(
if not 0 <= pull_out_distance_to_take_transport_air_in_function_without_lld <= 3900:
raise ValueError(
- "pull_out_distance_to_take_transport_air_in_function_without_lld must be in range 0 to 3900"
+ "pull_out_distance_to_take_transport_air_in_function_without_lld must be in "
+ "range 0 to 3900"
)
if not 0 <= minimum_height <= 3900:
@@ -4113,7 +4117,7 @@ async def core96_aspiration_of_liquid(
tadm_channel_pattern = [True] * 96
elif not len(tadm_channel_pattern) < 24:
raise ValueError(
- f"tadm_channel_pattern must be of length 24, but is '{len(tadm_channel_pattern)}'"
+ "tadm_channel_pattern must be of length 24, but is " f"'{len(tadm_channel_pattern)}'"
)
tadm_channel_pattern_num = sum(2**i if tadm_channel_pattern[i] else 0 for i in range(96))
@@ -4266,7 +4270,8 @@ async def core96_dispensing_of_liquid(
if not 0 <= pull_out_distance_to_take_transport_air_in_function_without_lld <= 3900:
raise ValueError(
- "pull_out_distance_to_take_transport_air_in_function_without_lld must be in range 0 to 3900"
+ "pull_out_distance_to_take_transport_air_in_function_without_lld must be in "
+ "range 0 to 3900"
)
if not -990 <= immersion_depth <= 990:
@@ -4336,7 +4341,7 @@ async def core96_dispensing_of_liquid(
tadm_channel_pattern = [True] * 96
elif not len(tadm_channel_pattern) < 24:
raise ValueError(
- f"tadm_channel_pattern must be of length 24, but is '{len(tadm_channel_pattern)}'"
+ "tadm_channel_pattern must be of length 24, but is " f"'{len(tadm_channel_pattern)}'"
)
tadm_channel_pattern_num = sum(2**i if tadm_channel_pattern[i] else 0 for i in range(96))
@@ -4678,7 +4683,7 @@ async def core96_request_tadm_error_status(
tadm_channel_pattern = [True] * 96
elif not len(tadm_channel_pattern) < 24:
raise ValueError(
- f"tadm_channel_pattern must be of length 24, but is '{len(tadm_channel_pattern)}'"
+ "tadm_channel_pattern must be of length 24, but is " f"'{len(tadm_channel_pattern)}'"
)
tadm_channel_pattern_num = sum(2**i if tadm_channel_pattern[i] else 0 for i in range(96))
diff --git a/pylabrobot/liquid_handling/backends/tecan/EVO_backend.py b/pylabrobot/liquid_handling/backends/tecan/EVO_backend.py
index cf22cbc35eb..e18fb469fe1 100644
--- a/pylabrobot/liquid_handling/backends/tecan/EVO_backend.py
+++ b/pylabrobot/liquid_handling/backends/tecan/EVO_backend.py
@@ -486,9 +486,9 @@ async def pick_up_tips(self, ops: List[Pickup], use_channels: List[int]):
use_channels: The channels to use for the pickup operations.
"""
- assert min(use_channels) >= self.num_channels - self.diti_count, (
- f"DiTis can only be configured for the last {self.diti_count} channels"
- )
+ assert (
+ min(use_channels) >= self.num_channels - self.diti_count
+ ), f"DiTis can only be configured for the last {self.diti_count} channels"
# Get positions including offsets
x_positions, y_positions, z_positions = self._liha_positions(ops, use_channels)
@@ -530,12 +530,12 @@ async def drop_tips(self, ops: List[Drop], use_channels: List[int]):
use_channels: The channels to use for the drop operations.
"""
- assert min(use_channels) >= self.num_channels - self.diti_count, (
- f"DiTis can only be configured for the last {self.diti_count} channels"
- )
- assert all(isinstance(op.resource, (Trash, TipSpot)) for op in ops), (
- "Must drop in waste container or tip rack"
- )
+ assert (
+ min(use_channels) >= self.num_channels - self.diti_count
+ ), f"DiTis can only be configured for the last {self.diti_count} channels"
+ assert all(
+ isinstance(op.resource, (Trash, TipSpot)) for op in ops
+ ), "Must drop in waste container or tip rack"
# Get positions including offsets
x_positions, y_positions, _ = self._liha_positions(ops, use_channels)
@@ -1195,9 +1195,7 @@ async def _drop_disposable_tip(self, tips, discard_height):
discard_height: binary. 0 above tip rack, 1 in tip rack
"""
- await self.backend.send_command(
- module=self.module, command="AST", params=[tips, discard_height]
- )
+ await self.backend.send_command(module=self.module, command="AST", params=[tips, discard_height])
class Mca(EVOArm):
diff --git a/pylabrobot/liquid_handling/liquid_classes/hamilton/star.py b/pylabrobot/liquid_handling/liquid_classes/hamilton/star.py
index 532fbb19170..ac1d91f9a1a 100644
--- a/pylabrobot/liquid_handling/liquid_classes/hamilton/star.py
+++ b/pylabrobot/liquid_handling/liquid_classes/hamilton/star.py
@@ -3310,37 +3310,37 @@ def get_star_liquid_class(
)
-star_mapping[(5000, False, True, False, Liquid.DMSO, True, True)] = _5mlT_DMSO_DispenseJet_Empty = (
- HamiltonLiquidClass(
- curve={
- 500.0: 540.0,
- 50.0: 62.0,
- 5000.0: 5095.0,
- 4000.0: 4075.0,
- 0.0: 0.0,
- 3000.0: 3065.0,
- 100.0: 117.0,
- 2000.0: 2060.0,
- 1000.0: 1060.0,
- },
- aspiration_flow_rate=2000.0,
- aspiration_mix_flow_rate=500.0,
- aspiration_air_transport_volume=20.0,
- aspiration_blow_out_volume=50.0,
- aspiration_swap_speed=2.0,
- aspiration_settling_time=1.0,
- aspiration_over_aspirate_volume=0.0,
- aspiration_clot_retract_height=0.0,
- dispense_flow_rate=1000.0,
- dispense_mode=3.0,
- dispense_mix_flow_rate=100.0,
- dispense_air_transport_volume=20.0,
- dispense_blow_out_volume=50.0,
- dispense_swap_speed=1.0,
- dispense_settling_time=0.0,
- dispense_stop_flow_rate=400.0,
- dispense_stop_back_volume=0.0,
- )
+star_mapping[(5000, False, True, False, Liquid.DMSO, True, True)] = (
+ _5mlT_DMSO_DispenseJet_Empty
+) = HamiltonLiquidClass(
+ curve={
+ 500.0: 540.0,
+ 50.0: 62.0,
+ 5000.0: 5095.0,
+ 4000.0: 4075.0,
+ 0.0: 0.0,
+ 3000.0: 3065.0,
+ 100.0: 117.0,
+ 2000.0: 2060.0,
+ 1000.0: 1060.0,
+ },
+ aspiration_flow_rate=2000.0,
+ aspiration_mix_flow_rate=500.0,
+ aspiration_air_transport_volume=20.0,
+ aspiration_blow_out_volume=50.0,
+ aspiration_swap_speed=2.0,
+ aspiration_settling_time=1.0,
+ aspiration_over_aspirate_volume=0.0,
+ aspiration_clot_retract_height=0.0,
+ dispense_flow_rate=1000.0,
+ dispense_mode=3.0,
+ dispense_mix_flow_rate=100.0,
+ dispense_air_transport_volume=20.0,
+ dispense_blow_out_volume=50.0,
+ dispense_swap_speed=1.0,
+ dispense_settling_time=0.0,
+ dispense_stop_flow_rate=400.0,
+ dispense_stop_back_volume=0.0,
)
@@ -4122,36 +4122,36 @@ def get_star_liquid_class(
# - Submerge depth: Aspiration 2.0mm
# (bei Schaumbildung durch mischen/vorbenetzen evtl.5mm, LLD-Erkennung)
# - Mischen 3-5 x 950µl, mix position 0.5mm, je nach Volumen im Tube
-star_mapping[(1000, False, True, False, Liquid.BLOOD, True, False)] = HighVolumeBloodDispenseJet = (
- HamiltonLiquidClass(
- curve={
- 500.0: 536.3,
- 250.0: 275.6,
- 50.0: 59.8,
- 0.0: 0.0,
- 20.0: 26.2,
- 100.0: 115.3,
- 10.0: 12.2,
- 1000.0: 1061.6,
- },
- aspiration_flow_rate=250.0,
- aspiration_mix_flow_rate=250.0,
- aspiration_air_transport_volume=5.0,
- aspiration_blow_out_volume=50.0,
- aspiration_swap_speed=2.0,
- aspiration_settling_time=2.0,
- aspiration_over_aspirate_volume=0.0,
- aspiration_clot_retract_height=0.0,
- dispense_flow_rate=400.0,
- dispense_mode=0.0,
- dispense_mix_flow_rate=250.0,
- dispense_air_transport_volume=5.0,
- dispense_blow_out_volume=50.0,
- dispense_swap_speed=2.0,
- dispense_settling_time=0.0,
- dispense_stop_flow_rate=300.0,
- dispense_stop_back_volume=0.0,
- )
+star_mapping[(1000, False, True, False, Liquid.BLOOD, True, False)] = (
+ HighVolumeBloodDispenseJet
+) = HamiltonLiquidClass(
+ curve={
+ 500.0: 536.3,
+ 250.0: 275.6,
+ 50.0: 59.8,
+ 0.0: 0.0,
+ 20.0: 26.2,
+ 100.0: 115.3,
+ 10.0: 12.2,
+ 1000.0: 1061.6,
+ },
+ aspiration_flow_rate=250.0,
+ aspiration_mix_flow_rate=250.0,
+ aspiration_air_transport_volume=5.0,
+ aspiration_blow_out_volume=50.0,
+ aspiration_swap_speed=2.0,
+ aspiration_settling_time=2.0,
+ aspiration_over_aspirate_volume=0.0,
+ aspiration_clot_retract_height=0.0,
+ dispense_flow_rate=400.0,
+ dispense_mode=0.0,
+ dispense_mix_flow_rate=250.0,
+ dispense_air_transport_volume=5.0,
+ dispense_blow_out_volume=50.0,
+ dispense_swap_speed=2.0,
+ dispense_settling_time=0.0,
+ dispense_stop_flow_rate=300.0,
+ dispense_stop_back_volume=0.0,
)
@@ -4268,37 +4268,37 @@ def get_star_liquid_class(
# 100 ( 9 Aliquots) 0.25 -4.81
#
#
-star_mapping[(1000, False, True, False, Liquid.DMSO, True, False)] = HighVolumeDMSOAliquotJet = (
- HamiltonLiquidClass(
- curve={
- 500.0: 500.0,
- 250.0: 250.0,
- 0.0: 0.0,
- 30.0: 30.0,
- 20.0: 20.0,
- 100.0: 100.0,
- 10.0: 10.0,
- 750.0: 750.0,
- 1000.0: 1000.0,
- },
- aspiration_flow_rate=250.0,
- aspiration_mix_flow_rate=250.0,
- aspiration_air_transport_volume=0.0,
- aspiration_blow_out_volume=50.0,
- aspiration_swap_speed=2.0,
- aspiration_settling_time=1.0,
- aspiration_over_aspirate_volume=0.0,
- aspiration_clot_retract_height=0.0,
- dispense_flow_rate=300.0,
- dispense_mode=0.0,
- dispense_mix_flow_rate=250.0,
- dispense_air_transport_volume=0.0,
- dispense_blow_out_volume=50.0,
- dispense_swap_speed=2.0,
- dispense_settling_time=0.0,
- dispense_stop_flow_rate=200.0,
- dispense_stop_back_volume=10.0,
- )
+star_mapping[(1000, False, True, False, Liquid.DMSO, True, False)] = (
+ HighVolumeDMSOAliquotJet
+) = HamiltonLiquidClass(
+ curve={
+ 500.0: 500.0,
+ 250.0: 250.0,
+ 0.0: 0.0,
+ 30.0: 30.0,
+ 20.0: 20.0,
+ 100.0: 100.0,
+ 10.0: 10.0,
+ 750.0: 750.0,
+ 1000.0: 1000.0,
+ },
+ aspiration_flow_rate=250.0,
+ aspiration_mix_flow_rate=250.0,
+ aspiration_air_transport_volume=0.0,
+ aspiration_blow_out_volume=50.0,
+ aspiration_swap_speed=2.0,
+ aspiration_settling_time=1.0,
+ aspiration_over_aspirate_volume=0.0,
+ aspiration_clot_retract_height=0.0,
+ dispense_flow_rate=300.0,
+ dispense_mode=0.0,
+ dispense_mix_flow_rate=250.0,
+ dispense_air_transport_volume=0.0,
+ dispense_blow_out_volume=50.0,
+ dispense_swap_speed=2.0,
+ dispense_settling_time=0.0,
+ dispense_stop_flow_rate=200.0,
+ dispense_stop_back_volume=10.0,
)
@@ -6217,37 +6217,37 @@ def get_star_liquid_class(
# V1.1: Set mix flow rate to 250
-star_mapping[(1000, False, True, False, Liquid.DMSO, True, False)] = HighVolume_DMSO_DispenseJet = (
- HamiltonLiquidClass(
- curve={
- 5.0: 5.1,
- 500.0: 511.2,
- 250.0: 256.2,
- 50.0: 52.2,
- 0.0: 0.0,
- 20.0: 21.3,
- 100.0: 103.4,
- 10.0: 10.7,
- 1000.0: 1021.0,
- },
- aspiration_flow_rate=250.0,
- aspiration_mix_flow_rate=250.0,
- aspiration_air_transport_volume=5.0,
- aspiration_blow_out_volume=40.0,
- aspiration_swap_speed=2.0,
- aspiration_settling_time=1.0,
- aspiration_over_aspirate_volume=0.0,
- aspiration_clot_retract_height=0.0,
- dispense_flow_rate=400.0,
- dispense_mode=0.0,
- dispense_mix_flow_rate=250.0,
- dispense_air_transport_volume=5.0,
- dispense_blow_out_volume=40.0,
- dispense_swap_speed=2.0,
- dispense_settling_time=0.0,
- dispense_stop_flow_rate=250.0,
- dispense_stop_back_volume=0.0,
- )
+star_mapping[(1000, False, True, False, Liquid.DMSO, True, False)] = (
+ HighVolume_DMSO_DispenseJet
+) = HamiltonLiquidClass(
+ curve={
+ 5.0: 5.1,
+ 500.0: 511.2,
+ 250.0: 256.2,
+ 50.0: 52.2,
+ 0.0: 0.0,
+ 20.0: 21.3,
+ 100.0: 103.4,
+ 10.0: 10.7,
+ 1000.0: 1021.0,
+ },
+ aspiration_flow_rate=250.0,
+ aspiration_mix_flow_rate=250.0,
+ aspiration_air_transport_volume=5.0,
+ aspiration_blow_out_volume=40.0,
+ aspiration_swap_speed=2.0,
+ aspiration_settling_time=1.0,
+ aspiration_over_aspirate_volume=0.0,
+ aspiration_clot_retract_height=0.0,
+ dispense_flow_rate=400.0,
+ dispense_mode=0.0,
+ dispense_mix_flow_rate=250.0,
+ dispense_air_transport_volume=5.0,
+ dispense_blow_out_volume=40.0,
+ dispense_swap_speed=2.0,
+ dispense_settling_time=0.0,
+ dispense_stop_flow_rate=250.0,
+ dispense_stop_back_volume=0.0,
)
@@ -7422,27 +7422,27 @@ def get_star_liquid_class(
)
-star_mapping[(10, False, False, False, Liquid.WATER, True, False)] = LowNeedle_Water_DispenseJet = (
- HamiltonLiquidClass(
- curve={50.0: 52.7, 30.0: 31.7, 0.0: 0.0, 20.0: 20.5, 10.0: 10.3},
- aspiration_flow_rate=100.0,
- aspiration_mix_flow_rate=100.0,
- aspiration_air_transport_volume=15.0,
- aspiration_blow_out_volume=30.0,
- aspiration_swap_speed=2.0,
- aspiration_settling_time=1.0,
- aspiration_over_aspirate_volume=0.0,
- aspiration_clot_retract_height=0.0,
- dispense_flow_rate=200.0,
- dispense_mode=0.0,
- dispense_mix_flow_rate=100.0,
- dispense_air_transport_volume=15.0,
- dispense_blow_out_volume=30.0,
- dispense_swap_speed=2.0,
- dispense_settling_time=0.0,
- dispense_stop_flow_rate=150.0,
- dispense_stop_back_volume=0.0,
- )
+star_mapping[(10, False, False, False, Liquid.WATER, True, False)] = (
+ LowNeedle_Water_DispenseJet
+) = HamiltonLiquidClass(
+ curve={50.0: 52.7, 30.0: 31.7, 0.0: 0.0, 20.0: 20.5, 10.0: 10.3},
+ aspiration_flow_rate=100.0,
+ aspiration_mix_flow_rate=100.0,
+ aspiration_air_transport_volume=15.0,
+ aspiration_blow_out_volume=30.0,
+ aspiration_swap_speed=2.0,
+ aspiration_settling_time=1.0,
+ aspiration_over_aspirate_volume=0.0,
+ aspiration_clot_retract_height=0.0,
+ dispense_flow_rate=200.0,
+ dispense_mode=0.0,
+ dispense_mix_flow_rate=100.0,
+ dispense_air_transport_volume=15.0,
+ dispense_blow_out_volume=30.0,
+ dispense_swap_speed=2.0,
+ dispense_settling_time=0.0,
+ dispense_stop_flow_rate=150.0,
+ dispense_stop_back_volume=0.0,
)
@@ -9738,34 +9738,34 @@ def get_star_liquid_class(
)
-star_mapping[(300, True, True, False, Liquid.DMSO, True, True)] = SlimTip_DMSO_DispenseJet_Empty = (
- HamiltonLiquidClass(
- curve={
- 300.0: 309.5,
- 50.0: 54.7,
- 0.0: 0.0,
- 100.0: 107.2,
- 20.0: 22.5,
- 200.0: 209.7,
- },
- aspiration_flow_rate=250.0,
- aspiration_mix_flow_rate=250.0,
- aspiration_air_transport_volume=5.0,
- aspiration_blow_out_volume=10.0,
- aspiration_swap_speed=2.0,
- aspiration_settling_time=1.0,
- aspiration_over_aspirate_volume=0.0,
- aspiration_clot_retract_height=0.0,
- dispense_flow_rate=250.0,
- dispense_mode=3.0,
- dispense_mix_flow_rate=1.0,
- dispense_air_transport_volume=5.0,
- dispense_blow_out_volume=10.0,
- dispense_swap_speed=1.0,
- dispense_settling_time=0.0,
- dispense_stop_flow_rate=100.0,
- dispense_stop_back_volume=0.0,
- )
+star_mapping[(300, True, True, False, Liquid.DMSO, True, True)] = (
+ SlimTip_DMSO_DispenseJet_Empty
+) = HamiltonLiquidClass(
+ curve={
+ 300.0: 309.5,
+ 50.0: 54.7,
+ 0.0: 0.0,
+ 100.0: 107.2,
+ 20.0: 22.5,
+ 200.0: 209.7,
+ },
+ aspiration_flow_rate=250.0,
+ aspiration_mix_flow_rate=250.0,
+ aspiration_air_transport_volume=5.0,
+ aspiration_blow_out_volume=10.0,
+ aspiration_swap_speed=2.0,
+ aspiration_settling_time=1.0,
+ aspiration_over_aspirate_volume=0.0,
+ aspiration_clot_retract_height=0.0,
+ dispense_flow_rate=250.0,
+ dispense_mode=3.0,
+ dispense_mix_flow_rate=1.0,
+ dispense_air_transport_volume=5.0,
+ dispense_blow_out_volume=10.0,
+ dispense_swap_speed=1.0,
+ dispense_settling_time=0.0,
+ dispense_stop_flow_rate=100.0,
+ dispense_stop_back_volume=0.0,
)
@@ -10587,27 +10587,27 @@ def get_star_liquid_class(
# 20 (12 Aliquots) 2.53 -2.97
# 50 ( 4 Aliquots) 0.84 -2.57
#
-star_mapping[(300, False, True, False, Liquid.DMSO, True, False)] = StandardVolumeDMSOAliquotJet = (
- HamiltonLiquidClass(
- curve={350.0: 350.0, 30.0: 30.0, 0.0: 0.0, 20.0: 20.0, 10.0: 10.0},
- aspiration_flow_rate=100.0,
- aspiration_mix_flow_rate=100.0,
- aspiration_air_transport_volume=0.0,
- aspiration_blow_out_volume=0.0,
- aspiration_swap_speed=2.0,
- aspiration_settling_time=1.0,
- aspiration_over_aspirate_volume=0.0,
- aspiration_clot_retract_height=0.0,
- dispense_flow_rate=250.0,
- dispense_mode=0.0,
- dispense_mix_flow_rate=100.0,
- dispense_air_transport_volume=0.0,
- dispense_blow_out_volume=0.0,
- dispense_swap_speed=0.3,
- dispense_settling_time=0.0,
- dispense_stop_flow_rate=200.0,
- dispense_stop_back_volume=10.0,
- )
+star_mapping[(300, False, True, False, Liquid.DMSO, True, False)] = (
+ StandardVolumeDMSOAliquotJet
+) = HamiltonLiquidClass(
+ curve={350.0: 350.0, 30.0: 30.0, 0.0: 0.0, 20.0: 20.0, 10.0: 10.0},
+ aspiration_flow_rate=100.0,
+ aspiration_mix_flow_rate=100.0,
+ aspiration_air_transport_volume=0.0,
+ aspiration_blow_out_volume=0.0,
+ aspiration_swap_speed=2.0,
+ aspiration_settling_time=1.0,
+ aspiration_over_aspirate_volume=0.0,
+ aspiration_clot_retract_height=0.0,
+ dispense_flow_rate=250.0,
+ dispense_mode=0.0,
+ dispense_mix_flow_rate=100.0,
+ dispense_air_transport_volume=0.0,
+ dispense_blow_out_volume=0.0,
+ dispense_swap_speed=0.3,
+ dispense_settling_time=0.0,
+ dispense_stop_flow_rate=200.0,
+ dispense_stop_back_volume=10.0,
)
diff --git a/pylabrobot/liquid_handling/liquid_handler.py b/pylabrobot/liquid_handling/liquid_handler.py
index 9e5dc079add..e8b7d7450ef 100644
--- a/pylabrobot/liquid_handling/liquid_handler.py
+++ b/pylabrobot/liquid_handling/liquid_handler.py
@@ -441,9 +441,9 @@ async def pick_up_tips(
# checks
self._assert_resources_exist(tip_spots)
self._make_sure_channels_exist(use_channels)
- assert len(tip_spots) == len(offsets) == len(use_channels), (
- "Number of tips and offsets and use_channels must be equal."
- )
+ assert (
+ len(tip_spots) == len(offsets) == len(use_channels)
+ ), "Number of tips and offsets and use_channels must be equal."
# create operations
pickups = [
@@ -570,9 +570,9 @@ async def drop_tips(
# checks
self._assert_resources_exist(tip_spots)
self._make_sure_channels_exist(use_channels)
- assert len(tip_spots) == len(offsets) == len(use_channels) == len(tips), (
- "Number of channels and offsets and use_channels and tips must be equal."
- )
+ assert (
+ len(tip_spots) == len(offsets) == len(use_channels) == len(tips)
+ ), "Number of channels and offsets and use_channels and tips must be equal."
# create operations
drops = [
@@ -1989,9 +1989,9 @@ async def drop_resource(
# get the location of the destination
if isinstance(destination, ResourceStack):
- assert destination.direction == "z", (
- "Only ResourceStacks with direction 'z' are currently supported"
- )
+ assert (
+ destination.direction == "z"
+ ), "Only ResourceStacks with direction 'z' are currently supported"
# the resource can be rotated wrt the ResourceStack. This is allowed as long
# as it's in multiples of 180 degrees. 90 degrees is not allowed.
@@ -2643,7 +2643,7 @@ def key_for_tip_spot(tip_spot: TipSpot) -> Tuple[str, float]:
# 6: Execute tip movement/consolidation
for idx, target_tip_spots in enumerate(merged_target_tip_clusters):
- print(f" - tip transfer cycle: {idx + 1} / {len_transfers}")
+ print(f" - tip transfer cycle: {idx+1} / {len_transfers}")
origin_tip_spots = [all_origin_tip_spots.pop(0) for _ in range(len(target_tip_spots))]
diff --git a/pylabrobot/plate_reading/biotek_backend.py b/pylabrobot/plate_reading/biotek_backend.py
index f1d2455d4fe..e6867243e5a 100644
--- a/pylabrobot/plate_reading/biotek_backend.py
+++ b/pylabrobot/plate_reading/biotek_backend.py
@@ -206,7 +206,7 @@ async def setup(self, use_cam: bool = False) -> None:
if self.cam is None:
raise RuntimeError(
- "No camera found. Make sure the camera is connected and the serial number is correct."
+ "No camera found. Make sure the camera is connected and the serial " "number is correct."
)
# -- Initialize camera --
@@ -229,7 +229,7 @@ async def setup(self, use_cam: bool = False) -> None:
ptr_trigger_selector = PySpin.CEnumerationPtr(nodemap.GetNode("TriggerSelector"))
if not PySpin.IsReadable(ptr_trigger_selector) or not PySpin.IsWritable(ptr_trigger_selector):
raise RuntimeError(
- "unable to configure TriggerSelector (can't read or write TriggerSelector)"
+ "unable to configure TriggerSelector " "(can't read or write TriggerSelector)"
)
ptr_frame_start = PySpin.CEnumEntryPtr(ptr_trigger_selector.GetEntryByName("FrameStart"))
if not PySpin.IsReadable(ptr_frame_start):
@@ -600,13 +600,13 @@ async def set_plate(self, plate: Plate):
cmd = (
f"{rows:02}"
f"{columns:02}"
- f"{int(top_left_well_center_y * 100):05}"
- f"{int(bottom_right_well_center_y * 100):05}"
- f"{int(top_left_well_center.x * 100):05}"
- f"{int(bottom_right_well_center.x * 100):05}"
- f"{int(plate_size_y * 100):05}"
- f"{int(plate_size_x * 100):05}"
- f"{int(plate_size_z * 100):04}"
+ f"{int(top_left_well_center_y*100):05}"
+ f"{int(bottom_right_well_center_y*100):05}"
+ f"{int(top_left_well_center.x*100):05}"
+ f"{int(bottom_right_well_center.x*100):05}"
+ f"{int(plate_size_y*100):05}"
+ f"{int(plate_size_x*100):05}"
+ f"{int(plate_size_z*100):04}"
"\x03"
)
@@ -640,7 +640,7 @@ async def read_luminescence(self, plate: Plate, focal_height: float) -> List[Lis
await self.set_plate(plate)
- cmd = f"3{14220 + int(1000 * focal_height)}\x03"
+ cmd = f"3{14220 + int(1000*focal_height)}\x03"
await self.send_command("t", cmd)
cmd = "008401010108120001200100001100100000123000500200200-001000-00300000000000000000001351092"
@@ -669,7 +669,7 @@ async def read_fluorescence(
await self.set_plate(plate)
- cmd = f"{614220 + int(1000 * focal_height)}\x03"
+ cmd = f"{614220 + int(1000*focal_height)}\x03"
await self.send_command("t", cmd)
excitation_wavelength_str = str(excitation_wavelength).zfill(4)
diff --git a/pylabrobot/plate_reading/clario_star_backend.py b/pylabrobot/plate_reading/clario_star_backend.py
index 10a52a4287b..85e0727faf6 100644
--- a/pylabrobot/plate_reading/clario_star_backend.py
+++ b/pylabrobot/plate_reading/clario_star_backend.py
@@ -110,7 +110,7 @@ async def _wait_for_ready_and_return(self, ret, timeout=150):
if len(command_status) != 24:
logger.warning(
- "unexpected response %s. I think a command status response is always 24 bytes",
+ "unexpected response %s. I think a command status response is always 24 " "bytes",
command_status,
)
continue
@@ -123,7 +123,7 @@ async def _wait_for_ready_and_return(self, ret, timeout=150):
if command_status[2] != 0x18 or command_status[3] != 0x0C or command_status[4] != 0x01:
logger.warning(
- "unexpected response %s. I think 18 0c 01 indicates a command status response",
+ "unexpected response %s. I think 18 0c 01 indicates a command status " "response",
command_status,
)
diff --git a/pylabrobot/plate_reading/imager.py b/pylabrobot/plate_reading/imager.py
index ad9e48f2701..9928fd0f12b 100644
--- a/pylabrobot/plate_reading/imager.py
+++ b/pylabrobot/plate_reading/imager.py
@@ -52,7 +52,7 @@ def __init__(
def _will_assign_resource(self, resource: Resource):
if len(self.children) >= 1:
raise ValueError(
- f"Imager {self} already has a plate assigned (attempting to assign {resource})"
+ f"Imager {self} already has a plate assigned " f"(attempting to assign {resource})"
)
def get_plate(self) -> Plate:
diff --git a/pylabrobot/pumps/pumparray.py b/pylabrobot/pumps/pumparray.py
index daedb626a46..decee204dbf 100644
--- a/pylabrobot/pumps/pumparray.py
+++ b/pylabrobot/pumps/pumparray.py
@@ -151,7 +151,7 @@ async def pump_volume(
if self.calibration is None:
raise NotCalibratedError(
- "Pump is not calibrated. Volume based pumping and related functions unavailable."
+ "Pump is not calibrated. Volume based pumping and related functions " "unavailable."
)
if isinstance(use_channels, int):
use_channels = [use_channels]
diff --git a/pylabrobot/resources/corning/costar/plates.py b/pylabrobot/resources/corning/costar/plates.py
index 598d79a8c9b..0d3a4f90944 100644
--- a/pylabrobot/resources/corning/costar/plates.py
+++ b/pylabrobot/resources/corning/costar/plates.py
@@ -1,4 +1,4 @@
-"""Corning-Costar plates."""
+""" Corning-Costar plates. """
from typing import Optional
diff --git a/pylabrobot/resources/corning/falcon/plates.py b/pylabrobot/resources/corning/falcon/plates.py
index c16fa12523d..0c95baa8676 100644
--- a/pylabrobot/resources/corning/falcon/plates.py
+++ b/pylabrobot/resources/corning/falcon/plates.py
@@ -1,4 +1,4 @@
-"""Corning-Falcon Plates"""
+""" Corning-Falcon Plates"""
from typing import Optional
diff --git a/pylabrobot/resources/corning/falcon/tubes.py b/pylabrobot/resources/corning/falcon/tubes.py
index 8929b0d93ff..4e390d6c04d 100644
--- a/pylabrobot/resources/corning/falcon/tubes.py
+++ b/pylabrobot/resources/corning/falcon/tubes.py
@@ -1,4 +1,4 @@
-"""Corning-Falcon Tubes"""
+""" Corning-Falcon Tubes"""
from pylabrobot.resources.tube import Tube
@@ -84,17 +84,17 @@ def Cor_Falcon_tube_14mL_Rb(name: str) -> Tube:
def falcon_tube_50mL(name: str) -> Tube:
raise NotImplementedError(
- "falcon_tube_50mL definition is deprecated. Use Cor_Falcon_tube_50mL instead."
+ "falcon_tube_50mL definition is deprecated. Use " "Cor_Falcon_tube_50mL instead."
)
def falcon_tube_15mL(name: str) -> Tube:
raise NotImplementedError(
- "falcon_tube_15mL definition is deprecated. Use Cor_Falcon_tube_15mL_Vb instead."
+ "falcon_tube_15mL definition is deprecated. Use " "Cor_Falcon_tube_15mL_Vb instead."
)
def Falcon_tube_14mL_Rb(name: str) -> Tube:
raise NotImplementedError(
- "Falcon_tube_14mL_Rb definition is deprecated. Use Cor_Falcon_tube_14mL_Rb instead."
+ "Falcon_tube_14mL_Rb definition is deprecated. Use " "Cor_Falcon_tube_14mL_Rb instead."
)
diff --git a/pylabrobot/resources/corning/plates.py b/pylabrobot/resources/corning/plates.py
index 5b0dd7d6e36..7b2d5e802aa 100644
--- a/pylabrobot/resources/corning/plates.py
+++ b/pylabrobot/resources/corning/plates.py
@@ -1,4 +1,4 @@
-"""Corning plates."""
+""" Corning plates. """
from pylabrobot.resources.height_volume_functions import (
calculate_liquid_height_in_container_2segments_square_vbottom,
diff --git a/pylabrobot/resources/hamilton/hamilton_decks.py b/pylabrobot/resources/hamilton/hamilton_decks.py
index b875f91bc32..aa68aa04858 100644
--- a/pylabrobot/resources/hamilton/hamilton_decks.py
+++ b/pylabrobot/resources/hamilton/hamilton_decks.py
@@ -88,14 +88,15 @@ def check_z_height(resource: Resource):
if z_top > Z_MOVEMENT_LIMIT:
logger.warning(
- "Resource '%s' is very high on the deck: %s mm. Be careful when traversing the deck.",
+ "Resource '%s' is very high on the deck: %s mm. Be careful when " "traversing the deck.",
resource.name,
z_top,
)
if z_top > Z_GRAB_LIMIT:
logger.warning(
- "Resource '%s' is very high on the deck: %s mm. Be careful when grabbing this resource.",
+ "Resource '%s' is very high on the deck: %s mm. Be careful when "
+ "grabbing this resource.",
resource.name,
z_top,
)
@@ -200,7 +201,8 @@ def assign_child_resource(
]
):
raise ValueError(
- f"Location {resource_location} is already occupied by resource '{og_resource.name}'."
+ f"Location {resource_location} is already occupied by resource "
+ f"'{og_resource.name}'."
)
return super().assign_child_resource(resource, location=resource_location, reassign=reassign)
diff --git a/pylabrobot/resources/itemized_resource.py b/pylabrobot/resources/itemized_resource.py
index 5711b369b5f..37501ae944e 100644
--- a/pylabrobot/resources/itemized_resource.py
+++ b/pylabrobot/resources/itemized_resource.py
@@ -194,12 +194,12 @@ def get_item(self, identifier: Union[str, int, Tuple[int, int]]) -> T:
identifier = list(self._ordering.keys()).index(identifier)
except ValueError as e:
raise IndexError(
- f"Item with identifier '{identifier}' does not exist on resource '{self.name}'."
+ f"Item with identifier '{identifier}' does not exist on " f"resource '{self.name}'."
) from e
if not 0 <= identifier < self.num_items:
raise IndexError(
- f"Item with identifier '{identifier}' does not exist on resource '{self.name}'."
+ f"Item with identifier '{identifier}' does not exist on " f"resource '{self.name}'."
)
# Cast child to item type. Children will always be `T`, but the type checker doesn't know that.
@@ -392,7 +392,7 @@ def summary(self, occupied_func=None):
# Create the header row with numbers aligned to the columns.
# Use right-alignment specifier.
- header_row = " " + " ".join(f"{i + 1:<{max_digits}}" for i in range(self.num_items_x))
+ header_row = " " + " ".join(f"{i+1:<{max_digits}}" for i in range(self.num_items_x))
# Create the item grid with resource absence/presence information.
item_grid = [
diff --git a/pylabrobot/resources/tecan/tecan_decks.py b/pylabrobot/resources/tecan/tecan_decks.py
index 453273e372b..656314bba89 100644
--- a/pylabrobot/resources/tecan/tecan_decks.py
+++ b/pylabrobot/resources/tecan/tecan_decks.py
@@ -100,7 +100,7 @@ def assign_child_resource(
and rails is not None
):
raise ValueError(
- f"Resource with width {resource.get_absolute_size_x()} does not fit at rails {rails}."
+ f"Resource with width {resource.get_absolute_size_x()} does not " f"fit at rails {rails}."
)
# Check if there is space for this new resource.
@@ -122,7 +122,8 @@ def assign_child_resource(
< og_y + og_resource.get_absolute_size_y()
):
raise ValueError(
- f"Location {resource_location} is already occupied by resource '{og_resource.name}'."
+ f"Location {resource_location} is already occupied by resource "
+ f"'{og_resource.name}'."
)
return super().assign_child_resource(resource, location=resource_location)
diff --git a/pylabrobot/resources/utils.py b/pylabrobot/resources/utils.py
index 363bd8557b9..5cb8859ba64 100644
--- a/pylabrobot/resources/utils.py
+++ b/pylabrobot/resources/utils.py
@@ -175,7 +175,7 @@ def create_ordered_items_2d(
item_dy=item_dy,
**kwargs,
)
- keys = [f"{LETTERS[j]}{i + 1}" for i in range(num_items_x) for j in range(num_items_y)]
+ keys = [f"{LETTERS[j]}{i+1}" for i in range(num_items_x) for j in range(num_items_y)]
return dict(zip(keys, [item for sublist in items for item in sublist]))
diff --git a/pylabrobot/resources/volume_tracker.py b/pylabrobot/resources/volume_tracker.py
index 0ca9491506e..75a9ad6bf8b 100644
--- a/pylabrobot/resources/volume_tracker.py
+++ b/pylabrobot/resources/volume_tracker.py
@@ -40,9 +40,9 @@ def no_volume_tracking():
def set_cross_contamination_tracking(enabled: bool):
if enabled:
- assert this.volume_tracking_enabled, (
- "Cross contamination tracking only possible if volume tracking active."
- )
+ assert (
+ this.volume_tracking_enabled
+ ), "Cross contamination tracking only possible if volume tracking active."
this.cross_contamination_tracking_enabled = enabled # type: ignore
diff --git a/pylabrobot/scales/scale_backend.py b/pylabrobot/scales/scale_backend.py
index ba9c7ce2cd5..ce18cadcbb0 100644
--- a/pylabrobot/scales/scale_backend.py
+++ b/pylabrobot/scales/scale_backend.py
@@ -7,11 +7,13 @@ class ScaleBackend(MachineBackend, metaclass=ABCMeta):
"""Backend for a scale"""
@abstractmethod
- async def tare(self): ...
+ async def tare(self):
+ ...
@abstractmethod
async def get_weight(self) -> float:
"""Get the weight in grams"""
@abstractmethod
- async def zero(self): ...
+ async def zero(self):
+ ...
diff --git a/pylabrobot/sealing/backend.py b/pylabrobot/sealing/backend.py
index 0e9e8c01b45..b1b79da6e1c 100644
--- a/pylabrobot/sealing/backend.py
+++ b/pylabrobot/sealing/backend.py
@@ -7,13 +7,16 @@ class SealerBackend(MachineBackend, metaclass=ABCMeta):
"""Backend for a sealer machine"""
@abstractmethod
- async def seal(self, temperature: int, duration: float): ...
+ async def seal(self, temperature: int, duration: float):
+ ...
@abstractmethod
- async def open(self): ...
+ async def open(self):
+ ...
@abstractmethod
- async def close(self): ...
+ async def close(self):
+ ...
@abstractmethod
async def set_temperature(self, temperature: float):
diff --git a/pylabrobot/storage/cytomat/cytomat.py b/pylabrobot/storage/cytomat/cytomat.py
index d8386f3d40d..f9a378f89e4 100644
--- a/pylabrobot/storage/cytomat/cytomat.py
+++ b/pylabrobot/storage/cytomat/cytomat.py
@@ -368,7 +368,7 @@ async def set_shaking_frequency(
) -> List[str]:
shakers = shakers or [1, 2]
assert all(shaker in [1, 2] for shaker in shakers), "Shaker index must be 1 or 2"
- return [await self.send_command("se", f"pb 2{idx - 1}", f"{frequency:04}") for idx in shakers]
+ return [await self.send_command("se", f"pb 2{idx-1}", f"{frequency:04}") for idx in shakers]
async def get_incubation_query(
self, query: Literal["ic", "ih", "io", "it"]
diff --git a/pylabrobot/tilting/tilter.py b/pylabrobot/tilting/tilter.py
index c833181186e..e8293a0ad34 100644
--- a/pylabrobot/tilting/tilter.py
+++ b/pylabrobot/tilting/tilter.py
@@ -146,17 +146,17 @@ def experimental_get_well_drain_offsets(
well_drain_offsets = []
for well in wells:
- assert well.cross_section_type == CrossSectionType.CIRCLE, (
- "Wells must have circular cross-section"
- )
+ assert (
+ well.cross_section_type == CrossSectionType.CIRCLE
+ ), "Wells must have circular cross-section"
diameter = well.get_absolute_size_x() # assuming circular well
radius = diameter / 2
if n_tips > 1:
- assert (n_tips - 1) * min_tip_distance <= diameter, (
- f"Cannot fit {n_tips} tips in a well with diameter {diameter} mm"
- )
+ assert (
+ (n_tips - 1) * min_tip_distance <= diameter
+ ), f"Cannot fit {n_tips} tips in a well with diameter {diameter} mm"
y_offsets = [
((n_tips - 1) / 2 - tip_index) * min_tip_distance for tip_index in range(n_tips)
diff --git a/pylabrobot/visualizer/visualizer.py b/pylabrobot/visualizer/visualizer.py
index 46147795c3e..73732582a2f 100644
--- a/pylabrobot/visualizer/visualizer.py
+++ b/pylabrobot/visualizer/visualizer.py
@@ -319,7 +319,7 @@ def _run_file_server(self):
path = os.path.join(dirname, ".")
if not os.path.exists(path):
raise RuntimeError(
- "Could not find Visualizer files. Please run from the root of the repository."
+ "Could not find Visualizer files. Please run from the root of the " "repository."
)
def start_server(lock):
From a8c1096afd07770f1924e4237de1ab815b4ea311 Mon Sep 17 00:00:00 2001
From: AFg6K7h4fhy2 <127630341+AFg6K7h4fhy2@users.noreply.github.com>
Date: Mon, 18 Aug 2025 00:36:42 -0400
Subject: [PATCH 06/13] format using ruff 0.2.1
---
pylabrobot/liquid_handling/backends/tecan/EVO_backend.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/pylabrobot/liquid_handling/backends/tecan/EVO_backend.py b/pylabrobot/liquid_handling/backends/tecan/EVO_backend.py
index e18fb469fe1..e4f7787b57e 100644
--- a/pylabrobot/liquid_handling/backends/tecan/EVO_backend.py
+++ b/pylabrobot/liquid_handling/backends/tecan/EVO_backend.py
@@ -1195,7 +1195,9 @@ async def _drop_disposable_tip(self, tips, discard_height):
discard_height: binary. 0 above tip rack, 1 in tip rack
"""
- await self.backend.send_command(module=self.module, command="AST", params=[tips, discard_height])
+ await self.backend.send_command(
+ module=self.module, command="AST", params=[tips, discard_height]
+ )
class Mca(EVOArm):
From e8d95a0a2345556b033454d3e4674963cf595241 Mon Sep 17 00:00:00 2001
From: AFg6K7h4fhy2 <127630341+AFg6K7h4fhy2@users.noreply.github.com>
Date: Mon, 18 Aug 2025 00:40:01 -0400
Subject: [PATCH 07/13] attempt update ci
---
.github/workflows/lint.yml | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index c5e478ea323..e58326bca47 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -20,9 +20,13 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: 3.9
+ - name: Upgrade pip
+ run: python -m pip install --upgrade pip
- name: Install Dependencies
run: pip install -e '.[dev]'
- name: Run linting check
run: make lint
- name: Check formatting
run: make format-check
+ - name: Run pre-commit (typos)
+ run: pre-commit run typos --all-files
From 96b5fe6345f97ba12cc8c1cde6e897e4632158f3 Mon Sep 17 00:00:00 2001
From: Rick Wierenga
Date: Mon, 15 Sep 2025 09:49:06 -0700
Subject: [PATCH 08/13] some more typos
---
.github/workflows/lint.yml | 2 --
.pre-commit-config.yaml | 1 +
_typos.toml | 9 ---------
.../liquid_handling/backends/hamilton/STAR_tests.py | 2 +-
.../backends/hamilton/vantage_backend.py | 2 +-
pylabrobot/resources/tecan/plates.py | 10 +++++-----
pylabrobot/storage/cytomat/cytomat.py | 2 +-
7 files changed, 9 insertions(+), 19 deletions(-)
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index e58326bca47..123f60928e0 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -28,5 +28,3 @@ jobs:
run: make lint
- name: Check formatting
run: make format-check
- - name: Run pre-commit (typos)
- run: pre-commit run typos --all-files
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index e52f86979ca..69092f7dd90 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -10,4 +10,5 @@ repos:
rev: v1
hooks:
- id: typos
+ files: ^pylabrobot/.*$
args: ["--force-exclude"]
\ No newline at end of file
diff --git a/_typos.toml b/_typos.toml
index 7bef9eacdad..b8492f9a22a 100644
--- a/_typos.toml
+++ b/_typos.toml
@@ -18,14 +18,5 @@ ba = "ba"
nd = "nd"
PN = "PN"
tro = "tro"
-COMMAN = "COMMAN"
FO = "FO"
UE = "UE"
-portait = "portait"
-indictor = "indictor"
-heigh = "heigh"
-
-[files]
-extend-exclude = [
- "*.ipynb"
-]
diff --git a/pylabrobot/liquid_handling/backends/hamilton/STAR_tests.py b/pylabrobot/liquid_handling/backends/hamilton/STAR_tests.py
index 757fb700d52..946ca0b547b 100644
--- a/pylabrobot/liquid_handling/backends/hamilton/STAR_tests.py
+++ b/pylabrobot/liquid_handling/backends/hamilton/STAR_tests.py
@@ -270,7 +270,7 @@ def __init__(self, name: str):
async def asyncTearDown(self):
await self.lh.stop()
- async def test_indictor_light(self):
+ async def test_indicator_light(self):
await self.STAR.set_loading_indicators(bit_pattern=[True] * 54, blink_pattern=[False] * 54)
self.STAR._write_and_read_command.assert_has_calls(
[
diff --git a/pylabrobot/liquid_handling/backends/hamilton/vantage_backend.py b/pylabrobot/liquid_handling/backends/hamilton/vantage_backend.py
index 4a6fafcdbcb..bdde8000a02 100644
--- a/pylabrobot/liquid_handling/backends/hamilton/vantage_backend.py
+++ b/pylabrobot/liquid_handling/backends/hamilton/vantage_backend.py
@@ -186,7 +186,7 @@ def parse_vantage_fw_string(s: str, fmt: Optional[Dict[str, str]] = None) -> dic
56: "Y drive not initialized",
57: "Y drive movement error",
58: "Y drive position out of permitted area",
- 59: "Divergance Y motion controller to linear encoder to heigh",
+ 59: "Divergance Y motion controller to linear encoder to height",
60: "Z drive initialization failed",
61: "Z drive not initialized",
62: "Z drive movement error",
diff --git a/pylabrobot/resources/tecan/plates.py b/pylabrobot/resources/tecan/plates.py
index dd1ee74f2d6..a9835ee7064 100644
--- a/pylabrobot/resources/tecan/plates.py
+++ b/pylabrobot/resources/tecan/plates.py
@@ -244,7 +244,7 @@ def HalfDeepWell_384_Well(name: str, with_lid: bool = False) -> TecanPlate:
)
-def DeepWell_portait_96_Well_Lid(name: str) -> Lid:
+def DeepWell_portrait_96_Well_Lid(name: str) -> Lid:
raise NotImplementedError("This lid is not currently defined.")
# See https://github.com/PyLabRobot/pylabrobot/pull/161.
# return Lid(
@@ -253,18 +253,18 @@ def DeepWell_portait_96_Well_Lid(name: str) -> Lid:
# size_y=127.8,
# size_z=None, # measure the total z height
# nesting_z_height=None, # measure overlap between lid and plate
- # model="DeepWell_portait_96_Well_Lid",
+ # model="DeepWell_portrait_96_Well_Lid",
# )
-def DeepWell_portait_96_Well(name: str, with_lid: bool = False) -> TecanPlate:
+def DeepWell_portrait_96_Well(name: str, with_lid: bool = False) -> TecanPlate:
return TecanPlate(
name=name,
size_x=85.4,
size_y=127.8,
size_z=38.0,
- lid=DeepWell_portait_96_Well_Lid(name=name + "_lid") if with_lid else None,
- model="DeepWell_portait_96_Well",
+ lid=DeepWell_portrait_96_Well_Lid(name=name + "_lid") if with_lid else None,
+ model="DeepWell_portrait_96_Well",
z_start=1670.0,
z_dispense=1690.0,
z_max=2050.0,
diff --git a/pylabrobot/storage/cytomat/cytomat.py b/pylabrobot/storage/cytomat/cytomat.py
index f9a378f89e4..59cb4d441fc 100644
--- a/pylabrobot/storage/cytomat/cytomat.py
+++ b/pylabrobot/storage/cytomat/cytomat.py
@@ -248,7 +248,7 @@ async def get_action_register(self) -> ActionRegisterState:
if int(action, base=2) == int(action_register_member.value, base=16):
action_enum = action_register_member
break
- assert action_enum is not None, f"Unknown HIGH_LEVEL_COMMANDment value: {action}"
+ assert action_enum is not None, f"Unknown value: {action}"
return ActionRegisterState(target=target_enum, action=action_enum)
From dc66e85a1b4f00de36897e46303b9cf69834434a Mon Sep 17 00:00:00 2001
From: Rick Wierenga
Date: Mon, 15 Sep 2025 09:52:39 -0700
Subject: [PATCH 09/13] ci
---
.github/workflows/lint.yml | 2 --
.github/workflows/typo.yml | 32 ++++++++++++++++++++++++++++++++
2 files changed, 32 insertions(+), 2 deletions(-)
create mode 100644 .github/workflows/typo.yml
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 123f60928e0..c5e478ea323 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -20,8 +20,6 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: 3.9
- - name: Upgrade pip
- run: python -m pip install --upgrade pip
- name: Install Dependencies
run: pip install -e '.[dev]'
- name: Run linting check
diff --git a/.github/workflows/typo.yml b/.github/workflows/typo.yml
new file mode 100644
index 00000000000..3ca57ec1296
--- /dev/null
+++ b/.github/workflows/typo.yml
@@ -0,0 +1,32 @@
+name: Typo check
+
+on:
+ push:
+ branches:
+ - main
+ pull_request:
+
+jobs:
+ lint:
+ name: Linting
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout Code
+ uses: actions/checkout@v2
+ - name: Update packages
+ run: sudo apt-get update
+ - name: Set up Python 3.9
+ uses: actions/setup-python@v2
+ with:
+ python-version: 3.9
+ - name: Upgrade pip
+ run: python -m pip install --upgrade pip
+ - name: Install Dependencies
+ run: pip install pre-commit
+ - name: Install pre-commit
+ run: pre-commit install
+ - name: Check formatting
+ run: pre-commit run --all-files
+ - name: Run pre-commit (typos)
+ run: pre-commit run typos --all-files
From 095fdfacde1aaf082e5ffeaf844b89b6c1696a24 Mon Sep 17 00:00:00 2001
From: Rick Wierenga
Date: Mon, 15 Sep 2025 09:55:50 -0700
Subject: [PATCH 10/13] use typos in vscode instead of spell checker
---
.vscode/settings.json | 25 -------------------------
docs/contributor_guide/contributing.md | 2 +-
2 files changed, 1 insertion(+), 26 deletions(-)
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 714c5081890..81e34d8d2ed 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -1,31 +1,6 @@
{
"editor.tabSize": 2,
"files.trimTrailingWhitespace": true,
- "cSpell.words": [
- "agrow",
- "agrowpumps",
- "coro",
- "cytomat",
- "decalibrate",
- "Defaultable",
- "Deprecated",
- "frontmost",
- "hepa",
- "Inheco",
- "iswap",
- "jsonify",
- "klass",
- "labware",
- "modbus",
- "pylabrobot",
- "pytest",
- "subclassing",
- "subresource",
- "tadm",
- "tiprack",
- "usascientific",
- "websockets"
- ],
"python.linting.mypyEnabled": true,
"python.linting.enabled": true,
"python.testing.pytestArgs": ["."],
diff --git a/docs/contributor_guide/contributing.md b/docs/contributor_guide/contributing.md
index 4a5b39fbbda..c8dc6dcf34b 100644
--- a/docs/contributor_guide/contributing.md
+++ b/docs/contributor_guide/contributing.md
@@ -17,7 +17,7 @@ It is recommend that you use VSCode, as we provide a workspace config in `/.vsco
Some VSCode Extensions I'd recommend:
- [Python](https://marketplace.visualstudio.com/items?itemName=ms-python.python)
-- [Code Spell Checker](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker)
+- [Typos Checker](https://github.com/tekumara/typos-lsp)
- [mypy](https://marketplace.visualstudio.com/items?itemName=matangover.mypy)
## Testing, linting, formatting
From a8d720b796c6c472d47b9a3fa84493dd91f68342 Mon Sep 17 00:00:00 2001
From: Rick Wierenga
Date: Mon, 15 Sep 2025 10:04:22 -0700
Subject: [PATCH 11/13] use typos github action
---
.github/workflows/typo.yml | 30 +++++++++++-------------------
.pre-commit-config.yaml | 3 ++-
2 files changed, 13 insertions(+), 20 deletions(-)
diff --git a/.github/workflows/typo.yml b/.github/workflows/typo.yml
index 3ca57ec1296..a11b099c81a 100644
--- a/.github/workflows/typo.yml
+++ b/.github/workflows/typo.yml
@@ -1,32 +1,24 @@
name: Typo check
+permissions:
+ contents: read
+
on:
push:
branches:
- main
pull_request:
+env:
+ CLICOLOR: 1
+
jobs:
- lint:
- name: Linting
+ spelling:
+ name: Spell Check with Typos
runs-on: ubuntu-latest
steps:
- name: Checkout Code
- uses: actions/checkout@v2
- - name: Update packages
- run: sudo apt-get update
- - name: Set up Python 3.9
- uses: actions/setup-python@v2
- with:
- python-version: 3.9
- - name: Upgrade pip
- run: python -m pip install --upgrade pip
- - name: Install Dependencies
- run: pip install pre-commit
- - name: Install pre-commit
- run: pre-commit install
- - name: Check formatting
- run: pre-commit run --all-files
- - name: Run pre-commit (typos)
- run: pre-commit run typos --all-files
+ uses: actions/checkout@v4
+ - name: Spell Check Repo
+ uses: crate-ci/typos@v1
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 69092f7dd90..506ae35df5f 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -6,9 +6,10 @@ repos:
entry: make format
language: system
files: ^pylabrobot/.*$
+
- repo: https://github.com/crate-ci/typos
rev: v1
hooks:
- id: typos
files: ^pylabrobot/.*$
- args: ["--force-exclude"]
\ No newline at end of file
+ args: ["--force-exclude"]
From 51cefbd0a1ed09544e61a98fa964aea9964614c0 Mon Sep 17 00:00:00 2001
From: Rick Wierenga
Date: Mon, 15 Sep 2025 10:06:41 -0700
Subject: [PATCH 12/13] excluding notebooks is necessary
---
_typos.toml | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/_typos.toml b/_typos.toml
index b8492f9a22a..20d22e4f16e 100644
--- a/_typos.toml
+++ b/_typos.toml
@@ -20,3 +20,8 @@ PN = "PN"
tro = "tro"
FO = "FO"
UE = "UE"
+
+[files]
+extend-exclude = [
+ "*.ipynb"
+]
From 24927cd5795e38cd00a262a718c772c594f2e51b Mon Sep 17 00:00:00 2001
From: Rick Wierenga
Date: Mon, 15 Sep 2025 10:07:40 -0700
Subject: [PATCH 13/13] fix 2 more typos
---
docs/user_guide/00_liquid-handling/hamilton-star/96head.ipynb | 2 +-
docs/user_guide/00_liquid-handling/moving-channels-around.ipynb | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/user_guide/00_liquid-handling/hamilton-star/96head.ipynb b/docs/user_guide/00_liquid-handling/hamilton-star/96head.ipynb
index caf532a0284..ac8f6c91504 100644
--- a/docs/user_guide/00_liquid-handling/hamilton-star/96head.ipynb
+++ b/docs/user_guide/00_liquid-handling/hamilton-star/96head.ipynb
@@ -20,7 +20,7 @@
"source": [
"## Example: Hamilton STARLet\n",
"\n",
- "Here, we'll use a Hamilton STARLet as an example. For other robots, simply change the deck layout, makign sure that you have at least a tip rack and a plate to use."
+ "Here, we'll use a Hamilton STARLet as an example. For other robots, simply change the deck layout, making sure that you have at least a tip rack and a plate to use."
]
},
{
diff --git a/docs/user_guide/00_liquid-handling/moving-channels-around.ipynb b/docs/user_guide/00_liquid-handling/moving-channels-around.ipynb
index b1ffb816528..fab2819e2af 100644
--- a/docs/user_guide/00_liquid-handling/moving-channels-around.ipynb
+++ b/docs/user_guide/00_liquid-handling/moving-channels-around.ipynb
@@ -82,7 +82,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "Since the channnel will be above the tip rack, it should be safe to move up. We perform a quick check to make sure the z_safe is at least above the resources we know about."
+ "Since the channel will be above the tip rack, it should be safe to move up. We perform a quick check to make sure the z_safe is at least above the resources we know about."
]
},
{