Source code for ts_ids_components.particle_sizer.run
"""
Run component for particle sizer IDSs.
:py:class:`ParticleSizerRun` extends the generic
:py:class:`Run <ts_ids_core.schema.run.Run>` component with a vendor record
identifier, a free-text comment, and a standardized start/stop/acquired
timestamp (reusing :py:class:`Time <ts_ids_core.schema.time_.Time>`, whose
``start``/``stop``/``acquired`` fields already cover the timestamps particle
sizer instruments report for a run).
``ParticleSizerRun`` 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[ParticleSizerRun]``)
and methods/results/datacubes can reference the specific run that produced
them via ``fk_run``, rather than relying on a file-wide singleton. ``pk``
values must 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 NullableString, UUIDPrimaryKey
from ts_ids_core.base.ids_field import IdsField
from ts_ids_core.schema import Run, Time
[docs]
class ParticleSizerRun(Run):
"""A single particle sizer measurement run or sequence."""
pk: UUIDPrimaryKey = IdsField(
description="Primary key for this run, referenced by methods/results/datacubes belonging to it."
)
record_id: NullableString = IdsField(
description=(
"Vendor-assigned record identifier for this run, as stored in "
"the raw file. Distinct from the generic ``id`` field, which is a "
"user-facing run identifier."
)
)
comment: NullableString = IdsField(
description="Free-text comment or note recorded for this run."
)
time: Time = IdsField(
description=(
"Timestamps for the run: ``start`` and ``stop`` bound the "
"measurement, and ``acquired`` records when the data was "
"captured/exported."
)
)