Warn on silent institution_id fallback in CMIP7 global attributes - #636
Merged
Conversation
…from the CMIP7 CV The `institution_id` -> `institution` lookup in cmor-cvs.json now has an ACCESS-Consortium entry, so the fallback path is dormant for ACCESS runs. But it stayed silent, so a missing/renamed institution_id would keep writing a value that fails wcrp_cmip7 [ATTR004]/[ATTR009] with no pointer back to the cause. Warn on that path instead. Fixes #621
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #636 +/- ##
=====================================
Coverage 77.0% 77.0%
=====================================
Files 40 40
Lines 8518 8519 +1
Branches 1593 1593
=====================================
+ Hits 6562 6563 +1
Misses 1624 1624
Partials 332 332
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Summary
institution_id->institutionglobal-attribute lookup incmor-cvs.jsonis missing entries silently fell back to writing the raw ID, which failswcrp_cmip7 [ATTR004]/[ATTR009]compliance checks with no indication of why.cmip7-cmor-tablessubmodule pointer already carries anACCESS-Consortiumentry (picked up via a prior submodule bump), so this specific ID resolves correctly today — but the fallback stays dormant and silent for any other/renamedinstitution_id._get_institution_namenow emits aUserWarningwhen it falls back, so a missing CV entry surfaces as an actionable warning instead of six silent compliance failures downstream.Test plan
pixi run -e dev python -m pytest tests/unit/test_vocabulary_processors.py -q(113 passed)test_get_institution_name_fallback_to_idto assert the warning firesFixes #621