Skip to content

ResourceStack: nest stacked plates by Plate.stacking_z_height#1112

Merged
rickwierenga merged 1 commit into
PyLabRobot:mainfrom
c-reiter:plate-resourcestack-nesting
Jun 24, 2026
Merged

ResourceStack: nest stacked plates by Plate.stacking_z_height#1112
rickwierenga merged 1 commit into
PyLabRobot:mainfrom
c-reiter:plate-resourcestack-nesting

Conversation

@c-reiter

@c-reiter c-reiter commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #1110, which added Plate.stacking_z_height. This PR makes ResourceStack actually use it, and brings in the documentation that belonged with that work.

Why a separate PR: these changes were force-pushed to the #1110 branch a few minutes after it had already been squash-merged, so they never reached main. #1110 landed only the Plate attribute (param, serialize(), __eq__/__hash__, tests); the ResourceStack nesting and the docs were left behind on the merged branch. This PR re-applies that delta on top of current main.

Changes

  • ResourceStack: bare plates stacked in the z direction now nest by their stacking pitch. A plate placed directly on another bare plate sinks in by size_z - stacking_z_height, so a stack of N identical plates is size_z + (N - 1) * stacking_z_height tall — applied consistently to both get_size_z() and child placement via a shared _nesting_overlap() helper. Gated on the value being set, and skipped when the lower plate wears a lid. This parallels the lid-nesting ResourceStack already performed.
  • Docs: documented stacking_z_height (what it is, how to measure it, the ResourceStack nesting behavior) on the Plate resource page and the ResourceStack notebook, and added it to the example plate definition in the contributor guide.
  • Tests: two/three plates nest to the correct height and positions, no-nesting without the value (back-compat), and no nesting onto a lidded plate.

Notes

  • Backwards compatible: no library plate sets stacking_z_height, so ResourceStack behavior is unchanged for all existing labware.

Follow-up to PyLabRobot#1110. When stacking bare plates in the z direction, a plate
placed directly on another bare plate now nests in by `size_z -
stacking_z_height` instead of resting at the lower plate's full height, so
a stack of N identical plates is `size_z + (N - 1) * stacking_z_height`
tall (both `get_size_z()` and child placement). Gated on the value being
set and skipped when the lower plate wears a lid, so existing behaviour is
unchanged for plates without a `stacking_z_height`. This parallels the
lid-nesting `ResourceStack` already did.

Also includes the documentation for `stacking_z_height` (the Plate
resource page, the ResourceStack notebook, and the example definition in
the contributor guide) that was part of the original PyLabRobot#1110 work.

These changes were force-pushed to the PyLabRobot#1110 branch shortly after it was
already merged, so they never made it into main; this PR brings them in.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rickwierenga rickwierenga merged commit 00841b8 into PyLabRobot:main Jun 24, 2026
21 checks passed
@rickwierenga

Copy link
Copy Markdown
Member

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants