Skip to content

Commit

Permalink
more updated values
Browse files Browse the repository at this point in the history
  • Loading branch information
caila-marashaj committed Dec 16, 2024
1 parent 4fdd13d commit 6c1b0cb
Show file tree
Hide file tree
Showing 3 changed files with 232 additions and 26 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,50 @@
import pytest

from opentrons.protocol_engine.state.geometry import GeometryView

"""
Each labware has 2 nominal volumes calculated in solidworks.
- One is a nominal bottom volume, calculated some set distance from the bottom of the inside of the well.
- The other is a nominal top volume, calculated some set distance from the top of the inside of the well.
"""
labware_to_test = [
# "opentrons_96_aluminumblock_generic_pcr_strip_200ul",
# "opentrons_24_tuberack_generic_2ml_screwcap",
"appliedbiosystemsmicroamp_384_wellplate_40ul",
"biorad_384_wellplate_50ul",
"corning_96_wellplate_360ul_flat",
"corning_384_wellplate_112ul_flat",
"axygen_1_reservoir_90ml",
"biorad_96_wellplate_200ul_pcr",
"corning_48_wellplate_1.6ml_flat",
"corning_6_wellplate_16.8ml_flat",
"corning_24_wellplate_3.4ml_flat",
"corning_12_wellplate_6.9ml_flat",
"thermoscientificnunc_96_wellplate_1300ul",
"opentrons_24_tuberack_eppendorf_1.5ml_safelock_snapcap",
"opentrons_24_tuberack_eppendorf_2ml_safelock_snapcap",
"agilent_1_reservoir_290ml",
"usascientific_96_wellplate_2.4ml_deep",
"thermoscientificnunc_96_wellplate_2000ul",
"usascientific_12_reservoir_22ml",
"opentrons_10_tuberack_falcon_4x50ml_6x15ml_conical-15mL-ONLY",
"opentrons_10_tuberack_falcon_4x50ml_6x15ml_conical-50mL-ONLY",
"nest_96_wellplate_200ul_flat",
"nest_96_wellplate_100ul_pcr_full_skirt",
"opentrons_96_wellplate_200ul_pcr_full_skirt",
"opentrons_24_tuberack_nest_0.5ml_screwcap",
"nest_1_reservoir_195ml",
"nest_12_reservoir_15ml",
"opentrons_24_tuberack_nest_1.5ml_snapcap",
"nest_96_wellplate_2ml_deep",
"opentrons_24_tuberack_nest_2ml_snapcap",
"nest_1_reservoir_290ml",
"opentrons_24_tuberack_nest_1.5ml_screwcap",
"opentrons_24_tuberack_nest_2ml_screwcap",
"opentrons_10_tuberack_nest_4x50ml_6x15ml_conical-50mL-ONLY",
"opentrons_10_tuberack_nest_4x50ml_6x15ml_conical-15mL-ONLY"
]
print(f"len of list = {len(labware_to_test)}")
print(f"len of set = {len(set(labware_to_test))}")


