Example #1
0
 def test_equality(self, well_fac, rack_position_fac):
     kw = well_fac.init_kw
     c1 = rack_position_fac(row_index=2, column_index=0)
     kw['id'] = 1
     kw['position'] = c1
     well1 = Well.create_from_rack_and_position(**kw)
     d1 = rack_position_fac(row_index=3, column_index=0)
     kw['id'] = 2
     kw['position'] = d1
     well2 = Well.create_from_rack_and_position(**kw)
     well3 = Well.create_from_rack_and_position(**kw)
     well3.id = well2.id
     assert well1 != well2
     assert well2 == well3
Example #2
0
 def test_init(self, well_fac):
     kw = well_fac.init_kw
     well = Well.create_from_rack_and_position(**kw)
     assert well.rack.barcode == kw['rack'].barcode
     assert well.position == kw['position']
     check_attributes(well, kw)
     assert well.slug == well.position.label
Example #3
0
 def __init_wells(self):
     c_specs = self.specs.well_specs
     containers = []
     cp_map = {}
     # We fetch all the rack positions in one query to speed up things.
     shape = self.specs.shape
     agg = get_root_aggregate(IRackPosition)
     agg.filter = lt(_row_index=shape.number_rows) \
                  & lt(_column_index=shape.number_columns)
     iterator = agg.iterator()
     while True:
         try:
             rack_pos = iterator.next()
         except StopIteration:
             break
         else:
             well = Well.create_from_rack_and_position(
                 c_specs, self.status, self, rack_pos)
             containers.append(well)
             cp_map[rack_pos] = well
     self.containers = containers
     return cp_map
Example #4
0
 def __init_wells(self):
     c_specs = self.specs.well_specs
     containers = []
     cp_map = {}
     # We fetch all the rack positions in one query to speed up things.
     shape = self.specs.shape
     agg = get_root_aggregate(IRackPosition)
     agg.filter = lt(_row_index=shape.number_rows) \
                  & lt(_column_index=shape.number_columns)
     iterator = agg.iterator()
     while True:
         try:
             rack_pos = iterator.next()
         except StopIteration:
             break
         else:
             well = Well.create_from_rack_and_position(c_specs,
                                                       self.status,
                                                       self,
                                                       rack_pos)
             containers.append(well)
             cp_map[rack_pos] = well
     self.containers = containers
     return cp_map