Validation and readiness¶
Two independent questions, deliberately kept apart. See Validation tiers and Analysis readiness.
Reports and findings¶
ValidationReport
dataclass
¶
The result of validation: an ordered, deterministic list of findings.
is_valid
property
¶
True when there are no ERROR-severity issues.
This is a statement about structural validity only. It is never a claim that the data are scientifically valid or that any analysis is appropriate.
counts
¶
by_code
¶
codes
¶
for_tiers
¶
for_tiers(
*tiers: ValidationTier,
severities: tuple[ValidationSeverity, ...]
| None = None,
) -> ValidationReport
A report narrowed to findings pertaining to tiers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tiers
|
ValidationTier
|
Keep a finding when any of its |
()
|
severities
|
tuple[ValidationSeverity, ...] | None
|
When given, additionally keep only these severities. |
None
|
Source code in src/openauc/models/validation.py
blocking_for
¶
raise_if_invalid
¶
Raise :class:StructuralValidationError if any errors are present.
to_dict
¶
Serialise the report to plain JSON-friendly Python types.
Source code in src/openauc/models/validation.py
ValidationIssue
dataclass
¶
ValidationIssue(
code: str,
message: str,
severity: ValidationSeverity = ValidationSeverity.ERROR,
location: str | None = None,
tiers: tuple[ValidationTier, ...] = (
ValidationTier.STRUCTURAL,
),
blocks: tuple[ValidationTier, ...] = (),
observed: str | None = None,
expected: str | None = None,
remediation: str | None = None,
component: str | None = None,
scan_ids: tuple[str, ...] = (),
)
A single validation finding.
Attributes:
| Name | Type | Description |
|---|---|---|
code |
str
|
Stable identifier for the check that produced the finding. |
message |
str
|
Human-readable statement of what was found. |
severity |
ValidationSeverity
|
See :class: |
location |
str | None
|
The single affected scan, sample or component, when exactly one is affected. |
tiers |
tuple[ValidationTier, ...]
|
The tier(s) the finding speaks to. Never empty. |
blocks |
tuple[ValidationTier, ...]
|
The tier(s) the finding prevents. A finding may pertain to a tier without blocking it. |
observed |
str | None
|
What was actually found, rendered as text. |
expected |
str | None
|
The condition that would have satisfied the check. |
remediation |
str | None
|
A concrete suggestion for resolving the finding. |
component |
str | None
|
The model field or component the finding concerns. |
scan_ids |
tuple[str, ...]
|
Every affected scan identifier, sorted. One finding aggregates a condition across many scans rather than emitting one finding per scan. |
blocks_structural_validity
property
¶
True when this finding prevents structural validity.
Equivalent to carrying ERROR severity: by the severity policy only
errors may block the archival or structural tiers.
blocks_tier
¶
describe
¶
A multi-line rendering including observed/expected/remediation.
Source code in src/openauc/models/validation.py
to_dict
¶
Serialise the finding to plain JSON-friendly Python types.
Source code in src/openauc/models/validation.py
Entry points¶
validate_experiment
¶
Run every check across all four tiers and return the full report.
Findings are ordered by the fixed check registry; within a check, affected scans are sorted. Equivalent experiments therefore produce equivalent reports.
Source code in src/openauc/models/validation.py
validate_experiment_structure
¶
Validate archival and structural consistency only.
Returns the ARCHIVAL and STRUCTURAL findings of ERROR or
WARNING severity. Readiness findings and purely informational findings
are reported by :func:validate_experiment instead. This is a
representational check; it makes no scientific judgement.
Source code in src/openauc/models/validation.py
Readiness¶
ReadinessAssessment
dataclass
¶
AnalysisReadiness
dataclass
¶
AnalysisReadiness(
analysis: AnalysisKind,
status: ReadinessStatus,
blocking_issues: tuple[ValidationIssue, ...] = (),
advisory_issues: tuple[ValidationIssue, ...] = (),
note: str | None = None,
)
Whether the metadata one workflow would need is present.
POTENTIALLY_READY reports metadata presence only. It is never a claim
that the data are correct or that the analysis is appropriate.
to_dict
¶
Serialise to plain JSON-friendly Python types.
Source code in src/openauc/models/readiness.py
assess_experiment_readiness
¶
Report metadata readiness per workflow. Makes no scientific judgement.
Source code in src/openauc/models/readiness.py
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.
ValidationSeverity
¶
Bases: StrEnum
Severity of a validation finding.
The severity policy is fixed and applied uniformly:
ERROR— may blockARCHIVALorSTRUCTURALvalidity. Only errors affect :attr:~openauc.models.validation.ValidationReport.is_valid.WARNING— never blocks archival or structural validity. It either blocks a readiness tier or flags a representational anomaly.INFO— descriptive only; blocks nothing.
Readiness findings never use ERROR.
ValidationTier
¶
Bases: StrEnum
The question a validation finding speaks to.
Tiers are answered independently; a finding may pertain to more than one.
Scientific suitability is deliberately not a tier — see
:class:ReadinessStatus and :class:AnalysisKind.
ReadinessStatus
¶
Bases: StrEnum
Outcome of an analysis-readiness assessment.
POTENTIALLY_READY reports that the metadata a future workflow needs is
present. It is never a statement that the data are correct, of good
quality, or scientifically suitable — that is never assessed.
AnalysisKind
¶
Bases: StrEnum
A workflow whose metadata prerequisites can be reported on.
SCIENTIFIC_SUITABILITY is included so that "not assessed" is a
machine-readable, always-present part of every assessment rather than a
prose disclaimer. Its status is permanently
:attr:ReadinessStatus.NOT_ASSESSED.