def test_get_name(robot): deck = Deck() slot = Slot() c = Container() deck.add(slot, 'A1', (0, 0, 0)) red = Well(properties={'radius': 5}) blue = Well(properties={'radius': 5}) c.add(red, "Red", (0, 0, 0)) c.add(blue, "Blue", (10, 0, 0)) slot.add(c) assert red.get_name() == 'Red'
def test_coordinates(robot): deck = Deck() slot = Slot() plate = generate_plate(wells=96, cols=8, spacing=(10, 15), offset=(5, 15), radius=5) deck.add(slot, 'B2', (100, 200, 0)) slot.add(plate) assert plate['A1'].coordinates(deck) == (105, 215, 0)
def test_named_well(robot): deck = Deck() slot = Slot() c = Container() deck.add(slot, 'A1', (0, 0, 0)) red = Well(properties={'radius': 5}) blue = Well(properties={'radius': 5}) c.add(red, "Red", (0, 0, 0)) c.add(blue, "Blue", (10, 0, 0)) slot.add(c) assert deck['A1'][0]['Red'] == red
def test_well_from_center(robot): deck = Deck() slot = Slot() plate = generate_plate(wells=4, cols=2, spacing=(10, 10), offset=(0, 0), radius=5) deck.add(slot, 'A1', (0, 0, 0)) slot.add(plate) assert plate['B2'].center() == (5, 5, 0) assert plate['B2'].from_center(x=0.0, y=0.0, z=0.0) == (5, 5, 0) assert plate['B2'].from_center(r=1.0, theta=math.pi / 2, h=0.0)\ == (5.0, 10.0, 0.0)
def test_well_from_center(): deck = Deck() slot = Slot() plate = generate_plate(wells=4, cols=2, spacing=(10, 10), offset=(0, 0), radius=5, height=20) deck.add(slot, 'A1', (0, 0, 0)) slot.add(plate) assert plate['B2'].center() == (5, 5, 10) assert plate['B2'].from_center(x=0.0, y=0.0, z=2.0) == (5, 5, 30) assert plate['B2'].from_center(r=1.0, theta=pi / 2, h=5.0) == (5, 10, 60) assert plate['B2'].top()[1] == (5, 5, 20) assert plate['B2'].bottom()[1] == (5, 5, 0)
def test_top_bottom(): deck = Deck() slot = Slot() plate = generate_plate( wells=4, cols=2, spacing=(10, 10), offset=(0, 0), radius=5, height=10 ) deck.add(slot, 'A1', (0, 0, 0)) slot.add(plate) assert plate['A1'].bottom(10) == (plate['A1'], Vector(5, 5, 10)) assert plate['A1'].top(10) == (plate['A1'], Vector(5, 5, 20)) assert plate['A1'].bottom(10, radius=1.0, degrees=90) \ == (plate['A1'], Vector(5, 10, 10)) assert plate['A1'].top(10, radius=1.0, degrees=90)\ == (plate['A1'], Vector(5, 10, 20)) assert plate['A1'].bottom(10, radius=0.5, degrees=270)\ == (plate['A1'], Vector(5, 2.5, 10.00)) assert plate['A1'].top(10, radius=0.5, degrees=270)\ == (plate['A1'], Vector(5, 2.5, 20.00))