Skip to content

Warn on silent institution_id fallback in CMIP7 global attributes - #636

Merged
rbeucher merged 1 commit into
mainfrom
fix-institution-fallback-warning-621
Aug 24, 2026
Merged

Warn on silent institution_id fallback in CMIP7 global attributes#636
rbeucher merged 1 commit into
mainfrom
fix-institution-fallback-warning-621

Conversation

@rbeucher

Copy link
Copy Markdown
Member

Summary

  • The institution_id -> institution global-attribute lookup in cmor-cvs.json is missing entries silently fell back to writing the raw ID, which fails wcrp_cmip7 [ATTR004]/[ATTR009] compliance checks with no indication of why.
  • The cmip7-cmor-tables submodule pointer already carries an ACCESS-Consortium entry (picked up via a prior submodule bump), so this specific ID resolves correctly today — but the fallback stays dormant and silent for any other/renamed institution_id.
  • _get_institution_name now emits a UserWarning when 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)
  • Updated test_get_institution_name_fallback_to_id to assert the warning fires

Fixes #621

…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

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.0%. Comparing base (590f0aa) to head (19c0c03).

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           
Flag Coverage Δ
unit 77.0% <100.0%> (+<0.1%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rbeucher
rbeucher merged commit 7862b84 into main Aug 24, 2026
4 checks passed
@rbeucher
rbeucher deleted the fix-institution-fallback-warning-621 branch August 24, 2026 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] compliance_checker report: CMIP7 institution global attribute is written as the short ID, failing wcrp_cmip7 [ATTR009]

1 participant