AUCX archives¶
See the AUCX format specification for the container layout and integrity rules.
Reading and writing¶
export_aucx
¶
export_aucx(
experiment: AUCExperiment,
path: str | Path,
*,
overwrite: bool = False,
exported_at: datetime | None = None,
) -> Path
Write experiment to an AUCX archive and return the written path.
The archive is written to a sibling temporary file, verified by reading it back in full, and only then moved into place — so a failure never leaves a partial or corrupt archive at the destination.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
experiment
|
AUCExperiment
|
The experiment to archive. |
required |
path
|
str | Path
|
Destination |
required |
overwrite
|
bool
|
Replace an existing file. Refuses by default. |
False
|
exported_at
|
datetime | None
|
Timestamp recorded in the export provenance. Defaults to the current UTC time; pass a fixed value for byte-identical output. |
None
|
Returns:
| Type | Description |
|---|---|
Path
|
The path written. |
Raises:
| Type | Description |
|---|---|
ArchiveError
|
if the destination exists and |
Source code in src/openauc/formats/aucx.py
read_aucx
¶
Read an AUCX archive into an :class:AUCExperiment.
Every checksum is verified before any model is constructed. The returned
experiment carries the import provenance stored in the archive, unchanged,
so a round trip preserves it; the export record is available separately via
:func:inspect_aucx.
Raises:
| Type | Description |
|---|---|
ArchiveError
|
for unreadable, unsafe or inconsistent archives. |
ArchiveIntegrityError
|
for checksum problems. |
ArchiveVersionError
|
for an unsupported format version. |
Source code in src/openauc/formats/aucx.py
Inspection and validation¶
inspect_aucx
¶
Verify an archive's integrity and report what it declares.
This is container-level inspection only. It reports nothing about the structural or scientific standing of the experiment inside.
Source code in src/openauc/formats/aucx.py
validate_aucx
¶
Check an archive's integrity without raising.
Container-level validation only: readability, safety, member agreement and
checksums. Structural and readiness validation of the experiment inside
remain separate — load the archive and use experiment.validate().
Source code in src/openauc/formats/aucx.py
Records¶
AUCXInfo
¶
Bases: _Frozen
What an archive declares about itself, after integrity verification.
AUCXExport
¶
Bases: _Frozen
The export event that produced an archive.
Distinct from the experiment's own import provenance, which records where the data originally came from and travels with the model unchanged.
ArchiveValidationReport
dataclass
¶
ArchiveValidationReport(
path: str,
issues: tuple[ArchiveIssue, ...] = (),
info: AUCXInfo | None = None,
)
Container-level validation only.
This reports whether an archive is readable and internally intact. It makes
no structural or scientific judgement about the experiment inside — use
experiment.validate() and experiment.assess_readiness() for those,
after loading.
ArchiveIssue
dataclass
¶
One archive-integrity finding. Not a structural or scientific finding.