Source code for ts_ids_components.xrd.run
"""
Run component for XRD IDSs.
:py:class:`XrdRun` extends the generic
:py:class:`Run <ts_ids_core.schema.run.Run>` component with the field common
to XRD instruments: a standardized measurement start/end timestamp.
``XrdRun`` carries a ``pk``
(:py:data:`UUIDPrimaryKey <ts_ids_core.annotations.UUIDPrimaryKey>`) so a
consuming IDS can declare it as a top-level array (``runs: List[XrdRun]``)
and datacubes (see :py:mod:`ts_ids_components.xrd.datacube` and
:py:mod:`ts_ids_components.xrd.datacube_raw`) can reference the specific run
that produced them via ``fk_run``, 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 Run, Time
[docs]
class XrdRun(Run):
"""A single XRD measurement run, with a standardized start/end timestamp."""
pk: UUIDPrimaryKey = IdsField(
description="Primary key for this run, referenced by datacubes belonging to it."
)
time: Time = IdsField(description="Start and end timestamp of the measurement run.")