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

Any updates needed due to CF version 1.9 is deprecating gregorian calendar? #256

Closed
larsbarring opened this issue Nov 2, 2021 · 4 comments

Comments

@larsbarring
Copy link

Are there any implications for cftime because of CF version 1.9 is deprecating gregorian calendar as synonym for the standardmixed Julian/Gregorian calendar? One possible example that I recently came across is name of the datatype DatetimeGregorian; maybe it should be DatetimeStandard instead?

@jswhit
Copy link
Collaborator

jswhit commented Nov 5, 2021

PR #257 causes a DeprecationWarning to be raised if calendar='gregorian' is used. A DatetimeStandard class was added, but DatetimeGregorian is kept for backwards compatibility.

@davidhassell
Copy link
Contributor

Hello, Is it right to raise a warning if calendar='gregorian' is used? For the nearly all existing CF-netCDF datasets at time of writing (i.e. those at CF<=1.8), gregorian is valid and so using cftime to parse such a file would, I feel, lead to an inappropriate message. I think silently changing the calendar to standard in such cases is fine, as this PR would do without these warnings. What do you think?

This warning pops up in two places:

cftime/src/cftime/_cftime.pyx

Lines 1053 to 1054 in 67eeb68

if calendar == 'gregorian':
msg="calendar name 'gregorian' deprecated in CF v1.9 (use 'standard' instead)"

cftime/src/cftime/_cftime.pyx

Lines 1770 to 1771 in 67eeb68

if calendar == 'gregorian':
msg="calendar name 'gregorian' deprecated in CF v1.9 (use 'standard' instead)"

Thanks, David

@larsbarring
Copy link
Author

I raised this issue as a question, and think that it might be reasonable to automagically change fromgregorian calendar to standard as they were synonyms. But I am not the right person to comment whether it should be done silently or not.

@jswhit
Copy link
Collaborator

jswhit commented Nov 6, 2021

I went ahead and removed the DeprecationWarning, and now gregorian is just silently changed to standard. I think @davidhassell is right, since 'gregorian' has been in use since forever, that warning would be annoying.

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

No branches or pull requests

3 participants