Source code for ts_ids_components.xrd.system

"""
System component for XRD IDSs.

:py:class:`XrdSystem` extends the generic
:py:class:`System <ts_ids_core.schema.system.System>` component with the
fields common to XRD instruments: a human-readable system name and serial
number.

``XrdSystem`` carries a ``pk``
(:py:data:`UUIDPrimaryKey <ts_ids_core.annotations.UUIDPrimaryKey>`) so a
consuming IDS can declare it as a top-level array (``systems: List[XrdSystem]``)
and datacubes (see :py:mod:`ts_ids_components.xrd.datacube` and
:py:mod:`ts_ids_components.xrd.datacube_raw`) can reference the specific
system that produced them via ``fk_system``, rather than relying on a
file-wide singleton. ``pk`` values must still be generated deterministically
by the task script (seeded from file content and task script identity), not
by this component.
"""

from ts_ids_core.annotations import UUIDPrimaryKey
from ts_ids_core.base.ids_field import IdsField
from ts_ids_core.schema import System


[docs] class XrdSystem(System, System.Name, System.SerialNumber): """Instrument system information common to all XRD vendors.""" pk: UUIDPrimaryKey = IdsField( description="Primary key for this system, referenced by datacubes belonging to it." )