diff --git a/.vscode/settings.json b/.vscode/settings.json index da429d1252..714c508189 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -33,7 +33,6 @@ "python.testing.pytestEnabled": true, "python.testing.autoTestDiscoverOnSaveEnabled": true, "editor.rulers": [100], - "editor.formatOnSave": true, "files.exclude": { "**/__pycache__": true }, diff --git a/docs/user_guide/rpi.md b/docs/user_guide/rpi.md index 970c730856..070be87be2 100644 --- a/docs/user_guide/rpi.md +++ b/docs/user_guide/rpi.md @@ -21,6 +21,10 @@ You can use PLR on any operating system, but Raspberry Pis can be a good choice ``` SUBSYSTEM=="usb", MODE="0666" ``` +- Reload the udev rules with + ```bash + sudo udevadm control --reload-rules && sudo udevadm trigger + ``` ```{warning} This adds permissions to all USB devices. This is useful when you control the device and don't want to worry when plugging in new devices, but it could be a security risk if the machine is shared with untrusted users. See [udev documentation](https://www.kernel.org/pub/linux/utils/kernel/hotplug/udev/udev.html) for more granular control. diff --git a/pylabrobot/resources/carrier.py b/pylabrobot/resources/carrier.py index 3f88a70a85..d58940e85a 100644 --- a/pylabrobot/resources/carrier.py +++ b/pylabrobot/resources/carrier.py @@ -191,6 +191,8 @@ def assign_child_resource( "PlateHolder can only store Plate, PlateAdapter or ResourceStack " + f"resources, not {type(resource)}" ) + if isinstance(resource, Plate) and resource.plate_type != "skirted": + raise ValueError("PlateHolder can only store plates that are skirted") return super().assign_child_resource(resource, location, reassign) def _get_sinking_depth(self, resource: Resource) -> Coordinate: diff --git a/pylabrobot/resources/hamilton/hamilton_deck_tests.py b/pylabrobot/resources/hamilton/hamilton_deck_tests.py index 7270883bca..93d7c9199e 100644 --- a/pylabrobot/resources/hamilton/hamilton_deck_tests.py +++ b/pylabrobot/resources/hamilton/hamilton_deck_tests.py @@ -63,7 +63,7 @@ def test_summary(self): │ ├── │ (31) ├── teaching_carrier Resource (775.000, 051.800, 100.000) - │ ├── teaching_tip_rack TipRack (780.900, 452.100, 100.000) + │ ├── teaching_tip_rack TipRack (780.900, 461.100, 100.000) │ (32) ├── trash Trash (800.000, 190.600, 137.100) """[1:] diff --git a/pylabrobot/resources/hamilton/hamilton_decks.py b/pylabrobot/resources/hamilton/hamilton_decks.py index 963d8bb702..788fc84484 100644 --- a/pylabrobot/resources/hamilton/hamilton_decks.py +++ b/pylabrobot/resources/hamilton/hamilton_decks.py @@ -308,8 +308,11 @@ def print_resource_line(resource: Resource, depth=0) -> str: r_summary += resource.__class__.__name__.ljust(type_column_length) # Print resource location - location = resource.get_absolute_location() - r_summary += str(location).ljust(location_column_length) + try: + location = str(resource.get_absolute_location()) + except NoLocationError: + location = "Undefined" + r_summary += location.ljust(location_column_length) return r_summary @@ -421,12 +424,12 @@ def __init__( size_x=9 * 8, size_y=9, size_z=50.4, - ordered_items={f"A{i}": tip_spots[i] for i in range(8)}, + ordered_items={f"{letter}1": tip_spots[idx] for idx, letter in enumerate("HGFEDCBA")}, with_tips=True, model="hamilton_teaching_tip_rack", ) teaching_carrier.assign_child_resource( - teaching_tip_rack, location=Coordinate(x=5.9, y=400.3, z=0) + teaching_tip_rack, location=Coordinate(x=5.9, y=409.3, z=0) ) self.assign_child_resource( teaching_carrier,