Пример #1
0
 def _check_input(self):
     """
     Checks the initialisation values.
     """
     StockTransferWriterExecutor._check_input(self)
     if not self.has_errors():
         self._iso_request = self.entity.iso_request
Пример #2
0
 def _check_input(self):
     """
     Checks the initialisation values.
     """
     StockTransferWriterExecutor._check_input(self)
     if not self.has_errors():
         self._iso_request = self.entity.iso_request
Пример #3
0
    def __init__(self, iso, user, **kw):
        """
        Constructor.

        :param iso: The stock sample creation ISO for which to execute the
            worklists.
        :type iso: :class:`thelma.entities.iso.StockSampleCreationIso`
        :param user: The user conducting the execution.
        :type user: :class:`thelma.entities.user.User`
        """
        StockTransferWriterExecutor.__init__(
            self,
            user=user,
            entity=iso,
            mode=StockTransferWriterExecutor.MODE_EXECUTE,
            **kw)
        #: The stock sample creation layout for this ISO.
        self.__ssc_layout = None
        #: The :class:`IsoRackContainer` for each stock rack mapped onto
        #: rack marker.
        self.__rack_containers = None
        #: The stock rack that serves as target rack (:class:`IsoStockRack`).
        self.__pool_stock_rack = None
        #: The stock transfer worklist is the only worklist in the stock rack
        #: series.
        self.__stock_transfer_worklist = None
        #: The indices for the rack transfer jobs mapped onto the worklist
        #: they belong to.
        self.__rack_transfer_indices = None
        #: Positions without ISO positions (i.e. without transfer).
        self.__ignore_positions = None
Пример #4
0
    def __init__(self, iso, user, **kw):
        """
        Constructor.

        :param iso: The stock sample creation ISO for which to execute the
            worklists.
        :type iso: :class:`thelma.entities.iso.StockSampleCreationIso`
        :param user: The user conducting the execution.
        :type user: :class:`thelma.entities.user.User`
        """
        StockTransferWriterExecutor.__init__(
            self, user=user, entity=iso, mode=StockTransferWriterExecutor.MODE_EXECUTE, **kw
        )
        #: The stock sample creation layout for this ISO.
        self.__ssc_layout = None
        #: The :class:`IsoRackContainer` for each stock rack mapped onto
        #: rack marker.
        self.__rack_containers = None
        #: The stock rack that serves as target rack (:class:`IsoStockRack`).
        self.__pool_stock_rack = None
        #: The stock transfer worklist is the only worklist in the stock rack
        #: series.
        self.__stock_transfer_worklist = None
        #: The indices for the rack transfer jobs mapped onto the worklist
        #: they belong to.
        self.__rack_transfer_indices = None
        #: Positions without ISO positions (i.e. without transfer).
        self.__ignore_positions = None
Пример #5
0
 def reset(self):
     StockTransferWriterExecutor.reset(self)
     self.__ssc_layout = None
     self.__rack_containers = dict()
     self.__pool_stock_rack = None
     self.__stock_transfer_worklist = None
     self.__rack_transfer_indices = dict()
     self.__ignore_positions = []
Пример #6
0
 def reset(self):
     StockTransferWriterExecutor.reset(self)
     self.__ssc_layout = None
     self.__rack_containers = dict()
     self.__pool_stock_rack = None
     self.__stock_transfer_worklist = None
     self.__rack_transfer_indices = dict()
     self.__ignore_positions = []
Пример #7
0
 def _check_input(self):
     """
     Checks the initialisation values.
     """
     StockTransferWriterExecutor._check_input(self)
     if not self.has_errors() and not self.entity.status == ISO_STATUS.QUEUED:
         msg = 'Unexpected ISO status: "%s"' % (self.entity.status)
         self.add_error(msg)
Пример #8
0
 def _check_input(self):
     """
     Checks the initialisation values.
     """
     StockTransferWriterExecutor._check_input(self)
     if not self.has_errors() and \
                             not self.entity.status == ISO_STATUS.QUEUED:
         msg = 'Unexpected ISO status: "%s"' % (self.entity.status)
         self.add_error(msg)
