barracuda.io¶
Atomic, checksummed persistence for inference data and Bayes-factor scans. Existing files are not overwritten unless explicitly requested.
Reproducible persistence helpers for inference and validation outputs.
Attributes¶
__all__
module-attribute
¶
__all__ = ['SCAN_SCHEMA_VERSION', 'ScanBundle', 'build_scan_archive', 'canonical_json', 'configuration_fingerprint', 'dataframe_checksum', 'load_inference_data', 'load_scan_bundle', 'save_inference_data', 'save_scan_bundle']
Classes¶
ScanBundle
dataclass
¶
A validated scan table and the manifest that describes it.
Functions:¶
canonical_json ¶
Serialize configuration data deterministically for hashing.
configuration_fingerprint ¶
Return a SHA-256 fingerprint for JSON-compatible configuration data.
dataframe_checksum ¶
Hash a table's schema, row order, values, and index-independent CSV.
A selected column order may be supplied when only the scientific input fields (rather than incidental report columns) should be covered.
save_inference_data ¶
Atomically save an ArviZ InferenceData object as NetCDF.
load_inference_data ¶
Load an ArviZ InferenceData NetCDF written by BARRACUDA.
save_scan_bundle ¶
save_scan_bundle(table: DataFrame, directory: str | Path, *, configuration: Mapping[str, Any], overwrite: bool = False) -> ScanBundle
Persist a scan CSV and fingerprinted manifest with atomic file writes.
Existing files are never silently reused. Load them with
:func:load_scan_bundle and an expected_configuration to verify a
resume request before deciding whether additional inference is required.
load_scan_bundle ¶
load_scan_bundle(directory: str | Path, *, expected_configuration: Mapping[str, Any] | None = None, verify: bool = True) -> ScanBundle
Load and optionally verify a saved scan bundle.
build_scan_archive ¶
build_scan_archive(table: DataFrame, *, configuration: Mapping[str, Any], recovery: DataFrame | None = None, artifacts: Mapping[str, bytes] | None = None) -> bytes
Build a deterministic portable ZIP for a Bayes-factor scan.