Skip to content

types¤

Custom type annotations.

EnumType module-attribute ¤

EnumType = TypeVar('EnumType', bound=Enum)

An Enum subclass.

MessageDataType module-attribute ¤

MessageDataType = (
    type[int] | type[float] | str | type[number]
)

Data type to use to read/write bytes from/to equipment.

MessageFormat module-attribute ¤

MessageFormat = Literal['ascii', 'hp', 'ieee']

Format to use to read/write bytes from/to equipment.

NumpyArray1D module-attribute ¤

NumpyArray1D = ndarray[tuple[int], dtype[number]]

A 1-dimensional numpy.array of numbers.

PathLike module-attribute ¤

Sequence1D module-attribute ¤

Sequence1D = Sequence[float] | NumpyArray1D

A 1-dimensional sequence of numbers.

XMLSource module-attribute ¤

A path-like object or a file-like object for parsing XML content.

SupportsRead ¤

Bases: Protocol[_T_co]

A file-like object that has a read method.

read ¤

read(size: int | None = -1) -> _T_co

Read from the stream.

Source code in src/msl/equipment/_types.py
18
19
20
def read(self, size: int | None = -1, /) -> _T_co:
    """Read from the stream."""
    ...