Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Var.split_by_season_across_time #207

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

ph-kev
Copy link
Member

@ph-kev ph-kev commented Feb 28, 2025

This PR adds Var.split_by_season_across_time. The difference between this and Var.split_by_season is that the splitting is also done across time.

  • Add to NEWS.md
  • Add documentation

Copy link

codecov bot commented Feb 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.31%. Comparing base (7513972) to head (cc93bac).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #207      +/-   ##
==========================================
+ Coverage   98.25%   98.31%   +0.05%     
==========================================
  Files          12       12              
  Lines        1263     1302      +39     
==========================================
+ Hits         1241     1280      +39     
  Misses         22       22              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ph-kev ph-kev force-pushed the kp/seasonal-over-time branch 3 times, most recently from cf10715 to 3bad53f Compare February 28, 2025 21:36
@ph-kev ph-kev requested a review from Sbozzolo February 28, 2025 21:36
@ph-kev ph-kev marked this pull request as ready for review February 28, 2025 23:39
Copy link
Member

@Sbozzolo Sbozzolo left a comment

Choose a reason for hiding this comment

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

Can you please also add a FAQ explaining the difference between the two functions and caveats?

NEWS.md Outdated
Comment on lines 7 to 8
It may be the case that you want to split seasons, but also want to retain the order that
the seasons appear in across time. This can be done by using `split_by_season_across_time`.
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand this. Could you add an example?

src/Utils.jl Outdated
"""
split_by_season_across_time(dates::AbstractArray{<:Dates.DateTime})

Split `dates` into a vector of vectors of dates split by seasons across time.
Copy link
Member

Choose a reason for hiding this comment

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

Can you add some further description here?

It is not clear what this function does just by reading the docstring

src/Var.jl Outdated
"""
split_by_season_across_time(var::OutputVar)

Return a vector of `OutputVar`s split by season across time.
Copy link
Member

Choose a reason for hiding this comment

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

Can you add some further description here?

It is not clear what this function does just by reading the docstring and how it differs from split_by_season

src/Var.jl Outdated
Comment on lines 1323 to 1324
expected to be second. Also, the interpolations will be inaccurate in time intervals
outside of their respective season for the returned `OutputVar`s.
Copy link
Member

Choose a reason for hiding this comment

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

Let's move this "Also" in a note and explain it a little bit better (maybe with an example)

ph-kev added 2 commits March 3, 2025 15:06
Refactor `Var.split_by_season` into `Var._check_time_dim` and
`Var._split_along_dim`.
@ph-kev ph-kev force-pushed the kp/seasonal-over-time branch from 3bad53f to d2bc04c Compare March 3, 2025 23:07
@ph-kev ph-kev force-pushed the kp/seasonal-over-time branch from d2bc04c to cc93bac Compare March 3, 2025 23:09
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.

2 participants