Skip to content
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

refactor(api): redefine well geometry structure #16392

Merged
merged 35 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
8da6f22
changes to types and frustum_helpers
caila-marashaj Sep 30, 2024
a9f7507
fix api tests
caila-marashaj Sep 30, 2024
e441baf
remaining test fixes
caila-marashaj Sep 30, 2024
5ef8020
fix shared-data lint
caila-marashaj Sep 30, 2024
90f6182
some fixture changes, json schema test still failing
caila-marashaj Sep 30, 2024
e634f62
provide method to cast labware defs and types to typeddict
ryanthecoder Oct 1, 2024
6ac6574
Mark some methods as non-public
ryanthecoder Oct 1, 2024
d5ad5b7
Enforce typing and type checking
ryanthecoder Oct 1, 2024
8a1e02a
fix all the things using typing caught
ryanthecoder Oct 1, 2024
4fa1338
remove this method that we no longer need/want
ryanthecoder Oct 1, 2024
e144c0c
consolidate constants
ryanthecoder Oct 2, 2024
b6dfda7
spherecal segments need a bottom height for the sorting to work
ryanthecoder Oct 2, 2024
1cd588c
fixup the casting methods
ryanthecoder Oct 2, 2024
f7e6a4d
change 2d shape definitions to 3d shape definitions
ryanthecoder Oct 2, 2024
1048a7d
Flesh out shape descriptions
ryanthecoder Oct 2, 2024
fc78771
update the schema definitions
ryanthecoder Oct 2, 2024
02bbb77
add required bottom cross section to definitions
ryanthecoder Oct 2, 2024
eaaee95
fix schema and tests
ryanthecoder Oct 2, 2024
43dfa7c
strip out redundant typedict implimentation
ryanthecoder Oct 3, 2024
7e8be6f
openscad for fillited shape, we may need to completely re-think this
ryanthecoder Oct 3, 2024
4aaffc6
fix the typing changes in the tests
ryanthecoder Oct 4, 2024
608320a
typo
ryanthecoder Oct 4, 2024
9cf5ef1
fancy *matching* you here
ryanthecoder Oct 4, 2024
c09c4ef
factor out some things so we can get rid of optionals
ryanthecoder Oct 4, 2024
965ccb4
lint
ryanthecoder Oct 4, 2024
cc9e6f1
fix impossible shape
ryanthecoder Oct 4, 2024
9d50757
remove iffy float check and add test to prove it works as intended an…
ryanthecoder Oct 4, 2024
05fb103
format
ryanthecoder Oct 4, 2024
22a0fe5
format js
ryanthecoder Oct 4, 2024
4efb26c
errant print
ryanthecoder Oct 4, 2024
4d2bab0
fix schema descriptions
ryanthecoder Oct 7, 2024
7eec633
make bottom hieght required for a spherical segment
ryanthecoder Oct 7, 2024
070e119
My symantics knows no bounds other than two parallel 4 sided polygons.
ryanthecoder Oct 7, 2024
59e4130
ohh javascript
ryanthecoder Oct 7, 2024
e17af4f
format js
ryanthecoder Oct 7, 2024
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
376 changes: 159 additions & 217 deletions api/src/opentrons/protocol_engine/state/frustum_helpers.py

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@
)
from opentrons.protocol_engine.state.geometry import GeometryView, _GripperMoveType
from opentrons.protocol_engine.state.frustum_helpers import (
height_from_volume_circular,
height_from_volume_rectangular,
volume_from_height_circular,
volume_from_height_rectangular,
_height_from_volume_circular,
_height_from_volume_rectangular,
_volume_from_height_circular,
_volume_from_height_rectangular,
)
from ..pipette_fixtures import get_default_nozzle_map
from ..mock_circular_frusta import TEST_EXAMPLES as CIRCULAR_TEST_EXAMPLES
Expand Down Expand Up @@ -2776,7 +2776,7 @@ def _find_volume_from_height_(index: int) -> None:
top_width = frustum["width"][index]
target_height = frustum["height"][index]

found_volume = volume_from_height_rectangular(
found_volume = _volume_from_height_rectangular(
target_height=target_height,
total_frustum_height=total_frustum_height,
top_length=top_length,
Expand All @@ -2785,7 +2785,7 @@ def _find_volume_from_height_(index: int) -> None:
bottom_width=bottom_width,
)

found_height = height_from_volume_rectangular(
found_height = _height_from_volume_rectangular(
volume=found_volume,
total_frustum_height=total_frustum_height,
top_length=top_length,
Expand Down Expand Up @@ -2815,14 +2815,14 @@ def _find_volume_from_height_(index: int) -> None:
top_radius = frustum["radius"][index]
target_height = frustum["height"][index]

found_volume = volume_from_height_circular(
found_volume = _volume_from_height_circular(
target_height=target_height,
total_frustum_height=total_frustum_height,
top_radius=top_radius,
bottom_radius=bottom_radius,
)

found_height = height_from_volume_circular(
found_height = _height_from_volume_circular(
volume=found_volume,
total_frustum_height=total_frustum_height,
top_radius=top_radius,
Expand Down
39 changes: 23 additions & 16 deletions api/tests/opentrons/protocol_runner/test_json_translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
Group,
Metadata1,
WellDefinition,
RectangularBoundedSection,
CuboidalFrustum,
InnerWellGeometry,
SphericalSegment,
)
Expand Down Expand Up @@ -683,32 +683,39 @@ def _load_labware_definition_data() -> LabwareDefinition:
y=75.43,
z=75,
totalLiquidVolume=1100000,
shape="rectangular",
shape="circular",
)
},
dimensions=Dimensions(yDimension=85.5, zDimension=100, xDimension=127.75),
cornerOffsetFromSlot=CornerOffsetFromSlot(x=0, y=0, z=0),
innerLabwareGeometry={
"welldefinition1111": InnerWellGeometry(
frusta=[
RectangularBoundedSection(
shape="rectangular",
xDimension=7.6,
yDimension=8.5,
sections=[
CuboidalFrustum(
shape="cuboidal",
topXDimension=7.6,
topYDimension=8.5,
bottomXDimension=5.6,
bottomYDimension=6.5,
topHeight=45,
bottomHeight=20,
),
RectangularBoundedSection(
shape="rectangular",
xDimension=5.6,
yDimension=6.5,
CuboidalFrustum(
shape="cuboidal",
topXDimension=5.6,
topYDimension=6.5,
bottomXDimension=4.5,
bottomYDimension=4.0,
topHeight=20,
bottomHeight=10,
),
SphericalSegment(
shape="spherical",
radiusOfCurvature=6,
topHeight=10,
bottomHeight=0.0,
),
],
bottomShape=SphericalSegment(
shape="spherical",
radiusOfCurvature=6,
depth=10,
),
)
},
brand=BrandData(brand="foo"),
Expand Down
Loading
Loading