Hi all. I’m just getting started with PyLabRobot, trying to get it going with a Hamilton STAR. I have limited Hamilton experience, and I haven’t touched Python for several years, so this might be an ELI5 situation as I try to reboot my knowledge.
I’ve gone through the installation in my virtual env, seemingly without any issues that I noticed. However, when attempting to run even the most basic of commands following along with the docs:
from pylabrobot.liquid_handling import LiquidHandler
I get the following large error tree that I can’t seem to parse. Any ideas what the problem might be?
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In[2], line 1
----> 1 from pylabrobot.liquid_handling import LiquidHandler
File ~/Documents/FutureHouse/Lab/PyLabRobot/pylabrobot/pylabrobot/liquid_handling/__init__.py:3
1 """ Liquid handling module for PyLabRobot """
----> 3 from .backends import STAR, SerializingSavingBackend
4 from .liquid_handler import LiquidHandler
5 from .standard import (
6 Pickup,
7 Drop,
(...)
14 Move
15 )
File ~/Documents/FutureHouse/Lab/PyLabRobot/pylabrobot/pylabrobot/liquid_handling/backends/__init__.py:3
1 """ Various backends that can be used to control a liquid handling robots. """
----> 3 from .backend import LiquidHandlerBackend
4 from .serializing_backend import SerializingBackend, SerializingSavingBackend # many rely on this
5 from .websocket import WebSocketBackend # simulation relies on websocket backend
File ~/Documents/FutureHouse/Lab/PyLabRobot/pylabrobot/pylabrobot/liquid_handling/backends/backend.py:8
6 from pylabrobot.machine import MachineBackend
7 from pylabrobot.resources import Resource
----> 8 from pylabrobot.liquid_handling.standard import (
9 Pickup,
10 PickupTipRack,
11 Drop,
12 DropTipRack,
13 Aspiration,
14 AspirationPlate,
15 Dispense,
16 DispensePlate,
17 Move,
18 )
21 class LiquidHandlerBackend(MachineBackend, metaclass=ABCMeta):
22 """
23 Abstract base class for liquid handling robot backends.
24
(...)
29 setup_finished: Whether the backend has been set up.
30 """
File ~/Documents/FutureHouse/Lab/PyLabRobot/pylabrobot/pylabrobot/liquid_handling/standard.py:113
109 LEFT = enum.auto()
110 RIGHT = enum.auto()
--> 113 @dataclass
114 class Move:
115 """ A move operation.
116
117 Attributes:
(...)
124 put_direction: The direction from which to put the resource.
125 """
127 resource: Resource
File /opt/homebrew/Cellar/python@3.11/3.11.7/Frameworks/Python.framework/Versions/3.11/lib/python3.11/dataclasses.py:1230, in dataclass(cls, init, repr, eq, order, unsafe_hash, frozen, match_args, kw_only, slots, weakref_slot)
1227 return wrap
1229 # We're called as @dataclass without parens.
-> 1230 return wrap(cls)
File /opt/homebrew/Cellar/python@3.11/3.11.7/Frameworks/Python.framework/Versions/3.11/lib/python3.11/dataclasses.py:1220, in dataclass.<locals>.wrap(cls)
1219 def wrap(cls):
-> 1220 return _process_class(cls, init, repr, eq, order, unsafe_hash,
1221 frozen, match_args, kw_only, slots,
1222 weakref_slot)
File /opt/homebrew/Cellar/python@3.11/3.11.7/Frameworks/Python.framework/Versions/3.11/lib/python3.11/dataclasses.py:958, in _process_class(cls, init, repr, eq, order, unsafe_hash, frozen, match_args, kw_only, slots, weakref_slot)
955 kw_only = True
956 else:
957 # Otherwise it's a field of some type.
--> 958 cls_fields.append(_get_field(cls, name, type, kw_only))
960 for f in cls_fields:
961 fields[f.name] = f
File /opt/homebrew/Cellar/python@3.11/3.11.7/Frameworks/Python.framework/Versions/3.11/lib/python3.11/dataclasses.py:815, in _get_field(cls, a_name, a_type, default_kw_only)
811 # For real fields, disallow mutable defaults. Use unhashable as a proxy
812 # indicator for mutability. Read the __hash__ attribute from the class,
813 # not the instance.
814 if f._field_type is _FIELD and f.default.__class__.__hash__ is None:
--> 815 raise ValueError(f'mutable default {type(f.default)} for field '
816 f'{f.name} is not allowed: use default_factory')
818 return f
ValueError: mutable default <class 'pylabrobot.resources.coordinate.Coordinate'> for field resource_offset is not allowed: use default_factory