|
| 1 | +"""Unit test validating center-center coordinates of Hamilton |
| 2 | +tip spots across all PLR-integrated Hamilton tip racks. |
| 3 | +
|
| 4 | +These tests instantiate Hamilton tip rack models, compute each |
| 5 | +rack's representative H1 tip spot position relative to the tip rack origin |
| 6 | +and verify that the reported center-center coordinates match |
| 7 | +expected reference values. |
| 8 | +""" |
| 9 | + |
| 10 | +import unittest |
| 11 | + |
| 12 | +from pylabrobot.resources.carrier import Coordinate |
| 13 | +from pylabrobot.resources.hamilton import ( |
| 14 | + hamilton_96_tiprack_10uL, |
| 15 | + hamilton_96_tiprack_10uL_filter, |
| 16 | + hamilton_96_tiprack_50uL, |
| 17 | + hamilton_96_tiprack_50uL_filter, |
| 18 | + hamilton_96_tiprack_50uL_NTR, |
| 19 | + hamilton_96_tiprack_300uL, |
| 20 | + hamilton_96_tiprack_300uL_filter, |
| 21 | + hamilton_96_tiprack_300uL_filter_slim, |
| 22 | + hamilton_96_tiprack_1000uL, |
| 23 | + hamilton_96_tiprack_1000uL_filter, |
| 24 | + hamilton_96_tiprack_1000uL_filter_ultrawide, |
| 25 | + hamilton_96_tiprack_1000uL_filter_wide, |
| 26 | +) |
| 27 | +from pylabrobot.resources.tip_rack import TipRack |
| 28 | + |
| 29 | + |
| 30 | +class HamiltonTipSpotTests(unittest.TestCase): |
| 31 | + def test_tipspot_h1_cc(self): |
| 32 | + """Tests for PLR-integrated Hamilton TipRacks' accurate TipSpot center-center coordinates.""" |
| 33 | + |
| 34 | + def check_tip_spot_h1(tr: TipRack, expect: Coordinate): |
| 35 | + h1_loc = tr.get_item("H1").get_absolute_location("c", "c") |
| 36 | + assert h1_loc.x == expect.x and h1_loc.y == expect.y, f"{h1_loc} != {expect}" |
| 37 | + |
| 38 | + common_tip_rack_loc = Coordinate(x=11.7, y=9.8, z=-22.5) |
| 39 | + check_tip_spot_h1(hamilton_96_tiprack_10uL_filter("tr"), common_tip_rack_loc) |
| 40 | + check_tip_spot_h1(hamilton_96_tiprack_10uL(name="tr"), common_tip_rack_loc) |
| 41 | + check_tip_spot_h1(hamilton_96_tiprack_50uL_filter(name="tr"), common_tip_rack_loc) |
| 42 | + check_tip_spot_h1(hamilton_96_tiprack_50uL(name="tr"), common_tip_rack_loc) |
| 43 | + check_tip_spot_h1(hamilton_96_tiprack_300uL_filter(name="tr"), common_tip_rack_loc) |
| 44 | + check_tip_spot_h1(hamilton_96_tiprack_300uL(name="tr"), common_tip_rack_loc) |
| 45 | + check_tip_spot_h1(hamilton_96_tiprack_300uL_filter_slim(name="tr"), common_tip_rack_loc) |
| 46 | + check_tip_spot_h1(hamilton_96_tiprack_1000uL_filter(name="tr"), common_tip_rack_loc) |
| 47 | + check_tip_spot_h1(hamilton_96_tiprack_1000uL(name="tr"), common_tip_rack_loc) |
| 48 | + check_tip_spot_h1(hamilton_96_tiprack_1000uL_filter_wide(name="tr"), common_tip_rack_loc) |
| 49 | + check_tip_spot_h1(hamilton_96_tiprack_1000uL_filter_ultrawide(name="tr"), common_tip_rack_loc) |
| 50 | + |
| 51 | + ntr_loc = Coordinate(x=13.525, y=11.625, z=13.5) |
| 52 | + check_tip_spot_h1(hamilton_96_tiprack_50uL_NTR(name="tr"), ntr_loc) |
0 commit comments