-
Notifications
You must be signed in to change notification settings - Fork 61
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
Adapt to CF conventions 1.9 - remove gregorian calendar #935
Conversation
Co-authored-by: David Huard <[email protected]>
if obj.calendar == "gregorian": | ||
return "standard" |
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.
Perhaps this comment is out of scope, but would we want to emit a warning here about this change of calendar? I don't think we specify any output Conventions
to our datasets. Should we be appending this information to our output Datasets?
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.
I think we do not add this attribute, simply because we don't output Datasets. If we ever do, than I guess we could append the info. And if we do, we'll have to be even more careful about this kind of change.
It's a good question. But I believe that this change doesn't need a warning :
- CF conventions have always accepted "standard" as equivalent to "gregorian", they just dropped the latter recently.
- Code might "break", but only with cftime <= 1.5.1. For people using the forthcoming cftime 1.5.2, this break will be generalized and we will be able to shift responsability to them ;).
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.
If that's the case, is this an event where we should bump the required version of CFtime within xclim?
EDIT: the new CFtime isn't released yet. Never mind for now.
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.
It's not released yet! That bug was found because of our smart tox builds using the master!
Pull Request Test Coverage Report for Build 1505393848
💛 - Coveralls |
…s/heat_index * 'indices/heat_index' of github.com:UCL/xclim: (42 commits) Added french metadata for heat index. Apply changes to fraction indicator [sdba] Re-write of Extreme's adjustment (Ouranosinc#914) update history Update history [Ouranosinc#931] Fix indicator for Rxxp index Add missing type for `threshold_count` Add dev notes - add indexer example - other small changes run all available tests in one call for slow builds update makefile target black, only install coveralls in tox if coveralls is needed Indexing within indicators (Ouranosinc#934) Update history finish needs doctests Remove unnecessary keep_attrs Adapt to CF conventions 1.9 - remove gregorian calendar (Ouranosinc#935) Bump version: 0.31.2-beta → 0.31.3-beta update HISTORY.rst suggested corrections Apply suggestions from code review Resampling indicator (Ouranosinc#927) ...
…es/wetday_prop * 'indices/wetday_prop' of github.com:UCL/xclim: (46 commits) Add moi-meme as 0.32 contributor do not redefine builtin next use array_almost_equal in tests Update history Improve quantile function Apply changes to fraction indicator [sdba] Re-write of Extreme's adjustment (Ouranosinc#914) update history Update history [Ouranosinc#931] Fix indicator for Rxxp index Add missing type for `threshold_count` Add dev notes - add indexer example - other small changes run all available tests in one call for slow builds update makefile target black, only install coveralls in tox if coveralls is needed Indexing within indicators (Ouranosinc#934) Update history finish needs doctests Remove unnecessary keep_attrs Adapt to CF conventions 1.9 - remove gregorian calendar (Ouranosinc#935) Bump version: 0.31.2-beta → 0.31.3-beta ...
Pull Request Checklist:
number
) and pull request (:pull:number
) has been added.bumpversion patch
has been called on this branch.zenodo.json
What kind of change does this PR introduce?
cftime
that made this change yesterday (address deprecation of calendar='gregorian' in CF v1.9 (issue #256) Unidata/cftime#257).get_calendar
andensure_ctime_array
to fix a bug I saw while making this change. Both were failing in some edgecases involvingxr.CFTimeIndex
objects.Does this PR introduce a breaking change?
Yes,
get_calendar
will never return "gregorian", but "standard".