Source code for ts_ids_components.particle_sizer.system

"""
System component for particle sizer IDSs.

:py:class:`ParticleSizerSystem` extends the generic
:py:class:`System <ts_ids_core.schema.system.System>` component with the
fields common to particle sizer instruments: serial number, software,
firmware, and a list of attached :py:class:`Accessory` objects.

``ParticleSizerSystem`` 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[ParticleSizerSystem]``)
and results/datacubes can reference the specific system that produced them
via ``fk_system``, 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.

Vendor-specific configuration (e.g. Wyatt DynaPro's numbered tag/value
parameters from the ``.dexp`` file) is intentionally left out of this shared
component -- it belongs in the vendor-specific IDS, not the component library.
"""

from typing import List

from ts_ids_core.annotations import NullableString, UUIDPrimaryKey
from ts_ids_core.base.ids_element import IdsElement
from ts_ids_core.base.ids_field import IdsField
from ts_ids_core.schema import System


[docs] class Accessory(IdsElement): """ An accessory or module attached to a particle sizer instrument -- e.g. a dispersion unit (Malvern Mastersizer's Hydro/Aero), an autosampler, a sample-prep chamber, or an additional detector channel. A particle sizer can be equipped with more than one accessory, so :py:class:`ParticleSizerSystem` holds these as a list. Modeled as an object (rather than a bare serial-number string) so the serial number stays tied to the accessory it identifies and so additional accessory attributes can be captured as instruments report them. In some raw data (e.g. the Mastersizer CSV export) only the serial number is available, in which case ``name`` is left unset. """ name: NullableString = IdsField( description=( "Name or type of the accessory, e.g. 'Hydro MV' or 'Aero S'. " "Unset when the raw data reports only the serial number." ) ) serial_number: NullableString = IdsField( description="Serial number of the accessory, as reported by the instrument." )
[docs] class ParticleSizerSystem( System, System.SerialNumber, System.Software, System.Firmware, ): """ Instrument system information common to particle sizer instruments, across Dynamic Light Scattering (DLS), Electrophoretic Light Scattering (ELS/Zeta), Static Light Scattering (SLS), and Laser Diffraction (LD) vendors (e.g. Malvern Zetasizer, Wyatt DynaPro, Malvern Mastersizer). """ pk: UUIDPrimaryKey = IdsField( description="Primary key for this system, referenced by results/datacubes belonging to it." ) accessories: List[Accessory] = IdsField( description=( "Accessories or modules attached to the instrument (dispersion " "unit, autosampler, sample-prep chamber, additional detector " "channel, etc.). Empty when none are reported." ) )