Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions pylabrobot/liquid_handling/backends/hamilton/STAR_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -1604,6 +1604,43 @@ def ensure_can_reach_position(
"Try the operation with different channels or a different target position (i.e. different labware placement)."
)

# # # MEASUREMENT Commands # # # #

async def channel_measure_temperature(self, channel_idx: int) -> float:
"""Measure the temperature of a single channel.

Args:
channel_idx: The channel index to query (0-indexed).

Returns:
The temperature reading as a float.
"""

if not (0 <= channel_idx < self.num_channels):
raise ValueError(
f"channel_idx must be between 0 and {self.num_channels - 1}, got {channel_idx}."
)

resp = await self.send_command(
module=STARBackend.channel_id(channel_idx),
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use self.channel_id(channel_idx) instead of STARBackend.channel_id(channel_idx) here to avoid hard-coding the base class and to stay consistent with nearby channel-specific helpers (e.g. channel_request_y_minimum_spacing). This also keeps the method override-friendly if a subclass ever customizes channel addressing.

Suggested change
module=STARBackend.channel_id(channel_idx),
module=self.channel_id(channel_idx),

Copilot uses AI. Check for mistakes.
command="RM",
fmt="rm####",
)
return round(resp["rm"] / 100.0, 2)

async def channels_measure_temperatures(self) -> List[float]:
"""Measure the temperature of all channels.

Returns:
A list of temperature readings as floats, one per channel, ordered by channel index.
"""

temperatures: List[float] = []
for idx in range(self.num_channels):
temperature = await self.channel_measure_temperature(channel_idx=idx)
temperatures.append(temperature)
return temperatures
Comment on lines +1609 to +1642
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New public measurement helpers (channel_measure_temperature / channels_measure_temperatures) don’t appear to be covered by tests. Since this backend has an extensive STAR_tests.py, please add unit tests that validate the generated command (module/command/fmt) and that the returned value correctly converts the firmware integer (e.g. rm0234 -> 2.34).

Copilot uses AI. Check for mistakes.

# # # ACTION Commands # # #

async def pick_up_tips(
Expand Down
Loading