Experiments and metadata¶
The canonical in-memory model. See Canonical data model for the design.
AUCExperiment¶
AUCExperiment
dataclass
¶
AUCExperiment(
metadata: ExperimentMetadata,
scans: tuple[ScanMetadata, ...],
observations: Observations,
samples: tuple[SampleMetadata, ...] = (),
instrument: InstrumentMetadata | None = None,
provenance: ImportProvenance | None = None,
)
A complete canonical AUC experiment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
metadata
|
ExperimentMetadata
|
Experiment identity (area A). |
required |
scans
|
tuple[ScanMetadata, ...]
|
Per-scan metadata, one record per scan. |
required |
observations
|
Observations
|
The radial signal data (shared or per-scan axes). |
required |
samples
|
tuple[SampleMetadata, ...]
|
Optional sample/buffer metadata. |
()
|
instrument
|
InstrumentMetadata | None
|
Optional instrument and run metadata. |
None
|
provenance
|
ImportProvenance | None
|
Optional import-provenance record. |
None
|
Construction does not enforce cross-object consistency (e.g. that scan
identifiers match the observations); use :meth:validate_structure to check
that and obtain a report. Field-level invariants are enforced by the
component models at their own construction.
validate_structure
¶
Run archival and structural validation (does not raise).
Returns the ARCHIVAL and STRUCTURAL findings of ERROR or
WARNING severity. Use :meth:validate for the full report across
all four tiers, including informational findings.
Source code in src/openauc/models/experiment.py
validate
¶
Run every check across all four tiers (does not raise).
The report covers archival, structural and both readiness tiers. It
makes no claim about scientific validity: see :meth:assess_readiness.
Source code in src/openauc/models/experiment.py
assess_readiness
¶
Report whether the metadata a future workflow needs is present.
This assesses metadata presence only. Scientific suitability is always
reported as NOT_ASSESSED.
Source code in src/openauc/models/experiment.py
optical_systems
¶
Distinct optical systems named across scans (and the instrument).
Source code in src/openauc/models/experiment.py
summary_data
¶
A structured, factual summary of the experiment's structure.
Holds counts, ranges and metadata-presence facts only — no scientific calculation, quality score or inferred value.
Source code in src/openauc/models/experiment.py
summary
¶
A factual, human-readable summary of the experiment's structure.
The summary describes structure and metadata only. It makes no claim
about scientific validity or suitability for sedimentation analysis.
Equivalent to self.summary_data().to_text().
Source code in src/openauc/models/experiment.py
export
¶
export(
path: str | Path,
*,
overwrite: bool = False,
exported_at: datetime | None = None,
) -> Path
Write this experiment to an AUCX archive and return the path.
The archive is written atomically and verified before it replaces
anything. See :func:openauc.export_aucx.
Source code in src/openauc/models/experiment.py
to_dict
¶
Serialise the experiment to plain JSON-friendly Python types.
Source code in src/openauc/models/experiment.py
from_dict
classmethod
¶
Reconstruct an experiment from :meth:to_dict output.
Source code in src/openauc/models/experiment.py
Experiment identity¶
ExperimentMetadata
¶
Bases: BaseModel
Experiment identity (area A).
Only experiment_id is required. Every other field is optional and, when
absent, is left as None (structurally absent) rather than given a
default value. experiment_type defaults to UNKNOWN — an explicit
"not stated", never an inferred type.
Scans¶
ScanMetadata
¶
Bases: BaseModel
Metadata for a single radial scan.
Samples¶
SampleMetadata
¶
Bases: BaseModel
Sample and buffer metadata.
Instrument¶
InstrumentMetadata
¶
Bases: BaseModel
Instrument, rotor and run-level acquisition metadata.
Quantities¶
The primitive for a scientific scalar: a value, a declared unit, an explicit presence status and a provenance tag. See Missing, unknown and not-applicable.
Quantity
¶
Bases: BaseModel
A scientific scalar with a retained unit, status and provenance.
Attributes:
| Name | Type | Description |
|---|---|---|
value |
float | None
|
The numeric value, or |
unit |
Unit
|
The declared unit. Use |
unit_label |
str | None
|
Verbatim source unit text, retained when |
status |
ValueStatus
|
Explicit presence semantics (present/missing/unknown/ not-applicable). |
provenance |
ValueProvenance
|
Where the value came from (supplied/converted/inferred/ user-confirmed/unknown). |
of
classmethod
¶
of(
value: float,
unit: Unit,
*,
unit_label: str | None = None,
provenance: ValueProvenance = ValueProvenance.SUPPLIED,
) -> Quantity
Build a PRESENT quantity carrying value in unit.
Source code in src/openauc/models/metadata.py
missing
classmethod
¶
A value the source did not provide.
unknown
classmethod
¶
A value the source explicitly marks as unknown.
not_applicable
classmethod
¶
A value that does not apply to this experiment.
Source code in src/openauc/models/metadata.py
Provenance¶
ImportProvenance
¶
Bases: BaseModel
Record of an experiment's origin and per-category value provenance.
The value-category tuples (supplied_values etc.) hold references — for
example dotted field names — to the values in each provenance category. They
complement the per-value :class:~openauc.models.metadata.Quantity
provenance tag, giving an experiment-level audit list.
SourceChecksum
¶
Bases: BaseModel
A checksum of one source file an experiment was read from.
An import can draw on more than one file — a manifest and a data file, for
instance — and each is recorded separately rather than collapsed into a
single field. role names what the file was to the import (manifest,
data_file), not what it contains.
A checksum establishes integrity — that the bytes are unchanged since they were read. It says nothing about authenticity or origin.
Enumerations¶
enums
¶
Enumerations for the canonical AUC data model.
All categorical vocabularies used by the model live here so they have a single
definition and stable string values (the enums are StrEnum, so their members
serialise to their declared string). Representing an optical system or unit here
does not imply that importing or scientifically interpreting it is
implemented — representation and support are deliberately separate.
ExperimentType
¶
Bases: StrEnum
The kind of AUC experiment. UNKNOWN is explicit, never inferred.
OpticalSystem
¶
Bases: StrEnum
Optical detection systems the model can represent.
Representation support is not a claim that file import or scientific interpretation is implemented or validated for every system.
Unit
¶
Bases: StrEnum
Declared units retained by the model.
The canonical unit for each physical quantity is listed below. The model
retains the declared unit and never infers or silently converts. Units
that are open-ended (e.g. concentration) or absent are represented by
OTHER (carry the verbatim text in Quantity.unit_label) or
UNKNOWN.
RadiusAxisMode
¶
Bases: StrEnum
Whether scans share one radius axis or each carry their own.
ValueStatus
¶
Bases: StrEnum
Explicit presence semantics for a scientific value.
MISSING, UNKNOWN and NOT_APPLICABLE are conceptually different
and must not be collapsed into a single sentinel or a default value.
ValueProvenance
¶
Bases: StrEnum
Where a value came from, retained per value.