def _verify_stock_racks(self): """ Checks the samples in the stock racks (pools and samples). """ self.add_debug('Verify stock racks ..') for stock_rack in self._stock_racks.values(): verifier = StockRackVerifier(stock_rack, parent=self) compatible = verifier.get_result() rack_name = '%s (%s)' % (stock_rack.rack.barcode, stock_rack.label) if compatible is None: msg = 'Error when trying to verify stock rack %s.' % ( rack_name) self.add_error(msg) elif not compatible: msg = 'Stock rack %s does not match the expected layout.' \ % (rack_name) self.add_error(msg) else: layout = verifier.get_expected_layout() barcode = stock_rack.rack.barcode self.__stock_rack_layouts[barcode] = layout if not self.has_errors(): self._check_for_previous_execution()
def _verify_stock_racks(self): """ We convert the layouts separately because the layout have different types. Also the pool stock rack is checked separately because the referring tubes must all be empty. """ self.__verify_pool_stock_rack() num_stock_racks = len(self.entity.iso_stock_racks) incompatible = [] for isr in self.entity.iso_stock_racks: layout = None kw = dict(rack_layout=isr.rack_layout, parent=self) rack_name = "%s (%s)" % (isr.rack.barcode, isr.label) if isr.label == self.__pool_stock_rack.label: continue # has been checked separately elif num_stock_racks == 2: converter_cls = SingleDesignStockRackLayoutConverter else: converter_cls = StockRackLayoutConverter converter = converter_cls(**kw) layout = converter.get_result() if layout is None: msg = "Error when trying to convert stock rack layout for " "rack %s!" % (rack_name) self.add_error(msg) else: verifier = StockRackVerifier(isr, stock_rack_layout=layout, parent=self) compatible = verifier.get_result() if compatible is None: msg = "Error when trying to verify stock rack %s." % (rack_name) self.add_error(msg) elif not compatible: incompatible.append(rack_name) if len(incompatible) > 0: msg = "The following stock racks are not compatible: %s." % (self._get_joined_str(incompatible)) self.add_error(msg)
def _verify_stock_racks(self): """ We convert the layouts separately because the layout have different types. Also the pool stock rack is checked separately because the referring tubes must all be empty. """ self.__verify_pool_stock_rack() num_stock_racks = len(self.entity.iso_stock_racks) incompatible = [] for isr in self.entity.iso_stock_racks: layout = None kw = dict(rack_layout=isr.rack_layout, parent=self) rack_name = '%s (%s)' % (isr.rack.barcode, isr.label) if isr.label == self.__pool_stock_rack.label: continue # has been checked separately elif num_stock_racks == 2: converter_cls = SingleDesignStockRackLayoutConverter else: converter_cls = StockRackLayoutConverter converter = converter_cls(**kw) layout = converter.get_result() if layout is None: msg = 'Error when trying to convert stock rack layout for ' \ 'rack %s!' % (rack_name) self.add_error(msg) else: verifier = StockRackVerifier(isr, stock_rack_layout=layout, parent=self) compatible = verifier.get_result() if compatible is None: msg = 'Error when trying to verify stock rack %s.' \ % (rack_name) self.add_error(msg) elif not compatible: incompatible.append(rack_name) if len(incompatible) > 0: msg = 'The following stock racks are not compatible: %s.' \ % (self._get_joined_str(incompatible)) self.add_error(msg)
def _verify_stock_racks(self): """ Checks the samples in the stock racks (pools and samples). """ self.add_debug('Verify stock racks ..') for stock_rack in self._stock_racks.values(): verifier = StockRackVerifier(stock_rack, parent=self) compatible = verifier.get_result() rack_name = '%s (%s)' % (stock_rack.rack.barcode, stock_rack.label) if compatible is None: msg = 'Error when trying to verify stock rack %s.' % (rack_name) self.add_error(msg) elif not compatible: msg = 'Stock rack %s does not match the expected layout.' \ % (rack_name) self.add_error(msg) else: layout = verifier.get_expected_layout() barcode = stock_rack.rack.barcode self.__stock_rack_layouts[barcode] = layout if not self.has_errors(): self._check_for_previous_execution()