INNER_WELL_GEOMETRY_TEST_PARAMS = [
[
"opentrons_10_tuberack_nest_4x50ml_6x15ml_conical",
Expand Down Expand Up @@ -34,20 +72,20 @@
3.0,
],
# weird one
# [
# "nest_1_reservoir_290ml", "cuboidalWell", 16570.4, 271690.5, 3.0, 3.0
# ],
[
"nest_1_reservoir_290ml", "cuboidalWell", 16570.4, 271690.5, 3.0, 3.0
],
# failing isclose
# [
# "opentrons_24_tuberack_nest_2ml_snapcap", "conicalWell", 69.6, 2148.5, 3.0, 3.0
# ],
[
"opentrons_24_tuberack_nest_2ml_snapcap", "conicalWell", 69.6, 2148.5, 3.0, 3.0
],
["nest_96_wellplate_2ml_deep", "cuboidalWell", 118.3, 2060.4, 3.0, 3.0],
["opentrons_24_tuberack_nest_1.5ml_snapcap", "conicalWell", 27.8, 1682.3, 3.0, 3.0],
["nest_12_reservoir_15ml", "cuboidalWell", 1219.0, 13236.1, 3.0, 3.0],
# weird one
# [
# "nest_1_reservoir_195ml", "cuboidalWell", 14034.2, 172301.9, 3.0, 3.0
# ],
[
"nest_1_reservoir_195ml", "cuboidalWell", 14034.2, 172301.9, 3.0, 3.0
],
[
"opentrons_24_tuberack_nest_0.5ml_screwcap",
"conicalWell",
Expand Down Expand Up @@ -83,15 +121,15 @@
3.0,
],
# failed - squared cone
# [
# "usascientific_12_reservoir_22ml", "cuboidalWell", 61.6, 21111.5, 3.0, 3.0
# ],
[
"usascientific_12_reservoir_22ml", "cuboidalWell", 61.6, 21111.5, 3.0, 3.0
],
["thermoscientificnunc_96_wellplate_2000ul", "conicalWell", 73.5, 1768.0, 3.0, 3.0],
# skipped usascientific_96_wellplate_2.4ml_deep since it doesnt have a definition yet
# weird one
# [
# "agilent_1_reservoir_290ml", "cuboidalWell", 15652.9, 268813.8, 3.0, 3.0
# ],
[
"agilent_1_reservoir_290ml", "cuboidalWell", 15652.9, 268813.8, 3.0, 3.0
],
[
"opentrons_24_tuberack_eppendorf_1.5ml_safelock_snapcap",
"conicalWell",
Expand All @@ -108,9 +146,9 @@
["biorad_96_wellplate_200ul_pcr", "conicalWell", 17.9, 161.2, 3.0, 3.0],
["axygen_1_reservoir_90ml", "cuboidalWell", 22373.4, 70450.6, 3.0, 3.0],
# fails- this one thought it was a rectangle ?
# [
# "corning_384_wellplate_112ul_flat", "conicalWell", 22.4, 77.4, 3.0, 3.0
# ],
[
"corning_384_wellplate_112ul_flat", "conicalWell", 22.4, 77.4, 3.0, 3.0
],
["corning_96_wellplate_360ul_flat", "conicalWell", 97.2, 257.1, 3.0, 3.0],
["biorad_384_wellplate_50ul", "conicalWell", 7.7, 27.8, 3.0, 3.0],
[
Expand All @@ -122,3 +160,27 @@
3.0,
],
]
print(f"len of existing labware = {len(INNER_WELL_GEOMETRY_TEST_PARAMS)}")
existing_names = [l[0] for l in INNER_WELL_GEOMETRY_TEST_PARAMS]
diff = set(labware_to_test).difference(set(existing_names))
print("\nlabware missing:")
for missing in diff:
print(missing)

gotta_add = [
"opentrons_24_tuberack_eppendorf_2ml_safelock_snapcap",
"opentrons_10_tuberack_nest_4x50ml_6x15ml_conical-15mL-ONLY",
"opentrons_24_tuberack_generic_2ml_screwcap",
"opentrons_10_tuberack_falcon_4x50ml_6x15ml_conical-50mL-ONLY",
"opentrons_10_tuberack_nest_4x50ml_6x15ml_conical-50mL-ONLY",
"opentrons_10_tuberack_falcon_4x50ml_6x15ml_conical-15mL-ONLY",
"usascientific_96_wellplate_2.4ml_deep"
]
failing = [
"corning_384_wellplate_112ul_flat",
"agilent_1_reservoir_290ml",
"usascientific_12_reservoir_22ml",
"nest_1_reservoir_195ml",
"opentrons_24_tuberack_nest_2ml_snapcap",
"nest_1_reservoir_290ml",
]
19 changes: 15 additions & 4 deletions api/tests/opentrons/protocol_engine/state/test_geometry_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -3383,6 +3383,7 @@ def test_get_well_height_at_volume(
input_volume_top: float,
expected_height_from_bottom_mm: float,
expected_height_from_top_mm: float,
mock_labware_view: LabwareView,
) -> None:
def _get_labware_def() -> LabwareDefinition:
def_dir = str(get_shared_data_root()) + f"/labware/definitions/3/{labware_id}"
Expand All @@ -3391,12 +3392,22 @@ def _get_labware_def() -> LabwareDefinition:
_labware_def = LabwareDefinition.parse_obj(
json.loads(load_shared_data(def_path).decode("utf-8"))
)
well_geometry = _labware_def.innerLabwareGeometry.get(well_name)
return well_geometry
return _labware_def

decoy.when(subject._labware.get_well_geometry(labware_id, well_name)).then_return(
_get_labware_def()
labware_def = _get_labware_def()
well_geometry = labware_def.innerLabwareGeometry.get(well_name)
well_definition = [
well
for well in labware_def.wells.values()
if well.geometryDefinitionId == well_name
][0]

decoy.when(mock_labware_view.get_well_geometry(labware_id, well_name)).then_return(
well_geometry
)
decoy.when(
mock_labware_view.get_well_definition(labware_id, well_name)
).then_return(well_definition)

found_height_bottom = subject.get_well_height_at_volume(
labware_id=labware_id, well_name=well_name, volume=input_volume_bottom
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,140 @@
},
"innerLabwareGeometry": {
"conicalWell": {
"sections": []
"sections": [
{
"shape": "spherical",
"radiusOfCurvature": 2.88,
"topHeight": 1.45,
"bottomHeight": 0.0
},
{
"shape": "conical",
"topDiameter": 6.0,
"bottomDiameter": 5.0,
"topHeight": 2.20,
"bottomHeight": 1.45
},
{
"shape": "conical",
"topDiameter": 6.4,
"bottomDiameter": 6.0,
"topHeight": 2.45,
"bottomHeight": 2.20
},
{
"shape": "conical",
"topDiameter": 6.80,
"bottomDiameter": 6.40,
"topHeight": 2.75,
"bottomHeight": 2.45
},
{
"shape": "conical",
"topDiameter": 7.2,
"bottomDiameter": 6.8,
"topHeight": 3.14,
"bottomHeight": 2.75
},
{
"shape": "conical",
"topDiameter": 7.60,
"bottomDiameter": 7.20,
"topHeight": 3.67,
"bottomHeight": 3.14
},
{
"shape": "conical",
"topDiameter": 7.7,
"bottomDiameter": 7.6,
"topHeight": 3.93,
"bottomHeight": 3.67
},
{
"shape": "conical",
"topDiameter": 8.0,
"bottomDiameter": 7.7,
"topHeight": 4.29,
"bottomHeight": 3.93
},
{
"shape": "conical",
"topDiameter": 8.2,
"bottomDiameter": 8.0,
"topHeight": 4.53,
"bottomHeight": 4.29
},
{
"shape": "conical",
"topDiameter": 8.4,
"bottomDiameter": 8.2,
"topHeight": 5.03,
"bottomHeight": 4.53
},
{
"shape": "conical",
"topDiameter": 8.5,
"bottomDiameter": 8.4,
"topHeight": 5.15,
"bottomHeight": 5.03
},
{
"shape": "conical",
"topDiameter": 8.6,
"bottomDiameter": 8.5,
"topHeight": 5.43,
"bottomHeight": 5.15
},
{
"shape": "conical",
"topDiameter": 8.78,
"bottomDiameter": 8.6,
"topHeight": 6.97,
"bottomHeight": 5.43
},
{
"shape": "conical",
"topDiameter": 8.9,
"bottomDiameter": 8.78,
"topHeight": 10.17,
"bottomHeight": 6.97
},
{
"shape": "conical",
"topDiameter": 9.0,
"bottomDiameter": 8.9,
"topHeight": 13.32,
"bottomHeight": 10.17
},
{
"shape": "conical",
"topDiameter": 9.1,
"bottomDiameter": 9.0,
"topHeight": 25.26,
"bottomHeight": 13.32
},
{
"shape": "conical",
"topDiameter": 9.2,
"bottomDiameter": 9.1,
"topHeight": 32.50,
"bottomHeight": 25.26
},
{
"shape": "conical",
"topDiameter": 9.6,
"bottomDiameter": 9.2,
"topHeight": 33.96,
"bottomHeight": 32.50
},
{
"shape": "conical",
"topDiameter": 10.0,
"bottomDiameter": 9.6,
"topHeight": 39.02,
"bottomHeight": 33.96
}
]
}
}
}

0 comments on commit 6c1b0cb

Please sign in to comment.