Skip to content

Date filter annual datasets - #256

Merged
liviajakob merged 6 commits into
mainfrom
date-filter-annual-datasets
Aug 27, 2026
Merged

Date filter annual datasets#256
liviajakob merged 6 commits into
mainfrom
date-filter-annual-datasets

Conversation

@liviajakob

@liviajakob liviajakob commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

🚀 Type of Change

  • ✨ New feature
  • 🐞 Bug fix
  • 📝 Documentation update
  • ♻️ Refactor / code cleanup
  • ⚙️ Dependency upgrade
  • 🚢 CI update

📝 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

  • My code follows the project’s style and guidelines.
  • I have considered whether adding any Jupyter notebooks is necessary and useful to others.
    (Reminder: notebooks are brittle since they are not covered by automated tests.)
  • I have considered the wider impact of changing shared components/libraries.
  • I have tested my changes locally.
  • I have updated relevant documentation (README, docs, comments).

📸 Screenshots (if applicable)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_range option to convert_datasets_to_annual_trends and applied it during regional annual-variability processing.
  • Renamed regional-processing configuration plumbing from desired_time_span / *_for_longterm_trends to a unified min_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_window is declared optional (defaults to None), but this call unconditionally indexes it when building output_date_range, which will raise a TypeError if the function is used without a time window. Make the clipping conditional and pass None through 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.

Comment thread tests/processing/test_processing_helpers.py
Comment thread glambie/processing/process_regional_results.py
liviajakob and others added 3 commits August 21, 2026 13:54
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@liviajakob
liviajakob marked this pull request as ready for review August 21, 2026 12:07
@liviajakob
liviajakob requested a review from a team as a code owner August 21, 2026 12:07
@liviajakob
liviajakob requested review from mattkernow and removed request for a team August 21, 2026 12:07

@mattkernow mattkernow left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to go 👍🏻

@liviajakob
liviajakob merged commit 6d534f0 into main Aug 27, 2026
5 checks passed
@liviajakob
liviajakob deleted the date-filter-annual-datasets branch August 27, 2026 10:54
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.

3 participants