From 04195ac4d8ab98c217acc8d1cdeec3eeb981139b Mon Sep 17 00:00:00 2001 From: Rick Wierenga Date: Thu, 13 Feb 2025 11:50:46 -0800 Subject: [PATCH 1/2] add child_location param to HeaterShaker --- pylabrobot/heating_shaking/heater_shaker.py | 3 +++ pylabrobot/shaking/shaker.py | 4 +++- pylabrobot/temperature_controlling/temperature_controller.py | 4 +++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/pylabrobot/heating_shaking/heater_shaker.py b/pylabrobot/heating_shaking/heater_shaker.py index eea2797ad27..1339f16d273 100644 --- a/pylabrobot/heating_shaking/heater_shaker.py +++ b/pylabrobot/heating_shaking/heater_shaker.py @@ -1,5 +1,6 @@ from typing import Optional +from pylabrobot.resources.coordinate import Coordinate from pylabrobot.shaking import Shaker from pylabrobot.temperature_controlling import TemperatureController @@ -16,6 +17,7 @@ def __init__( size_y: float, size_z: float, backend: HeaterShakerBackend, + child_location: Coordinate, category: str = "heating_shaking", model: Optional[str] = None, ): @@ -25,6 +27,7 @@ def __init__( size_y=size_y, size_z=size_z, backend=backend, + child_location=child_location, category=category, model=model, ) diff --git a/pylabrobot/shaking/shaker.py b/pylabrobot/shaking/shaker.py index f5d97fc5a7a..6745773d168 100644 --- a/pylabrobot/shaking/shaker.py +++ b/pylabrobot/shaking/shaker.py @@ -2,7 +2,7 @@ from typing import Optional from pylabrobot.machines.machine import Machine -from pylabrobot.resources.resource_holder import ResourceHolder +from pylabrobot.resources import Coordinate, ResourceHolder from .backend import ShakerBackend @@ -17,6 +17,7 @@ def __init__( size_y: float, size_z: float, backend: ShakerBackend, + child_location: Coordinate, category: str = "shaker", model: Optional[str] = None, ): @@ -28,6 +29,7 @@ def __init__( size_z=size_z, category=category, model=model, + child_location=child_location, ) Machine.__init__(self, backend=backend) self.backend: ShakerBackend = backend # fix type diff --git a/pylabrobot/temperature_controlling/temperature_controller.py b/pylabrobot/temperature_controlling/temperature_controller.py index 77390788426..fbae9104c9f 100644 --- a/pylabrobot/temperature_controlling/temperature_controller.py +++ b/pylabrobot/temperature_controlling/temperature_controller.py @@ -3,7 +3,7 @@ from typing import Optional from pylabrobot.machines.machine import Machine -from pylabrobot.resources.resource_holder import ResourceHolder +from pylabrobot.resources import Coordinate, ResourceHolder from .backend import TemperatureControllerBackend @@ -18,6 +18,7 @@ def __init__( size_y: float, size_z: float, backend: TemperatureControllerBackend, + child_location: Coordinate, category: str = "temperature_controller", model: Optional[str] = None, ): @@ -27,6 +28,7 @@ def __init__( size_x=size_x, size_y=size_y, size_z=size_z, + child_location=child_location, category=category, model=model, ) From 22b348ba7f10bf5b4d573cb9091551497a019cdb Mon Sep 17 00:00:00 2001 From: Rick Wierenga Date: Thu, 13 Feb 2025 11:53:39 -0800 Subject: [PATCH 2/2] opentrons --- pylabrobot/temperature_controlling/opentrons.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pylabrobot/temperature_controlling/opentrons.py b/pylabrobot/temperature_controlling/opentrons.py index 60b968ff8f0..6f3f45303c2 100644 --- a/pylabrobot/temperature_controlling/opentrons.py +++ b/pylabrobot/temperature_controlling/opentrons.py @@ -21,6 +21,7 @@ def __init__( self, name: str, opentrons_id: str, + child_location: Coordinate = Coordinate.zero(), child: Optional[ItemizedResource] = None, ): """Create a new Opentrons temperature module v2. @@ -38,6 +39,7 @@ def __init__( size_x=193.5, size_y=89.2, size_z=84.0, # height without any aluminum block + child_location=child_location, backend=OpentronsTemperatureModuleBackend(opentrons_id=opentrons_id), category="temperature_controller", model="temperatureModuleV2", # Must match OT moduleModel in list_connected_modules() @@ -47,4 +49,4 @@ def __init__( self.child = child if child is not None: - self.assign_child_resource(child, location=Coordinate(x=0, y=0, z=0)) + self.assign_child_resource(child)