示例#1
0
    def get_y_axis_info(self) -> Tuple[DataValueType, DataUnit]:
        """
		Returns the type of data represented by the y-axis, and the corresponding unit.
		"""

        _, unit, value_type = self.interface.GetYAxisInfoChrom(0, 0)
        return DataValueType(value_type), DataUnit(unit)
示例#2
0
    def get_x_axis_info(self) -> Tuple[DataValueType, DataUnit]:
        """
		Returns the type of data represented by the x-axis, and the corresponding unit.
		"""

        _, unit, value_type = self.data_reader.GetXAxisInfo(0, 0)
        return DataValueType(value_type), DataUnit(unit)
示例#3
0
    def get_y_axis_info(self) -> Tuple[DataValueType, Union[DataUnit, str]]:
        """
		Returns the type of data represented by the y-axis, and the corresponding unit.
		"""

        _, unit, value_type, label = self.data_reader.GetYAxisInfo(0, 0, '')

        if unit == DataUnit.ResponseUnits:
            return DataValueType(value_type), str(label)
        else:
            return DataValueType(value_type), DataUnit(unit)
示例#4
0
def axis_info_converter(info: Sequence[int]) -> Tuple[DataValueType, DataUnit]:
    """
	Converter for :meth:`~pyms_agilent.mhdac.chromatograms.InstrumentCurve.get_x_axis_info` in
	:class:`~pyms_agilent.mhdac.chromatograms.InstrumentCurve`.

	:param info: 2-element long sequence comprising the data value type and data unit.

	:return: 2-element tuple comprising :class:`~enum.Enum` members representing the same.
	"""  # noqa: D400

    value_type, unit, *_ = info
    return DataValueType(value_type), DataUnit(unit)
示例#5
0
def y_axis_info_converter(
    info: Sequence[Union[int,
                         str]]) -> Tuple[DataValueType, Union[DataUnit, str]]:
    """
	Converter for :meth:`~pyms_agilent.mhdac.chromatograms.InstrumentCurve.get_y_axis_info` in
	:class:`~pyms_agilent.mhdac.chromatograms.InstrumentCurve`.

	:param info: A 2-element long sequence comprising the data value type and either the unit type or a textual unit label.

	:return: 2-element tuple comprising :class:`~enum.Enum` members representing the same.
		If the data value type is :py:enum:mem`~DataUnit.ResponseUnits` the second element will instead be
		the textual label.
	"""  # noqa: D400

    value_type, unit_or_label, *_ = info

    if isinstance(unit_or_label, str):
        return DataValueType(value_type), unit_or_label
    else:
        return DataValueType(value_type), DataUnit(unit_or_label)