Skip to content

Conversation

@k-a-webb
Copy link

@k-a-webb k-a-webb commented Nov 29, 2024

Description

Related issue: #2591

Include a parameter full (I'm open to this being a different word) which triggers extract_season to only return "complete" seasons. For example, "DJF" and never just "JF". Invokes extract_time to clip the time vector prior to season extraction

Closes #issue_number


Checklist

It is the responsibility of the author to make sure the pull request is ready to review. The icons indicate whether the item will be subject to the 🛠 Technical or 🧪 Scientific review.


To help with the number pull requests:

@codecov
Copy link

codecov bot commented Nov 29, 2024

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.97%. Comparing base (bd617f5) to head (e5c5336).
⚠️ Report is 168 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2597   +/-   ##
=======================================
  Coverage   94.96%   94.97%           
=======================================
  Files         253      253           
  Lines       14701    14716   +15     
=======================================
+ Hits        13961    13976   +15     
  Misses        740      740           

☔ View full report in Codecov by Sentry.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@valeriupredoi valeriupredoi marked this pull request as draft December 3, 2024 17:16
@valeriupredoi
Copy link
Contributor

many thanks @k-a-webb - it's always good practice to have a Draft PR when not ready for review, as you mentioned in the PR title (so I went ahead and made it a Draft for you 👍 )

@k-a-webb k-a-webb marked this pull request as ready for review December 30, 2024 19:59
@k-a-webb
Copy link
Author

@valeriupredoi, could you please help me understand why the pre-commit.ci check is failing?

Copy link
Contributor

@malininae malininae left a comment

Choose a reason for hiding this comment

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

Thanks @k-a-webb for your contribution. I left big picture comments, they are mostly recommendations rather than requirements, so feel free to ignore them.

season:
Season to extract. Available: DJF, MAM, JJA, SON
and all sequentially correct combinations: e.g. JJAS
full:
Copy link
Contributor

Choose a reason for hiding this comment

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

I would add more documentation or maybe context. I know what the issue is, but I think a person without context might get confused.

full_season_coord, data_dims=result.coord_dims("time")
)

result = result.extract(iris.Constraint(full_season=1))
Copy link
Contributor

Choose a reason for hiding this comment

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

Personal preference, rather than need, but I would add a logger message in the debug format which months have been removed. Also on a similar note, in case the values are existing in a timeseries, but have been masked out, as far as I understand they won't be removed. I would recommend to add this information somewhere.

with assert_raises(iris.exceptions.CoordinateNotFoundError):
self.cube.coord("season_year")

def test_get_djf_full(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

Again, personal preference, rather than requirement, but I would add a second test when you provide a cube, where the season is captured fully (let's say from Dec to Nov) with the keyword full=True and check that the returned cube is correct.

@github-actions
Copy link
Contributor

In order to maintain a backlog of relevant pull requests, we automatically label them as stale after 180 days of inactivity.

If this pull request is still important to you, please comment below to remove the stale label. Otherwise, this pull request will be automatically closed in 60 days. If this pull request only suffers from a lack of reviewers, please tag the @ESMValGroup/technical-lead-development-team so they can help you find a suitable reviewer.

@github-actions github-actions bot added the Stale label Jul 13, 2025
@github-actions
Copy link
Contributor

This stale pull request has been automatically closed due to a lack of community activity.

If you still care about this pull request, please re-open it. If you do not have sufficient permissions for this, tag the @ESMValGroup/technical-lead-development-team in a comment below including a short message that this pull request is still relevant to you. They will re-open it on your behalf.

@github-actions github-actions bot closed this Sep 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Preprocessor extract_season does not return complete seasons

4 participants