Support new ACCESS-ESM1.6 raw output filenames - #584
Conversation
|
I guess we should not merge before it is tested against an actual experiment output dataset. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #584 +/- ##
=====================================
Coverage 75.0% 75.1%
=====================================
Files 38 38
Lines 7761 7774 +13
Branches 1451 1455 +4
=====================================
+ Hits 5823 5836 +13
Misses 1638 1638
Partials 300 300
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:
|
There was a problem hiding this comment.
Pull request overview
Adds support for the new ACCESS-ESM1.6 “one variable per raw NetCDF” naming conventions (UM7.3/CICE5/OM2) while retaining legacy discovery behavior, including correct year/month parsing for end-of-filename datestamps.
Changes:
- Extend
ACCESS-ESM1-6_mappings.jsonfile-discovery patterns to include newaccess-esm1p6.{um7p3,cice5,om2}...filenames and additional subdirectory options. - Teach filename parsing to extract year/month from dot-delimited
....YYYY(.nc)and....YYYY-MM(.nc)suffixes. - Expand unit tests to cover new filename patterns and mixed legacy + new-layout archives.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/unit/test_file_discovery.py | Adds coverage for year parsing and discovery across legacy + new per-variable layouts. |
| src/access_moppy/mappings/ACCESS-ESM1-6_mappings.json | Adds new ACCESS-ESM1.6 per-variable filename globs and supports multiple subdirs per component. |
| src/access_moppy/file_discovery.py | Updates year/year-month extraction for dot-delimited datestamps and supports list-valued subdir. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Closes #583
What this changes
ACCESS-ESM1.6 is moving towards storing one physical variable in each raw NetCDF file. This PR teaches ACCESS-MOPPy how to find those new files without removing support for existing runs.
In practical terms, MOPPy can now work with both:
access-esm1p6.um7p3...files;access-esm1p6.cice5...files;access-esm1p6.om2...files and the grouped ocean static file.MOPPy also understands the date at the end of the new filenames. This keeps requests such as “only process 1850 to 1900” working as expected, and ensures that a request for one raw variable does not accidentally select another variable’s file.
Compatibility
This is additive. Existing file names and directory layouts remain supported, so older experiments do not need to be reorganised.
Checks
pixi run -e dev python -m pytest tests/unit/test_file_discovery.py -q(91 passed)pixi run -e dev ruff check src/access_moppy/file_discovery.py tests/unit/test_file_discovery.py@joshuatorrance @blimlim @rhaegar325 , could you please review the filename assumptions for UM, CICE, and ocean, and confirm that keeping both layouts covers the planned transition?