From b93be332a22cdadd2f61285d90f5c18b11bcdd6e Mon Sep 17 00:00:00 2001 From: Harley King Date: Thu, 16 Jul 2026 14:02:51 -0400 Subject: [PATCH 1/7] add CAR_32_A00 tube carrier --- .../resources/hamilton/tube_carriers.py | 45 +++++++++++++++++-- 1 file changed, 41 insertions(+), 4 deletions(-) diff --git a/pylabrobot/resources/hamilton/tube_carriers.py b/pylabrobot/resources/hamilton/tube_carriers.py index 2d5428ba1a5..137e8dbc7b3 100644 --- a/pylabrobot/resources/hamilton/tube_carriers.py +++ b/pylabrobot/resources/hamilton/tube_carriers.py @@ -34,12 +34,49 @@ def Tube_CAR_24_A00(name: str) -> TubeCarrier: def Tube_CAR_32_A00(name: str) -> TubeCarrier: warnings.warn( - "The true dimensions of a Tube_CAR_32_A00 (SMP_CAR_32_A00) are not known. " - "The hamilton definitions are with inserts. " - "Do you want to use `hamilton_tube_carrier_32_a00_insert_eppendorf_1_5mL` instead?", + "`Tube_CAR_32_A00` is deprecated. " + "Use `hamilton_tube_carrier_32_a00` for the carrier without inserts or " + "`hamilton_tube_carrier_32_a00_insert_eppendorf_1_5mL` for the carrier " + "with Eppendorf 1.5 mL inserts.", DeprecationWarning, + stacklevel=2, + ) + return hamilton_tube_carrier_32_a00(name) + + +def hamilton_tube_carrier_32_a00(name: str) -> TubeCarrier: + """Hamilton cat. no.: 173410 without inserts. + Hamilton name: 'SMP_CAR_32_A00'. + 'Sample' carrier for 32 tubes. + 1 track(T) wide. + + The 15 mm site pitch and centerline are inherited from the verified + insert-specific definition. The bare-hole diameter and tube-support Z have + not yet been independently measured and are retained as calibration values. + """ + calibration_hole_diameter = 10.8 + return TubeCarrier( + name=name, + size_x=22.5, # 1 track + size_y=497.0, # standard + size_z=60.0, # measured without inserts + sites=create_homogeneous_resources( + klass=ResourceHolder, + locations=[ + Coordinate( + 14.5 - calibration_hole_diameter / 2, + 14.5 - calibration_hole_diameter / 2 + x * 15, + 25.88, + ) + for x in range(32) + ], + # Calibration values inherited from the insert-specific definition. + resource_size_x=calibration_hole_diameter, + resource_size_y=calibration_hole_diameter, + name_prefix=name, + ), + model=hamilton_tube_carrier_32_a00.__name__, ) - return hamilton_tube_carrier_32_a00_insert_eppendorf_1_5mL(name) def hamilton_tube_carrier_32_a00_insert_eppendorf_1_5mL(name: str) -> TubeCarrier: From 9937cde65204ab022ef64329028783951f36a092 Mon Sep 17 00:00:00 2001 From: Harley King Date: Thu, 16 Jul 2026 14:03:39 -0400 Subject: [PATCH 2/7] update tube carrier with diameter and z-height --- pylabrobot/resources/hamilton/tube_carriers.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/pylabrobot/resources/hamilton/tube_carriers.py b/pylabrobot/resources/hamilton/tube_carriers.py index 137e8dbc7b3..8d02107c331 100644 --- a/pylabrobot/resources/hamilton/tube_carriers.py +++ b/pylabrobot/resources/hamilton/tube_carriers.py @@ -51,10 +51,10 @@ def hamilton_tube_carrier_32_a00(name: str) -> TubeCarrier: 1 track(T) wide. The 15 mm site pitch and centerline are inherited from the verified - insert-specific definition. The bare-hole diameter and tube-support Z have - not yet been independently measured and are retained as calibration values. + insert-specific definition. The bare-hole diameter and tube-support Z were + measured directly. """ - calibration_hole_diameter = 10.8 + hole_diameter = 13.4 return TubeCarrier( name=name, size_x=22.5, # 1 track @@ -64,15 +64,14 @@ def hamilton_tube_carrier_32_a00(name: str) -> TubeCarrier: klass=ResourceHolder, locations=[ Coordinate( - 14.5 - calibration_hole_diameter / 2, - 14.5 - calibration_hole_diameter / 2 + x * 15, - 25.88, + 14.5 - hole_diameter / 2, + 14.5 - hole_diameter / 2 + x * 15, + 50.2, ) for x in range(32) ], - # Calibration values inherited from the insert-specific definition. - resource_size_x=calibration_hole_diameter, - resource_size_y=calibration_hole_diameter, + resource_size_x=hole_diameter, + resource_size_y=hole_diameter, name_prefix=name, ), model=hamilton_tube_carrier_32_a00.__name__, From f8c4ecaa00fb77a691601bd88d35c91ff7bd66ee Mon Sep 17 00:00:00 2001 From: Harley King Date: Thu, 16 Jul 2026 15:41:21 -0400 Subject: [PATCH 3/7] docs: Add SMP_CAR_32_A00 to Hamilton resource catalog --- docs/resources/library/hamilton.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/resources/library/hamilton.md b/docs/resources/library/hamilton.md index 402c96e15aa..d6caba6ada0 100644 --- a/docs/resources/library/hamilton.md +++ b/docs/resources/library/hamilton.md @@ -50,6 +50,7 @@ Sometimes called "sample carriers" in Hamilton jargon. | Description | Image | PLR definition | | - | - | - | | 'Tube_CAR_24_A00'
Part no.: 173400
[manufacturer website](https://www.hamiltoncompany.com/automated-liquid-handling/other-robotics/173400)
Carries 24 "sample" tubes with 14.5–18 mm outer diameter, 60–120 mm high. Occupies one track. | ![](img/hamilton/Tube_CAR_24_A00.png) | `Tube_CAR_24_A00` | +| 'SMP_CAR_32_A00'
Part no.: 173410
[manufacturer website](https://www.hamiltoncompany.com/other-robotics/173410)
Carries 32 "sample" tubes with 11–14 mm outer diameter, 60–120 mm high. Occupies one track. | ![](img/hamilton/Tube_CAR_32_A00.png.avif) | `hamilton_tube_carrier_32_a00` | | 'hamilton_tube_carrier_32_a00_insert_eppendorf_1_5mL'
Part no.: 173410
[manufacturer website](https://www.hamiltoncompany.com/other-robotics/173410)
Carries 32 `Eppendorf_DNA_LoBind_1_5ml_Vb` or `Eppendorf_Protein_LoBind_1_5ml_Vb` tubes. Occupies one track. | ![](img/hamilton/Tube_CAR_32_A00.png.avif) | `hamilton_tube_carrier_32_a00_insert_eppendorf_1_5mL` | | 'hamilton_tube_carrier_12_b00'
Part no.: 182045
[manufacturer website](https://www.hamiltoncompany.com/other-robotics/50-ml-falcon-tube-carrier)
Carries 12 "sample" tubes with 30 mm outer diameter, 115 mm high. Occupies two tracks. | ![](img/hamilton/hamilton_tube_carrier_12_b00.jpg) | `hamilton_tube_carrier_12_b00` | From d62db0a4234d3e87d3c1509a8e2a56b0d1ff1976 Mon Sep 17 00:00:00 2001 From: Harley King Date: Fri, 17 Jul 2026 08:45:05 -0400 Subject: [PATCH 4/7] feat(resources): add McKesson tube definitions and serialize tube bottom type --- docs/resources/index.md | 1 + docs/resources/library/mckesson.md | 7 +++ pylabrobot/resources/__init__.py | 1 + pylabrobot/resources/mckesson/__init__.py | 1 + pylabrobot/resources/mckesson/tubes.py | 53 ++++++++++++++++++++ pylabrobot/resources/mckesson/tubes_tests.py | 29 +++++++++++ pylabrobot/resources/tube.py | 7 ++- pylabrobot/resources/tube_tests.py | 29 +++++++++++ 8 files changed, 127 insertions(+), 1 deletion(-) create mode 100644 docs/resources/library/mckesson.md create mode 100644 pylabrobot/resources/mckesson/__init__.py create mode 100644 pylabrobot/resources/mckesson/tubes.py create mode 100644 pylabrobot/resources/mckesson/tubes_tests.py create mode 100644 pylabrobot/resources/tube_tests.py diff --git a/docs/resources/index.md b/docs/resources/index.md index 4a86bf7ca1c..de89fdde315 100644 --- a/docs/resources/index.md +++ b/docs/resources/index.md @@ -182,6 +182,7 @@ library/falcon library/greiner library/hamilton library/imcs +library/mckesson library/nest library/opentrons library/perkin_elmer diff --git a/docs/resources/library/mckesson.md b/docs/resources/library/mckesson.md new file mode 100644 index 00000000000..9b39c4e3607 --- /dev/null +++ b/docs/resources/library/mckesson.md @@ -0,0 +1,7 @@ +# McKesson + +## Tubes + +| Description | Image | PLR definition | +|-|-|-| +| McKesson Premium Glass Culture Tube
Manufacturer no.: 177-1505
[manufacturer website](https://mms.mckesson.com/product/1082085/McKesson-Brand-177-1505)
Borosilicate glass; 12 mm OD x 75 mm
5 mL; round bottom; fire-polished rim
Plain, clear, non-sterile, without closure
250/box, 4 boxes/case | | `McKesson_tube_5mL_Rb` | diff --git a/pylabrobot/resources/__init__.py b/pylabrobot/resources/__init__.py index 4652e9a859b..0eabfcc933a 100644 --- a/pylabrobot/resources/__init__.py +++ b/pylabrobot/resources/__init__.py @@ -29,6 +29,7 @@ from .hamilton import * from .itemized_resource import ItemizedResource from .liquid import Liquid +from .mckesson import * from .nest import * from .opentrons import * from .perkin_elmer import * diff --git a/pylabrobot/resources/mckesson/__init__.py b/pylabrobot/resources/mckesson/__init__.py new file mode 100644 index 00000000000..111259f46e6 --- /dev/null +++ b/pylabrobot/resources/mckesson/__init__.py @@ -0,0 +1 @@ +from .tubes import * diff --git a/pylabrobot/resources/mckesson/tubes.py b/pylabrobot/resources/mckesson/tubes.py new file mode 100644 index 00000000000..ad81cb44325 --- /dev/null +++ b/pylabrobot/resources/mckesson/tubes.py @@ -0,0 +1,53 @@ +"""Resource definitions for McKesson tubes.""" + +from pylabrobot.resources.tube import Tube, TubeBottomType + + +_MCKESSON_TUBE_5ML_RB_HEIGHT_PER_UL = 0.01175032 +_MCKESSON_TUBE_5ML_RB_HEIGHT_INTERCEPT = 3.622768533 + + +def _compute_height_from_volume_McKesson_tube_5mL_Rb(volume: float) -> float: + """Compute liquid height in mm from volume in uL using the measured linear fit.""" + return ( + _MCKESSON_TUBE_5ML_RB_HEIGHT_PER_UL * volume + + _MCKESSON_TUBE_5ML_RB_HEIGHT_INTERCEPT + ) + + +def _compute_volume_from_height_McKesson_tube_5mL_Rb(height: float) -> float: + """Compute volume in uL from liquid height in mm using the measured linear fit.""" + return ( + (height - _MCKESSON_TUBE_5ML_RB_HEIGHT_INTERCEPT) + / _MCKESSON_TUBE_5ML_RB_HEIGHT_PER_UL + ) + + +def McKesson_tube_5mL_Rb(name: str) -> Tube: + """McKesson Premium Glass Culture Tube, manufacturer no. 177-1505. + + - Manufacturer: McKesson + - Manufacturer number: 177-1505 + - Material: borosilicate glass + - Outside diameter: 12 mm + - Length: 75 mm + - Volume: 5 mL + - Bottom: round + - Rim: fire-polished + - Additive: plain + - Sterility: non-sterile + - Closure: none + - Manufacturer URL: https://mms.mckesson.com/product/1082085/McKesson-Brand-177-1505 + """ + diameter = 12 + return Tube( + name=name, + size_x=diameter, + size_y=diameter, + size_z=75, + model=McKesson_tube_5mL_Rb.__name__, + max_volume=5_000, + bottom_type=TubeBottomType.U, + compute_volume_from_height=_compute_volume_from_height_McKesson_tube_5mL_Rb, + compute_height_from_volume=_compute_height_from_volume_McKesson_tube_5mL_Rb, + ) diff --git a/pylabrobot/resources/mckesson/tubes_tests.py b/pylabrobot/resources/mckesson/tubes_tests.py new file mode 100644 index 00000000000..b22eb71d0b7 --- /dev/null +++ b/pylabrobot/resources/mckesson/tubes_tests.py @@ -0,0 +1,29 @@ +import unittest + +from pylabrobot.resources import McKesson_tube_5mL_Rb +from pylabrobot.resources.mckesson import McKesson_tube_5mL_Rb as package_factory +from pylabrobot.resources.tube import TubeBottomType + + +class McKessonTubeTests(unittest.TestCase): + def test_mckesson_tube_5ml_rb(self): + self.assertIs(McKesson_tube_5mL_Rb, package_factory) + + tube = McKesson_tube_5mL_Rb(name="mckesson_tube") + self.assertEqual(tube.name, "mckesson_tube") + self.assertEqual(tube.model, "McKesson_tube_5mL_Rb") + self.assertEqual(tube.get_size_x(), 12) + self.assertEqual(tube.get_size_y(), 12) + self.assertEqual(tube.get_size_z(), 75) + self.assertEqual(tube.max_volume, 5_000) + self.assertEqual(tube.bottom_type, TubeBottomType.U) + self.assertTrue(tube.supports_compute_height_volume_functions()) + + self.assertAlmostEqual(tube.compute_height_from_volume(0), 3.622768533) + self.assertAlmostEqual(tube.compute_height_from_volume(2_500), 32.998568533) + self.assertAlmostEqual(tube.compute_height_from_volume(5_000), 62.374368533) + self.assertAlmostEqual(tube.compute_volume_from_height(32.998568533), 2_500) + self.assertAlmostEqual( + tube.compute_volume_from_height(0), + (0 - 3.622768533) / 0.01175032, + ) diff --git a/pylabrobot/resources/tube.py b/pylabrobot/resources/tube.py index 0fcde5170f8..934da280ba9 100644 --- a/pylabrobot/resources/tube.py +++ b/pylabrobot/resources/tube.py @@ -70,9 +70,14 @@ def __init__( height_volume_data=height_volume_data, no_go_zones=no_go_zones, ) + self.bottom_type = bottom_type def serialize(self) -> dict: - return {**super().serialize(), "max_volume": self.max_volume} + return { + **super().serialize(), + "max_volume": self.max_volume, + "bottom_type": self.bottom_type.value, + } def set_volume(self, volume: float): """Set the volume in the tube. diff --git a/pylabrobot/resources/tube_tests.py b/pylabrobot/resources/tube_tests.py new file mode 100644 index 00000000000..72b5dac2eec --- /dev/null +++ b/pylabrobot/resources/tube_tests.py @@ -0,0 +1,29 @@ +import unittest + +from .tube import Tube, TubeBottomType + + +class TubeTests(unittest.TestCase): + def test_bottom_type_serialization(self): + tube = Tube( + name="tube", + size_x=10, + size_y=10, + size_z=75, + max_volume=4_000, + bottom_type=TubeBottomType.U, + ) + + serialized = tube.serialize() + self.assertEqual(serialized["bottom_type"], "U") + + restored = Tube.deserialize(serialized) + self.assertEqual(restored.bottom_type, TubeBottomType.U) + + def test_deserialize_without_bottom_type(self): + tube = Tube(name="tube", size_x=10, size_y=10, size_z=75, max_volume=4_000) + serialized = tube.serialize() + del serialized["bottom_type"] + + restored = Tube.deserialize(serialized) + self.assertEqual(restored.bottom_type, TubeBottomType.UNKNOWN) From ab0b62645dad41ca6f68bd8442afb16560fda92b Mon Sep 17 00:00:00 2001 From: Harley King Date: Mon, 16 Nov 2026 15:01:55 -0500 Subject: [PATCH 5/7] clean up formatting --- pylabrobot/resources/__init__.py | 2 +- pylabrobot/resources/mckesson/tubes.py | 11 ++--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/pylabrobot/resources/__init__.py b/pylabrobot/resources/__init__.py index 50f99074698..edec60d24fe 100644 --- a/pylabrobot/resources/__init__.py +++ b/pylabrobot/resources/__init__.py @@ -32,8 +32,8 @@ from .itemized_resource import ItemizedResource from .lid import Lid, Liddable from .liquid import Liquid -from .mckesson import * from .manipulator import LinkBody +from .mckesson import * from .n_channel_pipettes import NChannelPipette, TipMountingShaft, TipPickupMode from .nest import * from .opentrons import * diff --git a/pylabrobot/resources/mckesson/tubes.py b/pylabrobot/resources/mckesson/tubes.py index ad81cb44325..5cc310275a4 100644 --- a/pylabrobot/resources/mckesson/tubes.py +++ b/pylabrobot/resources/mckesson/tubes.py @@ -2,25 +2,18 @@ from pylabrobot.resources.tube import Tube, TubeBottomType - _MCKESSON_TUBE_5ML_RB_HEIGHT_PER_UL = 0.01175032 _MCKESSON_TUBE_5ML_RB_HEIGHT_INTERCEPT = 3.622768533 def _compute_height_from_volume_McKesson_tube_5mL_Rb(volume: float) -> float: """Compute liquid height in mm from volume in uL using the measured linear fit.""" - return ( - _MCKESSON_TUBE_5ML_RB_HEIGHT_PER_UL * volume - + _MCKESSON_TUBE_5ML_RB_HEIGHT_INTERCEPT - ) + return _MCKESSON_TUBE_5ML_RB_HEIGHT_PER_UL * volume + _MCKESSON_TUBE_5ML_RB_HEIGHT_INTERCEPT def _compute_volume_from_height_McKesson_tube_5mL_Rb(height: float) -> float: """Compute volume in uL from liquid height in mm using the measured linear fit.""" - return ( - (height - _MCKESSON_TUBE_5ML_RB_HEIGHT_INTERCEPT) - / _MCKESSON_TUBE_5ML_RB_HEIGHT_PER_UL - ) + return (height - _MCKESSON_TUBE_5ML_RB_HEIGHT_INTERCEPT) / _MCKESSON_TUBE_5ML_RB_HEIGHT_PER_UL def McKesson_tube_5mL_Rb(name: str) -> Tube: From b559f17d9dacb2f5306660d616108c7245491e23 Mon Sep 17 00:00:00 2001 From: Harley King Date: Mon, 16 Nov 2026 16:30:48 -0500 Subject: [PATCH 6/7] Complete the McKesson 5 mL tube resource --- docs/resources/library/hamilton.md | 1 - .../img/mckesson/McKesson_tube_5mL_Rb.jpg | Bin 0 -> 30969 bytes docs/resources/library/mckesson.md | 2 +- .../resources/hamilton/tube_carriers.py | 44 ++------------- pylabrobot/resources/mckesson/tubes.py | 53 ++++++++---------- pylabrobot/resources/mckesson/tubes_tests.py | 34 +++++------ 6 files changed, 41 insertions(+), 93 deletions(-) create mode 100644 docs/resources/library/img/mckesson/McKesson_tube_5mL_Rb.jpg diff --git a/docs/resources/library/hamilton.md b/docs/resources/library/hamilton.md index 1e0328632a1..9e0825d5758 100644 --- a/docs/resources/library/hamilton.md +++ b/docs/resources/library/hamilton.md @@ -53,7 +53,6 @@ Sometimes called "sample carriers" in Hamilton jargon. | Description | Image | PLR definition | | - | - | - | | 'Tube_CAR_24_A00'
Part no.: 173400
[manufacturer website](https://www.hamiltoncompany.com/automated-liquid-handling/other-robotics/173400)
Carries 24 "sample" tubes with 14.5–18 mm outer diameter, 60–120 mm high. Occupies one track. | ![](img/hamilton/Tube_CAR_24_A00.png) | `Tube_CAR_24_A00` | -| 'SMP_CAR_32_A00'
Part no.: 173410
[manufacturer website](https://www.hamiltoncompany.com/other-robotics/173410)
Carries 32 "sample" tubes with 11–14 mm outer diameter, 60–120 mm high. Occupies one track. | ![](img/hamilton/Tube_CAR_32_A00.png.avif) | `hamilton_tube_carrier_32_a00` | | 'hamilton_tube_carrier_32_a00_insert_eppendorf_1_5mL'
Part no.: 173410
[manufacturer website](https://www.hamiltoncompany.com/other-robotics/173410)
Carries 32 `Eppendorf_DNA_LoBind_1_5ml_Vb` or `Eppendorf_Protein_LoBind_1_5ml_Vb` tubes. Occupies one track. | ![](img/hamilton/Tube_CAR_32_A00.png.avif) | `hamilton_tube_carrier_32_a00_insert_eppendorf_1_5mL` | | 'hamilton_tube_carrier_12_b00'
Part no.: 182045
[manufacturer website](https://www.hamiltoncompany.com/other-robotics/50-ml-falcon-tube-carrier)
Carries 12 "sample" tubes with 30 mm outer diameter, 115 mm high. Occupies two tracks. | ![](img/hamilton/hamilton_tube_carrier_12_b00.jpg) | `hamilton_tube_carrier_12_b00` | diff --git a/docs/resources/library/img/mckesson/McKesson_tube_5mL_Rb.jpg b/docs/resources/library/img/mckesson/McKesson_tube_5mL_Rb.jpg new file mode 100644 index 0000000000000000000000000000000000000000..7eaa0023af23fa2a5f54c9fa0660e076ef17a6a1 GIT binary patch literal 30969 zcmeHvdpwle+xMDr9?Bs@O4Bqs4p9yjQKKl?%ApzOQzWO9L@`m5l2b)7QNlDRjPoHm zMPZ8xArz?yh3xITsnokhY47LV@AKFD{4w)7whQ&bZlZh>%YD2|NQ~#i0dgA_|aGR=iuVw>j#Oo zgMG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4J#Hy;uh{(Wqk^{6A4}tr$MQ)B>l1uEd zJF|Nq`p(SyOwCS5b#>M$spr(V(w4@Ey$=}2*2a1BaE$6|XY|m=v6PUH$GEWUEf!1E3C)=VbcI)PeK_-e zvZXVh8MZGz>_czZ+6BJTTG~F1kFOm#`D(;hcURm@1O7wep;L2FA$KvYUU6Pg9|7$N+%hja#Wi;V|mS%(8A&G|rP9FH+*j3Ll9e5GJ zFUDp&pIvo!(XyB;qkn4~hgo{u6P&Yvy;TfXPn?}xxMAq-LtExn__s2%)M_PYoG=Jr zV~@3~p45?dy$jwqjeYsHnu%#N;S54fUOgE(P^nOw?&+Ck>(N55lv3-tDNZEhk zQXNfFKqTggLW=%{II>CF)8Y`!Z5Q-aC(S#uVrd+KS~TErEWMzKD_)@qPHQTf8a`7J za#!;D-W#-($Wn=z{MA;`2eK`ntIyn$oH68%f>ADa#0-B_@(nB*n4~EqohNTUU(?jC zb`=Xv2>UmLG5zDr%44Z(qw*A*YEHdOzZMmFlWV=chx1Lr^mGS{{UI8nV= zuIa5+xF<@uc2Rf!8P=u^1m>nb(ts{ONodE(Aqnh{7E;Kg7HQR$>7-U*yXLcbjhpk$ ztp&D-_%yQD2qw-nVunnxGUjR~qxcNjv0WGWD5jb<7xO{PZvD^Pf)fkJ!z{?!b zL`SfS&dTManufacturer no.: 177-1505
[manufacturer website](https://mms.mckesson.com/product/1082085/McKesson-Brand-177-1505)
Borosilicate glass; 12 mm OD x 75 mm
5 mL; round bottom; fire-polished rim
Plain, clear, non-sterile, without closure
250/box, 4 boxes/case | | `McKesson_tube_5mL_Rb` | +| McKesson Premium Glass Culture Tube
Part no. 177-1505
[Manufacturer product page](https://mms.mckesson.com/product/1082085/McKesson-Brand-177-1505) · [Specifications](https://imgcdn.mckesson.com/CumulusWeb/Click_and_learn/premium_glass_culture_tubes_tear_sheet_2018-07.pdf)
12 mm OD × 75 mm, 5 mL
Round-bottom borosilicate glass with a fire-polished rim
Plain, clear, non-sterile, without closure
250/box, 4 boxes/case | ![McKesson 177-1505 glass culture tube](img/mckesson/McKesson_tube_5mL_Rb.jpg) | `McKesson_tube_5mL_Rb` | diff --git a/pylabrobot/resources/hamilton/tube_carriers.py b/pylabrobot/resources/hamilton/tube_carriers.py index 8d02107c331..2d5428ba1a5 100644 --- a/pylabrobot/resources/hamilton/tube_carriers.py +++ b/pylabrobot/resources/hamilton/tube_carriers.py @@ -34,48 +34,12 @@ def Tube_CAR_24_A00(name: str) -> TubeCarrier: def Tube_CAR_32_A00(name: str) -> TubeCarrier: warnings.warn( - "`Tube_CAR_32_A00` is deprecated. " - "Use `hamilton_tube_carrier_32_a00` for the carrier without inserts or " - "`hamilton_tube_carrier_32_a00_insert_eppendorf_1_5mL` for the carrier " - "with Eppendorf 1.5 mL inserts.", + "The true dimensions of a Tube_CAR_32_A00 (SMP_CAR_32_A00) are not known. " + "The hamilton definitions are with inserts. " + "Do you want to use `hamilton_tube_carrier_32_a00_insert_eppendorf_1_5mL` instead?", DeprecationWarning, - stacklevel=2, - ) - return hamilton_tube_carrier_32_a00(name) - - -def hamilton_tube_carrier_32_a00(name: str) -> TubeCarrier: - """Hamilton cat. no.: 173410 without inserts. - Hamilton name: 'SMP_CAR_32_A00'. - 'Sample' carrier for 32 tubes. - 1 track(T) wide. - - The 15 mm site pitch and centerline are inherited from the verified - insert-specific definition. The bare-hole diameter and tube-support Z were - measured directly. - """ - hole_diameter = 13.4 - return TubeCarrier( - name=name, - size_x=22.5, # 1 track - size_y=497.0, # standard - size_z=60.0, # measured without inserts - sites=create_homogeneous_resources( - klass=ResourceHolder, - locations=[ - Coordinate( - 14.5 - hole_diameter / 2, - 14.5 - hole_diameter / 2 + x * 15, - 50.2, - ) - for x in range(32) - ], - resource_size_x=hole_diameter, - resource_size_y=hole_diameter, - name_prefix=name, - ), - model=hamilton_tube_carrier_32_a00.__name__, ) + return hamilton_tube_carrier_32_a00_insert_eppendorf_1_5mL(name) def hamilton_tube_carrier_32_a00_insert_eppendorf_1_5mL(name: str) -> TubeCarrier: diff --git a/pylabrobot/resources/mckesson/tubes.py b/pylabrobot/resources/mckesson/tubes.py index 5cc310275a4..0d803a42e91 100644 --- a/pylabrobot/resources/mckesson/tubes.py +++ b/pylabrobot/resources/mckesson/tubes.py @@ -2,45 +2,38 @@ from pylabrobot.resources.tube import Tube, TubeBottomType -_MCKESSON_TUBE_5ML_RB_HEIGHT_PER_UL = 0.01175032 -_MCKESSON_TUBE_5ML_RB_HEIGHT_INTERCEPT = 3.622768533 - - -def _compute_height_from_volume_McKesson_tube_5mL_Rb(volume: float) -> float: - """Compute liquid height in mm from volume in uL using the measured linear fit.""" - return _MCKESSON_TUBE_5ML_RB_HEIGHT_PER_UL * volume + _MCKESSON_TUBE_5ML_RB_HEIGHT_INTERCEPT +def McKesson_tube_5mL_Rb(name: str) -> Tube: + """McKesson Premium Glass Culture Tube, manufacturer no. 177-1505. -def _compute_volume_from_height_McKesson_tube_5mL_Rb(height: float) -> float: - """Compute volume in uL from liquid height in mm using the measured linear fit.""" - return (height - _MCKESSON_TUBE_5ML_RB_HEIGHT_INTERCEPT) / _MCKESSON_TUBE_5ML_RB_HEIGHT_PER_UL + The uncapped borosilicate tube has a round bottom and a fire-polished rim. + The cavity floor is modeled 1 mm above the outside base. + Liquid heights are approximated by a linear fit in mm above the cavity floor. + The table bounds the fit to the nominal 0–5,000 uL capacity. The positive + height at zero volume is the fit's extrapolated intercept. -def McKesson_tube_5mL_Rb(name: str) -> Tube: - """McKesson Premium Glass Culture Tube, manufacturer no. 177-1505. + Manufacturer specification + https://imgcdn.mckesson.com/CumulusWeb/Click_and_learn/premium_glass_culture_tubes_tear_sheet_2018-07.pdf - - Manufacturer: McKesson - - Manufacturer number: 177-1505 - - Material: borosilicate glass - - Outside diameter: 12 mm - - Length: 75 mm - - Volume: 5 mL - - Bottom: round - - Rim: fire-polished - - Additive: plain - - Sterility: non-sterile - - Closure: none - - Manufacturer URL: https://mms.mckesson.com/product/1082085/McKesson-Brand-177-1505 + Args: + name: Name of the tube. """ - diameter = 12 + diameter = 12 # from spec, outside diameter in mm + capacity = 5_000 # from spec, nominal capacity in uL + height_per_volume = 0.01175032 # measured fit, mm/uL + height_intercept = 3.622768533 # measured fit, mm return Tube( name=name, size_x=diameter, size_y=diameter, - size_z=75, + size_z=75, # from spec + material_z_thickness=1.0, # estimated cavity-floor offset in mm model=McKesson_tube_5mL_Rb.__name__, - max_volume=5_000, - bottom_type=TubeBottomType.U, - compute_volume_from_height=_compute_volume_from_height_McKesson_tube_5mL_Rb, - compute_height_from_volume=_compute_height_from_volume_McKesson_tube_5mL_Rb, + max_volume=capacity, + bottom_type=TubeBottomType.U, # from spec + height_volume_data={ + height_intercept: 0, + height_intercept + height_per_volume * capacity: capacity, + }, ) diff --git a/pylabrobot/resources/mckesson/tubes_tests.py b/pylabrobot/resources/mckesson/tubes_tests.py index b22eb71d0b7..62eaeab72b2 100644 --- a/pylabrobot/resources/mckesson/tubes_tests.py +++ b/pylabrobot/resources/mckesson/tubes_tests.py @@ -1,29 +1,21 @@ +import json import unittest from pylabrobot.resources import McKesson_tube_5mL_Rb -from pylabrobot.resources.mckesson import McKesson_tube_5mL_Rb as package_factory -from pylabrobot.resources.tube import TubeBottomType +from pylabrobot.resources.tube import Tube, TubeBottomType class McKessonTubeTests(unittest.TestCase): - def test_mckesson_tube_5ml_rb(self): - self.assertIs(McKesson_tube_5mL_Rb, package_factory) - + def test_geometry_and_calibration_survive_json_round_trip(self): tube = McKesson_tube_5mL_Rb(name="mckesson_tube") - self.assertEqual(tube.name, "mckesson_tube") - self.assertEqual(tube.model, "McKesson_tube_5mL_Rb") - self.assertEqual(tube.get_size_x(), 12) - self.assertEqual(tube.get_size_y(), 12) - self.assertEqual(tube.get_size_z(), 75) - self.assertEqual(tube.max_volume, 5_000) - self.assertEqual(tube.bottom_type, TubeBottomType.U) - self.assertTrue(tube.supports_compute_height_volume_functions()) + restored = Tube.deserialize(json.loads(json.dumps(tube.serialize()))) + + self.assertEqual(restored.bottom_type, TubeBottomType.U) + self.assertEqual(restored.get_anchor(z="cavity_bottom").z, 1.0) + self.assertAlmostEqual(restored.compute_height_from_volume(2_500), 32.998568533) + self.assertAlmostEqual(restored.compute_volume_from_height(32.998568533), 2_500) - self.assertAlmostEqual(tube.compute_height_from_volume(0), 3.622768533) - self.assertAlmostEqual(tube.compute_height_from_volume(2_500), 32.998568533) - self.assertAlmostEqual(tube.compute_height_from_volume(5_000), 62.374368533) - self.assertAlmostEqual(tube.compute_volume_from_height(32.998568533), 2_500) - self.assertAlmostEqual( - tube.compute_volume_from_height(0), - (0 - 3.622768533) / 0.01175032, - ) + def test_height_outside_nominal_fit_raises(self): + tube = McKesson_tube_5mL_Rb(name="mckesson_tube") + with self.assertRaises(ValueError): + tube.compute_volume_from_height(0) From 760513008e5b4866adf98f27354abe88a79fd3f7 Mon Sep 17 00:00:00 2001 From: Harley King Date: Tue, 17 Nov 2026 06:54:09 -0500 Subject: [PATCH 7/7] Calibrate McKesson tube height and volume from measurements --- pylabrobot/resources/mckesson/tubes.py | 27 ++++++++++++-------- pylabrobot/resources/mckesson/tubes_tests.py | 21 --------------- 2 files changed, 17 insertions(+), 31 deletions(-) delete mode 100644 pylabrobot/resources/mckesson/tubes_tests.py diff --git a/pylabrobot/resources/mckesson/tubes.py b/pylabrobot/resources/mckesson/tubes.py index 0d803a42e91..769a99e3676 100644 --- a/pylabrobot/resources/mckesson/tubes.py +++ b/pylabrobot/resources/mckesson/tubes.py @@ -9,9 +9,10 @@ def McKesson_tube_5mL_Rb(name: str) -> Tube: The uncapped borosilicate tube has a round bottom and a fire-polished rim. The cavity floor is modeled 1 mm above the outside base. - Liquid heights are approximated by a linear fit in mm above the cavity floor. - The table bounds the fit to the nominal 0–5,000 uL capacity. The positive - height at zero volume is the fit's extrapolated intercept. + Height and volume are converted by piecewise-linear interpolation of measured + liquid heights. The measured range is 200–5,000 uL, corresponding to + 2.50–56.32 mm above the cavity floor. Values outside these ranges raise + ValueError. Manufacturer specification https://imgcdn.mckesson.com/CumulusWeb/Click_and_learn/premium_glass_culture_tubes_tear_sheet_2018-07.pdf @@ -20,20 +21,26 @@ def McKesson_tube_5mL_Rb(name: str) -> Tube: name: Name of the tube. """ diameter = 12 # from spec, outside diameter in mm - capacity = 5_000 # from spec, nominal capacity in uL - height_per_volume = 0.01175032 # measured fit, mm/uL - height_intercept = 3.622768533 # measured fit, mm + material_z_thickness = 1.0 # estimated cavity-floor offset in mm return Tube( name=name, size_x=diameter, size_y=diameter, size_z=75, # from spec - material_z_thickness=1.0, # estimated cavity-floor offset in mm + material_z_thickness=material_z_thickness, model=McKesson_tube_5mL_Rb.__name__, - max_volume=capacity, + max_volume=5_000, # from spec, nominal capacity in uL bottom_type=TubeBottomType.U, # from spec + # Subtract the floor offset from the measured heights above the outside base. height_volume_data={ - height_intercept: 0, - height_intercept + height_per_volume * capacity: capacity, + 3.5 - material_z_thickness: 200, + 6.3 - material_z_thickness: 400, + 9.28 - material_z_thickness: 600, + 11.12 - material_z_thickness: 800, + 13.2 - material_z_thickness: 1_000, + 24.95 - material_z_thickness: 2_000, + 36.31 - material_z_thickness: 3_000, + 47.33 - material_z_thickness: 4_000, + 57.32 - material_z_thickness: 5_000, }, ) diff --git a/pylabrobot/resources/mckesson/tubes_tests.py b/pylabrobot/resources/mckesson/tubes_tests.py deleted file mode 100644 index 62eaeab72b2..00000000000 --- a/pylabrobot/resources/mckesson/tubes_tests.py +++ /dev/null @@ -1,21 +0,0 @@ -import json -import unittest - -from pylabrobot.resources import McKesson_tube_5mL_Rb -from pylabrobot.resources.tube import Tube, TubeBottomType - - -class McKessonTubeTests(unittest.TestCase): - def test_geometry_and_calibration_survive_json_round_trip(self): - tube = McKesson_tube_5mL_Rb(name="mckesson_tube") - restored = Tube.deserialize(json.loads(json.dumps(tube.serialize()))) - - self.assertEqual(restored.bottom_type, TubeBottomType.U) - self.assertEqual(restored.get_anchor(z="cavity_bottom").z, 1.0) - self.assertAlmostEqual(restored.compute_height_from_volume(2_500), 32.998568533) - self.assertAlmostEqual(restored.compute_volume_from_height(32.998568533), 2_500) - - def test_height_outside_nominal_fit_raises(self): - tube = McKesson_tube_5mL_Rb(name="mckesson_tube") - with self.assertRaises(ValueError): - tube.compute_volume_from_height(0)