feat(esmvaltool): add timeseries extraction for regional and ozone diagnostics#607
Merged
lewisjared merged 3 commits intomainfrom Mar 31, 2026
Merged
feat(esmvaltool): add timeseries extraction for regional and ozone diagnostics#607lewisjared merged 3 commits intomainfrom
lewisjared merged 3 commits intomainfrom
Conversation
…agnostics - Add series extraction for RegionalHistoricalAnnualCycle and RegionalHistoricalTimeSeries with updated file patterns matching new ESMValTool output directory structure - Add series extraction for ozone polar cap timeseries diagnostics (ozone-sh-oct, ozone-nh-mar) and file definitions for ozone annual cycle and lat-time diagnostics - Add byte string decoding in _extract_series_from_file for NetCDF coordinates stored as byte strings (e.g. shape_id) - Add _region_to_filename helper to convert region names with special characters (., /, &) to dash format used in ESMValTool filenames
Codecov Report✅ All modified and coverable lines are covered by tests.
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support for extracting time series outputs from additional ESMValTool diagnostics (regional historical + ozone), and updates output file/series glob patterns to match ESMValTool’s current directory/layout conventions.
Changes:
- Added diagnostic-to-directory mappings and a region-name filename normalizer for regional annual-cycle and timeseries diagnostics, and updated plot/NetCDF file patterns accordingly.
- Added
FileDefinition/SeriesDefinitionentries for ozone polar-cap timeseries plus file definitions for ozone annual-cycle and lat–time diagnostics. - Enhanced
_extract_series_from_fileto decode byte-string NetCDF coordinates (e.g.,shape_id) into normal strings.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/climate-ref-esmvaltool/src/climate_ref_esmvaltool/diagnostics/regional_historical_changes.py | Updates regional diagnostic output patterns and adds mapping/helpers to align with current ESMValTool output structure. |
| packages/climate-ref-esmvaltool/src/climate_ref_esmvaltool/diagnostics/ozone.py | Adds missing file/series definitions so ozone diagnostics can surface plots and extract timeseries data. |
| packages/climate-ref-esmvaltool/src/climate_ref_esmvaltool/diagnostics/base.py | Adds byte-string decoding when extracting series indices from NetCDF outputs. |
| changelog/607.feature.md | Records the new extraction support and file pattern updates. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Description
Add series extraction for ESMValTool regional and ozone diagnostics, and fix file patterns to match the current ESMValTool output directory structure.
Changes:
base.py: Add byte string decoding in_extract_series_from_filefor NetCDF coordinates stored as byte strings (e.g.shape_id)regional_historical_changes.py:ANNUAL_CYCLE_DIAGNOSTICSandTIMESERIES_DIAGNOSTICSconstants mapping variable names to ESMValTool diagnostic directory names_region_to_filename()helper to convert region names (with.,/,&) to the dash format used in ESMValTool output filenamesRegionalHistoricalAnnualCycleandRegionalHistoricalTimeSeriesfile/series patterns to match the new ESMValTool output structureozone.py:ozone-sh-octandozone-nh-marpolar cap timeseries diagnosticsozone-annual-cycleandozone-lat-timediagnosticsNote: Test case regression data needs to be regenerated separately via
ref test-cases run --force-regen.Checklist
Please confirm that this pull request has done the following:
changelog/