hydromodpy.results.exporters.hmp_package#

Portable .hmp package export / import (tar.zst + SHA-256 manifest).

A .hmp file is a single tar archive compressed with Zstandard, containing:

  • manifest.json - archive header with the HydroModPy version that produced the archive, the simulation UUID, and a list of {path, size, sha256} entries covering every other file. The manifest is itself included in the archive under manifest.json (its own sha256 is therefore omitted - checksums are verified against the other files).

  • catalog_snapshot.duckdb - a one-simulation DuckDB snapshot containing the simulations row plus per-sim data (parameters, timeseries, budgets, metrics, provenance, geographic features / metadata, tags, runs_environment).

  • simulation.zarr.zip - the simulation’s Zarr store, packed to a deterministic zip file (already BLOSC-compressed internally).

  • geographic/ (optional) - the workspace-level content-addressable raster cache materialised for the simulation’s geographic_fingerprint, so the archive is self-contained on a fresh workspace.

  • README.md - human-readable summary generated at export time.

The archive is reproducible: given the same inputs, the archive layout, file ordering and manifest are byte-identical, which makes SHA-256 checks meaningful for tamper detection.

Functions

export_hmp_package(catalog, sim_id, output_path)

Export a single simulation as a portable .hmp archive (tar.zst).

import_hmp_package(catalog, package_path, *)

Import a .hmp archive into the given catalog's workspace.