-
Notifications
You must be signed in to change notification settings - Fork 139
Expose STARBackend.channel_measure_temperature()
#908
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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), | ||
| 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
|
||
|
|
||
| # # # ACTION Commands # # # | ||
|
|
||
| async def pick_up_tips( | ||
|
|
||
There was a problem hiding this comment.
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 ofSTARBackend.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.