-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 a days_in_month accessor to CFTimeIndex #3935
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @spencerkclark . LGTM.
Can you strip outputs from the notebook? That should reduce the diff here and later when it gets updated next.
That didn't occur to me, thanks. That's indeed much better. I added a documentation note as well; things should hopefully be all set now. |
Fantastic! Thanks @spencerkclark! |
Thanks @spencerkclark |
isort -rc . && black . && mypy . && flake8
whats-new.rst
for all changes andapi.rst
for new APIThis adds a
days_in_month
accessor to CFTimeIndex, which allows for easy computation of monthly time weights for non-standard calendars:This simplifies the "Calculating Seasonal Averages from Timeseries of Monthly Means" example @jhamman wrote for the docs a while back, which I've taken the liberty of updating.
The ability to add this feature to xarray is thanks in large part to @huard, who added a
daysinmonth
attribute tocftime.datetime
objects late last year: Unidata/cftime#138.