Date filter annual datasets - #256
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support for clipping annual-trend datasets to a configured date window before downstream combination steps, ensuring outputs respect the run’s configured start/end years.
Changes:
- Added an
output_date_rangeoption toconvert_datasets_to_annual_trendsand applied it during regional annual-variability processing. - Renamed regional-processing configuration plumbing from
desired_time_span/*_for_longterm_trendsto a unifiedmin_max_time_window. - Updated plot labels and the “consensus” data-group description to use “Reconciled/Reconciliation” wording, and added a unit test for date-range clipping.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/processing/test_processing_helpers.py | Adds a test asserting annual-trend outputs are clipped to a requested date range. |
| glambie/processing/processing_helpers.py | Introduces output_date_range clipping after annual-trend conversion. |
| glambie/processing/process_regional_results.py | Threads min_max_time_window through processing and applies annual clipping with a buffer for variability. |
| glambie/plot/processing_plots.py | Renames plot legend labels from “Consensus” to “Reconciled”. |
| glambie/const/data_groups.py | Updates the long name of the consensus data group to “Reconciliation…”. |
Suppressed comments (1)
glambie/processing/process_regional_results.py:657
min_max_time_windowis declared optional (defaults to None), but this call unconditionally indexes it when buildingoutput_date_range, which will raise aTypeErrorif the function is used without a time window. Make the clipping conditional and passNonethrough when no window is provided.
year_type=year_type,
method_to_correct_seasonally=method_to_correct_seasonally,
seasonal_calibration_dataset=seasonal_calibration_dataset,
rgi_area_version=rgi_area_version,
output_date_range=[min_max_time_window[0] - 1, min_max_time_window[1] + 1],
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
🚀 Type of Change
📝 Description
Quick change to filter annual datasets to the date range specified in the configs before combining.
This is now needed as in GlaMBIE-2 some datasets go far back into the past.
Also did some renaming of terminology in the output plots from Consensus to Reconciled.
🐝 Hive Card
https://app.hive.com/workspace/GNxP5GYvPWRvyG2Cr?actionId=zfSvkDMN4t8stdys6
✅ Checklist
(Reminder: notebooks are brittle since they are not covered by automated tests.)
📸 Screenshots (if applicable)