def _check_transfer_volume(self, transfer_volume, target_position, source_position=None): """ Checks whether the transfer volume is in a valid volume range, whether the target container can take that amount and whether there is enough volume in the source container. """ volume = transfer_volume * VOLUME_CONVERSION_FACTOR # Check the minimum and maximum transfer volume. if is_smaller_than(volume, self._min_transfer_volume): error_msg = 'target %s (%.1f ul)' \ % (target_position.label, volume) self._transfer_volume_too_small.append(error_msg) return False if self.TRANSFER_TYPE == TRANSFER_TYPES.SAMPLE_TRANSFER \ and is_larger_than(volume, self._max_transfer_volume): error_msg = 'source %s (%.1f ul)' % (source_position, volume) self._transfer_volume_too_large.append(error_msg) # Check whether there is enough space in the target well. max_volume = \ self.__get_max_volume_for_target_container(target_position) if max_volume is None: return False sample_volume = self._target_volumes[target_position] if is_smaller_than(max_volume, (sample_volume + volume)): error_msg = '%s (sample vol: %.1f, transfer vol: %.1f)' \ % (target_position, sample_volume, volume) self._target_volume_too_large.append(error_msg) return False # Check whether there is enough liquid in the source well if self.TRANSFER_TYPE == TRANSFER_TYPES.SAMPLE_DILUTION: return True if source_position is None: msg = 'You must not pass a None value for the source well ' \ 'when checking the volumes if you have passed a source ' \ 'rack!' self.add_error(msg) return False if not self._source_volumes.has_key(source_position): self._source_container_missing.add(source_position.label) return False source_volume = self._source_volumes[source_position] source_volume -= volume dead_volume = self.__get_dead_volume_for_source_container( source_position) if is_smaller_than(source_volume, dead_volume): self._source_volume_too_small.add(source_position.label) return False self._source_volumes[source_position] = source_volume return True
def get_adjusted_target_volume(self): """ The target volume for the ISO request might need to be increased in order to maintain a accurate target concentration since the minimum step size for all pipetting methods is 0.1 ul. An increase of the target volume can be triggered by both odd single design stock transfer volumes and the buffer volume. Example: Thus, if a volume and concentration combination would result in a stock transfer volume of e.g. 1.333 ul the volume for the single transfer is increased to 1.4 ul and the target volume adjusted accordingly. The adjusted target concentration is determined in the :func:get_single_stock_transfer_volume` method. If no adjustment has taken place, the method returns *None*. """ if is_larger_than(self.__adjusted_target_vol, self.__target_volume): return self.__adjusted_target_vol else: return None