hydromodpy.data.data_freeze#
Lockfile helpers for reproducible runs (hydromodpy.lock).
A lockfile freezes the build environment plus every input artefact that fed a HydroModPy run. It records:
[hydromodpy]: package + git commit + python + schema versions.[binaries]: solver names + binary SHA-256 +--versiontext.[schema]: catalog / zarr / parquet schema versions (and config sha256).[inputs]: every catalog entry keyed by workspace-relative path withsha256,bytesandfetched_at.[[artefact]]rows: legacy per-artefact detail (variable,source,station_id) used by frozen-mode replay.
Writes are atomic: payload lands in a sibling <dest>.tmp.<uuid> file
which is fsync’d before os.replace swaps it into place. A crash
mid-write leaves the previous lockfile untouched.
Verification has two modes:
verify_frozen(used byhmp lock verifyand the frozen-mode catalog) walks every entry and reportsLockMismatchrecords (one per kind:"missing","sha256").verify_inputs_strictreturns the same kind of report but is consumed byhmp lock verify --strictto mapsha256mismatches to a non-zero exit.
Functions
|
Produce an archive containing the lockfile and every artefact. |
|
Return whether frozen mode is currently active. |
|
Load every legacy |
|
Return |
|
Return the |
|
Return the |
|
Return the |
|
Extract archive into dest_dir and verify SHA-256. |
|
Toggle process-wide frozen mode (used by |
|
Compute the SHA-256 digest of a file on disk. |
|
Return every mismatch between lockfile artefacts and the catalog. |
|
Return only |
|
Freeze the current run environment + catalog inputs into |
Classes
|
Discrepancy between lockfile and on-disk catalog state. |
|
One locked artefact recorded in the lockfile. |