示例#1
0
文件: base.py 项目: helixyte/TheLMA
    def __init__(self, rack_position, molecule_design_pool, tube_barcode, transfer_targets):
        """
        Constructor.

        :param str tube_barcode: The tube expected at the given position.
        """
        TransferPosition.__init__(
            self, rack_position, molecule_design_pool=molecule_design_pool, transfer_targets=transfer_targets
        )
        if not self.is_fixed:
            msg = "ISO stock rack positions must be fixed positions!"
            raise ValueError(msg)
        self.position_type = None  # we do not need position types here
        if not isinstance(tube_barcode, basestring):
            msg = "The tube barcode must be a string (obtained: %s)." % (tube_barcode.__class__.__name__)
            raise TypeError(msg)
        #: The tube expected at the given position.
        self.tube_barcode = tube_barcode
示例#2
0
文件: base.py 项目: papagr/TheLMA
    def __init__(self, rack_position, molecule_design_pool, tube_barcode,
                 transfer_targets):
        """
        Constructor.

        :param str tube_barcode: The tube expected at the given position.
        """
        TransferPosition.__init__(self,
                                  rack_position,
                                  molecule_design_pool=molecule_design_pool,
                                  transfer_targets=transfer_targets)
        if not self.is_fixed:
            msg = 'ISO stock rack positions must be fixed positions!'
            raise ValueError(msg)
        self.position_type = None  # we do not need position types here
        if not isinstance(tube_barcode, basestring):
            msg = 'The tube barcode must be a string (obtained: %s).' \
                   % (tube_barcode.__class__.__name__)
            raise TypeError(msg)
        #: The tube expected at the given position.
        self.tube_barcode = tube_barcode
示例#3
0
    def _parse_target_tag_value(self, target_tag_value, rack_position,
                                parameter_name):
        """
        Converts the value of a target tag into a TargetTransfer List.
        """
        if target_tag_value is None:
            transfer_targets = []
        else:
            try:
                transfer_targets = TransferPosition.parse_target_tag_value(
                                                        target_tag_value)
            except ValueError:
                error_msg = '"%s" (%s)' % (target_tag_value, rack_position.label)
                add_list_map_element(self.__invalid_target_string, parameter_name,
                                     error_msg)
                return None

        if not self.__are_valid_transfer_targets(transfer_targets,
                                     rack_position, parameter_name):
            return None

        return transfer_targets
示例#4
0
文件: base.py 项目: helixyte/TheLMA
 def __eq__(self, other):
     if not TransferPosition.__eq__(self, other):
         return False
     return self.tube_barcode == other.tube_barcode
示例#5
0
文件: base.py 项目: helixyte/TheLMA
 def _get_parameter_values_map(self):
     parameter_map = TransferPosition._get_parameter_values_map(self)
     parameter_map[self.PARAMETER_SET.TUBE_BARCODE] = self.tube_barcode
     return parameter_map
示例#6
0
文件: base.py 项目: papagr/TheLMA
 def __eq__(self, other):
     if not TransferPosition.__eq__(self, other): return False
     return self.tube_barcode == other.tube_barcode
示例#7
0
文件: base.py 项目: papagr/TheLMA
 def _get_parameter_values_map(self):
     parameter_map = TransferPosition._get_parameter_values_map(self)
     parameter_map[self.PARAMETER_SET.TUBE_BARCODE] = self.tube_barcode
     return parameter_map