Skip to content

Qa Schema

Module: spectralbridge.qa.schema.

Versioned schemas for stage and combined QA artifacts.

API glossary ยท Workflow / scientific context

Signatures and documentation below are collected from the current source. Advanced objects are not newly declared stable by inclusion here.

Audience: public. Also exported as spectralbridge.qa.QAStatus.

QAStatus

Four-state QA classification used throughout SpectralBridge.

Audience: advanced.

QACheck dataclass

QACheck(check_id: str, status: QAStatus, value: Any = None, units: str | None = None, warn_threshold: Any = None, fail_threshold: Any = None, provisional: bool = True, interpretation: str = '', reason: str | None = None)

One explicit check, including thresholds and interpretation.

Audience: public. Also exported as spectralbridge.qa.StageQAReport.

StageQAReport dataclass

StageQAReport(stage_id: str, stage_name: str, mode: str, status: QAStatus, inputs: list[dict[str, Any]], outputs: list[dict[str, Any]], parameters: dict[str, Any], sample: dict[str, Any], metrics: dict[str, Any], checks: list[QACheck], warnings: list[str], plots: list[str], interpretation: list[str], provenance: dict[str, Any], schema_version: str = SCHEMA_VERSION, unavailable_diagnostics: list[dict[str, str]] = list())

Machine-readable report emitted for one canonical pipeline stage.

Attributes:

Name Type Description
stage_id str

Canonical processing-stage identifier used for deterministic QA paths and stage-specific diagnostics.

stage_name str

Human-readable canonical processing-stage label.

mode str

Diagnostic coverage level, normally 'standard' or 'deep'; existing artifacts are inspected without rerunning correction.

status QAStatus

Recorded stage-specific outcome or eligibility state; inspect reason/detail and the relevant workflow before interpreting it scientifically.

inputs list[dict[str, Any]]

Paths to the stage input/output artifacts; their availability and provenance are recorded in the QA payload.

outputs list[dict[str, Any]]

Paths to the stage input/output artifacts; their availability and provenance are recorded in the QA payload.

parameters dict[str, Any]

Optional serializable stage configuration recorded for reproducibility; does not modify the stage products.

sample dict[str, Any]

Sampling metadata describing the bounded diagnostic support; not the entire raster population.

metrics dict[str, Any]

Numerical diagnostic results with explicit missing/unavailable values.

checks list[QACheck]

Structured QA checks and statuses evaluated against the configured review thresholds.

warnings list[str]

Human-readable diagnostic warnings requiring interpretation.

plots list[str]

Recorded rendered QA artifact paths/metadata.

interpretation list[str]

Human-readable explanation of the stage diagnostics and their limitations.

provenance dict[str, Any]

Source/configuration/version evidence accompanying this diagnostic report.

schema_version str, default=SCHEMA_VERSION

Serialized payload schema version; preserve it when storing or exchanging this record.

unavailable_diagnostics list[dict[str, str]], default=field(default_factory=list)

Explicit list of checks that could not be evaluated; these must not be treated as passing.

to_dict

to_dict() -> dict[str, Any]

Serialize this record to its established machine-readable mapping.

Returns:

Type Description
dict[str, Any]

Mapping of record fields and workflow-derived summary entries in the established serialization schema.

to_json

to_json() -> str

Serialize the stage report to JSON.

Returns:

Type Description
str

JSON representation of the stage report.

write_json

write_json(path: Path) -> Path

Write the stage report JSON to the requested path.

Parameters:

Name Type Description Default
path Path

Destination JSON file path.

required

Returns:

Type Description
Path

Destination path after writing this report as JSON.

Audience: advanced.

overall_status

overall_status(checks: list[QACheck]) -> QAStatus

Return the most severe evaluated status, or NOT EVALUATED.

Explicitly exported constants and type aliases

These values describe package metadata, schemas or configuration; they are not observations from a production dataset.

Name Source expression
SCHEMA_VERSION '1.3'