nitypes.scalar.Scalar ===================== .. py:class:: nitypes.scalar.Scalar(value: TScalar_co, units: str = '') Bases: :py:obj:`Generic`\ [\ :py:obj:`TScalar_co`\ ] A scalar data class, which encapsulates scalar data and units information. Constructing ^^^^^^^^^^^^ To construct a scalar data object, use the :class:`Scalar` class: >>> Scalar(False) nitypes.scalar.Scalar(value=False, units='') >>> Scalar(0) nitypes.scalar.Scalar(value=0, units='') >>> Scalar(5.0, 'volts') nitypes.scalar.Scalar(value=5.0, units='volts') >>> Scalar("value", "volts") nitypes.scalar.Scalar(value='value', units='volts') Class members ^^^^^^^^^^^^^ .. py:attribute:: __slots__ :value: ['_value', '_extended_properties'] .. py:property:: value :type: TScalar_co The scalar value. .. py:property:: units :type: str The unit of measurement, such as volts, of the scalar. .. py:property:: extended_properties :type: nitypes.waveform.ExtendedPropertyDictionary The extended properties for the scalar. .. note:: Data stored in the extended properties dictionary may not be encrypted when you send it over the network or write it to a TDMS file. .. py:method:: __eq__(value: object, /) -> bool Return self==value. .. py:method:: __gt__(value: Scalar[TScalar_co]) -> bool Return self > value. .. py:method:: __ge__(value: Scalar[TScalar_co]) -> bool Return self >= value. .. py:method:: __lt__(value: Scalar[TScalar_co]) -> bool Return self < value. .. py:method:: __le__(value: Scalar[TScalar_co]) -> bool Return self <= value. .. py:method:: __reduce__() -> tuple[Any, Ellipsis] Return object state for pickling. .. py:method:: __repr__() -> str Return repr(self). .. py:method:: __str__() -> str Return str(self).