lunar_toolkit.provenance
¶
Run provenance for SfS work dirs (provenance.json): environment, inputs, steps and checks.
Provenance(work_dir, config, inputs, checksums=True)
¶
Append one run (environment, config, inputs, steps) to <work_dir>/provenance.json.
Earlier runs are kept, so a resumed work dir holds its whole history. The file is rewritten (atomically) after each step.
Difference(kind, key, recorded, current)
dataclass
¶
One mismatch between a recorded run and now: kind (environment, config, input).
now()
¶
UTC time as ISO 8601 (seconds).
tool_versions()
¶
ASP, ALE, GDAL and ISIS versions (None when a tool is missing); empty under a dry run.
isis_version(isisroot)
¶
First field of $ISISROOT/isis_version.txt (e.g. 10.0.0).
kernel_files(isisdata)
¶
Names of the leap-second and LRO clock kernels under isisdata.
environment()
¶
Package, Python, platform, tool versions, ISIS paths and kernels.
md5sum(path, chunk=1 << 20)
¶
MD5 of path, read in chunk-byte pieces.
file_record(path, checksum=True, known=None, max_bytes=MD5_MAX_BYTES)
¶
path, size, mtime and md5 (None if skipped) of one input file.
The MD5 of known (an earlier record of the same file) is reused when size and mtime match, so resumed runs do not hash again.
read(path)
¶
A provenance.json (an empty history when missing).
compare(recorded, current_env, current_config=None, inputs=None, checksums=True)
¶
Differences between a recorded run and the current environment, config and inputs.
inputs default to the recorded input paths; a file whose size or mtime changed is hashed again and reported only when its MD5 differs (or cannot be compared).
check(work_dir, config=None, inputs=None, checksums=True)
¶
Compare the last run in <work_dir>/provenance.json with the current environment.
| Raises: |
|
|---|