feat(esm_catalog): PR-A4 — esm-tools integration layer#1489
Conversation
97c7c22 to
ca2ed54
Compare
aa1067e to
3b7f061
Compare
ca2ed54 to
e9dde21
Compare
3b7f061 to
29ae1c8
Compare
- Add integration/config.py: load_config (ruamel.yaml), find_finished_configs, get_outdata_files, find_file_operations_log, get_outdata_from_file_operations (outdata entries + MD5 checksums from tidy YAML), extract_stac_metadata. - Add integration/esm_tools.py: add_files() and add_run() — tidy-phase bridge. add_run() implements source priority chain (file_operations_tidy log → finished_config outdata_targets). add_files() guards against missing/zero-byte files and duplicates (via symlink-resolved dedup), injects file:checksum into item assets when checksums are provided. - Add ruamel.yaml>=0.17 to extras_require["catalog"] and CI install line. - 12 new tests covering all config helpers, YAML parsing, add_files round-trip, zero-byte skip, missing-file skip, and checksum injection. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
e9dde21 to
fd065b9
Compare
29ae1c8 to
9b3bc13
Compare
|
Rebased onto the corrected PR-0 base (#1483) — test relocation to |
ESM-Tools already writes per-model git info (commit hash, branch name,
source/binary directory) to {expid}_vcs_info.yaml during the prepare
step, but esm_catalog only ever read finished_config.yaml and never
picked this up. Add find_vcs_info()/load_vcs_info() and merge the
data into extract_stac_metadata()'s per-component output when supplied.
ESM-Tools already records, per component, whether a run is a cold start or branched off (lresume), the parent experiment's finished config path (prev_run_config_file), and the restart files used (restart_in_sources/restart_in_targets). None of this reached esm_catalog. Parse it into is_cold_start/parent_expid/parent_path/ branch_off_year/restart_files on each component, per the D1 user requirements doc (issue #1502).
… primary lineage source Verified against a real branched-off AWIESM experiment on Albedo (branchoff-002, parent basic-002): runscripts populate ini_parent_exp_id/ini_parent_date/ini_parent_dir directly in finished_config.yaml. prev_run_config_file (what the previous commit keyed off) is a separate, opt-in mechanism from esm_runscripts.prev_run that this real experiment never uses. Prefer ini_parent_* when present, fall back to prev_run_config_file parsing otherwise.
|
Heads-up on the
The loader itself is harmless —
Not blocking — opened #1503 to track it. Miguel confirmed these were briefly live in production, broke |
Summary
integration/config.py: helpers to load/parse ESM-Tools config files —load_config(via ruamel.yaml),find_finished_configs,get_outdata_files,find_file_operations_log,get_outdata_from_file_operations(extracts outdata entries + MD5 checksums from the tidy log),extract_stac_metadata.integration/esm_tools.py:add_files(db, files, config, checksums=None)andadd_run(db, experiment_dir, component, run_datestamp, config).add_run()implements the source priority chain — tidy log (with checksums) → finished_config outdata_targets (paths only).add_files()guards against missing/zero-byte files, deduplicates by symlink-resolved path, and injectsfile:checksuminto item assets when checksums are provided.ruamel.yaml>=0.17toextras_require["catalog"]and CI.add_filesround-trip, zero-byte/missing-file skip, and checksum injection.Full ingest pipeline (Phase A complete):
Test plan
pytest src/esm_catalog/tests/test_integration.py -v— 12 tests pass locallypytest src/esm_catalog/tests— 74 tests, 0 failures🤖 Generated with Claude Code