feat(esm_catalog): PR-A1e — namelist extension#1512
Open
siligam wants to merge 1 commit into
Open
Conversation
Adds src/esm_catalog/namelist.py:
- add_namelist_extension(collection, namelists) — collection-level nml:files,
nml:groups, nml:parameters (flattened "group:key" -> scalar, for CQL2
filtering). Drops nml:raw from the pr-a1a version (could be megabytes of
raw namelist JSON per collection).
- add_namelist_item_extension(item, ctx) — item-level nml:{component}:{group}:{key}
entries across ALL components, from ctx.namelists_by_component (kept as-is
from pr-a1a; this function performs no scanning).
Wires both into make_collection (using the component's own entry from
ctx.namelists_by_component) and make_item.
Adds configs/stac-extensions/namelist/v1.0.0/schema.json (custom extension)
and tests/test_esm_catalog/test_stac_namelist_ext.py, including schema
validation for both Collection and Item shapes.
Contributor
Author
|
@mandresm heads-up: per our Webex split this one was yours — I went ahead and implemented it anyway while I had momentum finishing the A1 plan (A1c/A1f landed as #1511/#1513 the same day, and this one follows the plan's spec directly: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of the esm_catalog decomposition, per the PR-A1a foundation plan. Follows #1504 (A1b core), branches from
release.Adds
src/esm_catalog/namelist.py:add_namelist_extension(collection, namelists)— collection-levelnml:files,nml:groups,nml:parameters(flattened"group:key"→ scalar, for CQL2 filtering). Dropsnml:rawfrom the pr-a1a version per the plan — storing the full raw namelist as JSON on every collection could be megabytes for complex setups.add_namelist_item_extension(item, ctx)— item-levelnml:{component}:{group}:{key}entries across all components, read fromctx.namelists_by_component(kept as-is per the plan; performs no scanning).Wired into
make_collection(using the collection's own component's entry fromctx.namelists_by_component) andmake_item.Also adds
configs/stac-extensions/namelist/v1.0.0/schema.json(custom extension — no external community schema exists) andtests/test_esm_catalog/test_stac_namelist_ext.py.Test plan
pytest tests/test_esm_catalog— 51 passednml:rawdropped/nested-dict+long-list skipping/idempotent URL append, item no-op/multi-component coverage, and schema validation (viajsonschema) for both Collection and Item shapes