Пример #9
0
    def __init__(self, entity, mode, user=None, **kw):
        """
        Constructor:

        :param entity: The ISO job or ISO to process.
        :type entity: :class:`thelma.entities.job.IsoJob` or
            :class:`thelma.entities.iso.LabIso`.

        :param mode: :attr:`MODE_EXECUTE` or :attr:`MODE_PRINT_WORKLISTS`
        :type mode: str

        :param user: The user who conducts the DB update (required for
            execution mode).
        :type user: :class:`thelma.entities.user.User`
        :default user: *None*
        """
        StockTransferWriterExecutor.__init__(self,
                                             entity=entity,
                                             mode=mode,
                                             user=user,
                                             **kw)

        #: The lab ISO requests the entity belongs to.
        self._iso_request = None
        #: The final layout for each ISO in this entity mapped onto ISOs.
        self.__final_layouts = None
        #: see :class:`LAB_ISO_ORDERS`.
        self._processing_order = None
        #: The expected :class:`ISO_STATUS.
        self._expected_iso_status = None

        #: The involved racks (as list of :class:`IsoRackContainer`
        #: objects) mapped onto rack markers. Final plates are mapped onto the
        #: :attr:`LABELS.ROLE_FINAL` marker.
        self.__rack_containers = None
        #: The final plates (as list of :class:`IsoRackContainer` objects)
        #: mapped onto ISOs.
        self.__final_plates = None
        #: The layout for each plate mapped onto plate label.
        self.__plate_layouts = None
        #: The ignored positions for each plate.
        self.__ignored_positions = None
        #: The stock rack for this entity mapped onto labels.
        self._stock_racks = None
        #: The stock rack layouts mapped onto stock rack barcodes
        #: (for reporting).
        self.__stock_rack_layouts = None

        #: The job indices for the buffer dilutions.
        self.__buffer_dilution_indices = None
        #: The merged stream for the buffer dilutions (printer mode only).
        self.__buffer_stream = None

        #: The source :class:`ReservoirSpecs` for the dilution jobs.
        self.__dilution_rs = get_reservoir_spec(self.DILUTION_RESERVOIR_SPECS)
Пример #10
0
    def __init__(self, entity, mode, user=None, **kw):
        """
        Constructor:

        :param entity: The ISO job or ISO to process.
        :type entity: :class:`thelma.entities.job.IsoJob` or
            :class:`thelma.entities.iso.LabIso`.

        :param mode: :attr:`MODE_EXECUTE` or :attr:`MODE_PRINT_WORKLISTS`
        :type mode: str

        :param user: The user who conducts the DB update (required for
            execution mode).
        :type user: :class:`thelma.entities.user.User`
        :default user: *None*
        """
        StockTransferWriterExecutor.__init__(self, entity=entity, mode=mode,
                                             user=user, **kw)

        #: The lab ISO requests the entity belongs to.
        self._iso_request = None
        #: The final layout for each ISO in this entity mapped onto ISOs.
        self.__final_layouts = None
        #: see :class:`LAB_ISO_ORDERS`.
        self._processing_order = None
        #: The expected :class:`ISO_STATUS.
        self._expected_iso_status = None

        #: The involved racks (as list of :class:`IsoRackContainer`
        #: objects) mapped onto rack markers. Final plates are mapped onto the
        #: :attr:`LABELS.ROLE_FINAL` marker.
        self.__rack_containers = None
        #: The final plates (as list of :class:`IsoRackContainer` objects)
        #: mapped onto ISOs.
        self.__final_plates = None
        #: The layout for each plate mapped onto plate label.
        self.__plate_layouts = None
        #: The ignored positions for each plate.
        self.__ignored_positions = None
        #: The stock rack for this entity mapped onto labels.
        self._stock_racks = None
        #: The stock rack layouts mapped onto stock rack barcodes
        #: (for reporting).
        self.__stock_rack_layouts = None

        #: The job indices for the buffer dilutions.
        self.__buffer_dilution_indices = None
        #: The merged stream for the buffer dilutions (printer mode only).
        self.__buffer_stream = None

        #: The source :class:`ReservoirSpecs` for the dilution jobs.
        self.__dilution_rs = get_reservoir_spec(self.DILUTION_RESERVOIR_SPECS)
Пример #11
0
 def reset(self):
     StockTransferWriterExecutor.reset(self)
     self._iso_request = None
     self.__final_layouts = dict()
     self._processing_order = None
     self._expected_iso_status = None
     self.__rack_containers = dict()
     self.__final_plates = dict()
     self.__plate_layouts = dict()
     self.__ignored_positions = dict()
     self._stock_racks = dict()
     self.__stock_rack_layouts = dict()
     self.__buffer_dilution_indices = set()
     self.__buffer_stream = None
Пример #12
0
 def reset(self):
     StockTransferWriterExecutor.reset(self)
     self._iso_request = None
     self.__final_layouts = dict()
     self._processing_order = None
     self._expected_iso_status = None
     self.__rack_containers = dict()
     self.__final_plates = dict()
     self.__plate_layouts = dict()
     self.__ignored_positions = dict()
     self._stock_racks = dict()
     self.__stock_rack_layouts = dict()
     self.__buffer_dilution_indices = set()
     self.__buffer_stream = None
Пример #13
0
    def _merge_streams(self, stream_map):
        """
        All buffer streams are merged too.
        """
        dilution_streams = dict()
        for job_index in self.__buffer_dilution_indices:
            dilution_streams[job_index] = stream_map[job_index]
            del stream_map[job_index]

        if len(dilution_streams) > 0:
            self.__buffer_stream = merge_csv_streams(dilution_streams)
        return StockTransferWriterExecutor._merge_streams(self, stream_map)
Пример #14
0
    def _merge_streams(self, stream_map):
        """
        All buffer streams are merged too.
        """
        dilution_streams = dict()
        for job_index in self.__buffer_dilution_indices:
            dilution_streams[job_index] = stream_map[job_index]
            del stream_map[job_index]

        if len(dilution_streams) > 0:
            self.__buffer_stream = merge_csv_streams(dilution_streams)
        return StockTransferWriterExecutor._merge_streams(self, stream_map)