def generate_deck(self): deck = Deck() slot = Slot() deck.add(slot, 'A1', (5, 10, 0)) c = Container() red = Well(properties={'radius': 5}) blue = Well(properties={'radius': 5}) c.add(red, "Red", (5, 5, 0)) c.add(blue, "Blue", (15, 5, 0)) slot.add(c, 'tube_rack') return deck
def test_coordinates(self): deck = Deck() slot = Slot() plate = self.generate_plate(wells=96, cols=8, spacing=(10, 15), offset=(5, 15), radius=5) deck.add(slot, 'B2', (100, 200, 0)) slot.add(plate) self.assertEqual(plate['A1'].coordinates(deck), (105, 215, 0))
def test_get_name(self): 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) self.assertEqual(red.get_name(), 'Red')
def test_top_bottom(self): deck = Deck() slot = Slot() plate = self.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) self.assertEqual(plate['A1'].bottom(10), (plate['A1'], Vector(5, 5, 10))) self.assertEqual(plate['A1'].top(10), (plate['A1'], Vector(5, 5, 20)))
def test_well_from_center(self): deck = Deck() slot = Slot() plate = self.generate_plate(wells=4, cols=2, spacing=(10, 10), offset=(0, 0), radius=5) deck.add(slot, 'A1', (0, 0, 0)) slot.add(plate) self.assertEqual(plate['B2'].center(), (5, 5, 0)) self.assertEqual(plate['B2'].from_center(x=0.0, y=0.0, z=0.0), (5, 5, 0)) self.assertEqual( plate['B2'].from_center(r=1.0, theta=math.pi / 2, h=0.0), (5.0, 10.0, 0.0))