Plate: add optional stacking_z_height parameter#1110
Merged
Conversation
The per-plate vertical pitch when plates are stacked directly on top of each other. Mirrors `NestedTipRack.stacking_z_height` and is required by stacker devices such as the Agilent BenchCel. Defaults to `None` when unknown. Because `stacking_z_height` is a physical dimension, plates that differ in it are treated as different labware: `Plate.__eq__` now compares it (with `__hash__` restored to keep plates hashable), and it is included in `__repr__`. Also adds a `Plate.serialize()` override so both `stacking_z_height` and the pre-existing `plate_type` round-trip through `deserialize` (they were previously dropped because `Plate` did not override `serialize`). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
c-reiter
force-pushed
the
plate-stacking-z-height
branch
from
June 24, 2026 00:49
61b3a50 to
3e0f47a
Compare
Member
|
thanks! |
This was referenced Jun 24, 2026
Collaborator
|
Nice! Should the same be applied to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an optional
stacking_z_heightparameter to thePlateclass — the vertical pitch (in mm) between two identical plates stacked directly on top of each other (i.e. the height one plate adds to a stack:size_zminus the overlap with the plate below).This mirrors the existing
NestedTipRack.stacking_z_heightand gives plates the same notion of stacking pitch that nested tip racks already have. It's required by plate-stacker devices (e.g. the Agilent BenchCel I'm adding in #1109) and defaults toNonewhen unknown, so nothing changes for existing labware.Per the discussion with @rickwierenga: option (b) — add it as an optional param on
Platerather than a new subclass — split out into its own PR.Changes
Plate.__init__: newstacking_z_height: Optional[float] = Noneparameter, stored on the instance.Plate.__eq__: sincestacking_z_heightis a physical dimension, plates that differ in it are different labware and now compare unequal.__hash__is restored toResource's (defining__eq__otherwise sets it toNone), so plates stay hashable, andstacking_z_heightis added to__repr__.Plate.serialize(): new override sostacking_z_heightround-trips throughdeserialize. This also fixes a pre-existing gap whereplate_typewas silently dropped on serialization (becausePlatehad noserializeoverride, so the constructor arg was never persisted —copy()lost it too).ResourceStack: bare plates stacked in the z direction now nest by their stacking pitch. A plate placed directly on another bare plate sinks in bysize_z - stacking_z_height, so a stack ofNidentical plates issize_z + (N - 1) * stacking_z_heighttall (both the reportedget_size_z()and the child placement). Gated on the value being set, and skipped when the lower plate wears a lid — so existing behavior is unchanged (no library plate sets the value yet). This parallels the lid-nestingResourceStackalready did.stacking_z_height(what it is, how to measure it, why it's needed, and theResourceStacknesting behavior) on the Plate resource page and the ResourceStack notebook, and added it to the example plate definition in the contributor guide.Plate— default-is-None, value-stored, serialize/deserialize round-trip (covering bothstacking_z_heightandplate_type), equality differs onstacking_z_height, hashability.ResourceStack— two/three plates nest, no-nesting without the value (back-compat), and no nesting onto a lidded plate.Notes
Platesubclasses exist, so adding the keys toserialize()(whichdeserializefeeds back as constructor kwargs) is safe.stacking_z_height, soResourceStackbehavior is unchanged for all current labware.