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

Restrict "gregorian" label to only dates in the Gregorian calendar #319

Closed
Dave-Allured opened this issue Apr 2, 2021 · 16 comments
Closed
Labels
enhancement Proposals to add new capabilities, improve existing ones in the conventions, improve style or format

Comments

@Dave-Allured
Copy link
Contributor

Summary of Proposal

When using specifically the gregorian calendar attribute with time coordinates, restrict the time range to only dates in the real-world Gregorian calendar. That is, date/times no earlier than 1582 October 15 00:00:00.

Usage for dates earlier than the Julian/Gregorian crossover of 1582 October 15 is deprecated but not prohibited, because of possible usage in existing data sets.

The initial proposal is to add this restriction to the gregorian label, but leave the standard and CF default (unspecified) calendars unchanged.

Until now, gregorian and standard were both synonyms for the default mixed Julian/Gregorian calendar as defined by UDUNITS, and in common usage with netCDF since the 1990's. This proposal would split gregorian and standard into two separate calendar definitions in CF section 4.4.1.

This is a recurring request, such as in issues #148 and #298, and at other times.

Reference: Wikipedia article "Gregorian calendar"

Details

Same as in the proposal for #298, this restriction on dates would apply to both the reference date/time string, and to encoded date/time values.

@Dave-Allured Dave-Allured added the enhancement Proposals to add new capabilities, improve existing ones in the conventions, improve style or format label Apr 2, 2021
@JonathanGregory
Copy link
Contributor

I agree with the desirability of distinguishing the default mixed Julian/Gregorian calendar from the Gregorian. It does not make sense to call dates "Gregorian" when they are earlier than the invention of the Gregorian calendar and don't conform to the Gregorian calendar rules. Redefining gregorian to have a distinct meaning from standard (=default), as @Dave-Allured proposes, would achieve that aim, but it would be backward-incompatible. It wouldn't invalidate any existing data, but it would mean that something which is presently legal would become illegal, and thus the change would potentially break existing software which doesn't check the version of the CF convention. This is not disastrous, but we don't usually make such changes to the convention. Hence I would prefer to deprecate gregorian, meaning that the CF checker would produce a warning if it was used in future. If there is a need for a Gregorian calendar which can only be used from 1582, we should introduce a new one for that purpose e.g. strict_gregorian. Is there a use-case for it? Jonathan

@taylor13
Copy link

taylor13 commented Apr 3, 2021

I agree with Jonathan that we should avoid making changes that make illegal something that is currently legal in CF. I would therefore favor his suggestion to deprecate gregorian when dates precede 1582. Users who want to use the gregorian algorithm to compute dates before 1582 should instead use the proleptic_gregorian calendar for that purpose (if I've interpreted the proposal correctly).

@taylor13
Copy link

taylor13 commented Apr 3, 2021

And while we're at it, what about the julian calendar? Should we, for consistency, deprecate its use for dates after 1582? Perhaps not, since there are probably some models with simplified calendars defined in which leap years invariably occur every 4 years.

@larsbarring
Copy link
Contributor

I very much support this proposal. Equating gregorian with mixed gregorian/julian has always been a CF oddity to my mind. And I agree with Jonathan and KarI that existing datasets should not be invalidated. Jonathan asks the question whether we need a strict_gregorian calendar as replacement; the only though not very strong use case I can think of right now is to clearly show that the "old gregorian" is indeed deprecated. For all practical purposes the proleptic-gregorian calendar can be used instead of a strict_gregorian.

This might be a separate issue, but I raise here for reference: If gregorian is deprecated we should review how the 365_day and 366_day calendars are described in Section 4.4.1. What does it mean that a calendar is "Gregorian calendar without leap years" and "Gregorian calendar with every year being a leap year", presumably the system of varying month lengths?

@davidhassell
Copy link
Contributor

davidhassell commented Jun 14, 2021

Hello,

Here's my summary of where we are with this issue. Please say if you think that I've misrepresented/misunderstood anything.

It seems like there is support for deprecating gregorian. When the Gregorian calendar is intended for dates after 1582, we could introduce a new calendar (e.g. strict_gregorian), or else use the existing proleptic_calendar, which is the same as Gregorian for dates after 1582.

The noleap and all_leap calendars could be updated in a backwards-compatible fashion to refer to the proleptic Gregorian calendar (see comment on the julian calendar).

David

@chris-little
Copy link

@davidhassell To strengthen your argument in the 5th bullet, many countries/communities did not switch to Gregorian, and therefore continued with the Julian calendar as late as 1923, and may have annotated their observations or data that way.

@larsbarring
Copy link
Contributor

@davidhassell Thank you for this summary,which I think captures it all. Referencing the proleptic_gregorian calendar instead of the gregorian, as you suggest in your fourth point, provides an elegant and easy way to update calendar definitions (section 4.4.1, and possibly elsewhere).

@zklaus
Copy link

zklaus commented Jun 15, 2021

It seems like there is support for deprecating gregorian. When the Gregorian calendar is intended for dates after 1582, we could introduce a new calendar (e.g. strict_gregorian), or else use the existing proleptic_calendar, which is the same as Gregorian for dates after 1582.

To be clear, does this refer only to the gregorian calendar or also to the standard calendar?

@davidhassell
Copy link
Contributor

Good point, @zklaus. I think that all this applies only to gregorian, i.e. the standard calendar (= Mixed Gregorian/Julian calendar as defined by Udunits) remains unchanged by this proposal.

In that case, we need to be clear that the default calendar has changed to standard, rather than "gregorian" or "standard".

@taylor13
Copy link

From the above, it's not clear to me whether or not a strict_gregorian calenadar is or is not being proposed. I think it would be a mistake to include it, and I don't think "strict" is optimal as a descriptor. I'll provide reasoning if it is in fact being proposed here.

@larsbarring
Copy link
Contributor

I agree with @taylor13. As I hinted at earlier I can see no specific reason for having a specific strict_gregorian calendar (whatever it might called). And in addition to what arguments Karl might think of for not having it, I think that the the comment by @chris-little indirectly points in the same direction,.

@JonathanGregory
Copy link
Contributor

A strict_gregorian calendar would be one which is Gregorian and must not be used before 1582 i.e. that would be an error, whereas proleptic_gregorian can be used both before and after 1582 without error or warning - that is the point of it. However, I am not in favour of strict_gregorian. I raised the possibility in case there was a use-case for it, but no-one's described one. Hence I'm happy if we drop it.

I agree with @davidhassell's summary, with the addition of @zklaus that we redefine the default as standard alone. Jonathan

@davidhassell
Copy link
Contributor

It looks like a consensus solution has emerged:

  • The gregorian calendar is deprecated.
  • The default calendar is redefined as standard alone.
  • The noleap and all_leap calendars are both redefined to be modifications of the proleptic gregorian calendar.

Does that sound right? @Dave-Allured, would you like to put together a pull request for these changes?

Thanks all,
David

@davidhassell
Copy link
Contributor

The changes agreed here will now be incorporated into the wider-ranging changes of #298 "Interpretation of negative years in the units attribute" (#298 (comment)). This not only makes it easier to write up the PR for #298, but will also avoid merge conflicts that are likely to occur if these two issues are treated separately.

The PR for #298 will also add @Dave-Allured to the CF authors in recognition of his raising the issue and the work he has done on it (unless he would prefer not) (#298 (comment)).

Therefore, when #298 is closed, this issue may be closed as well.

Thanks everyone.

@davidhassell
Copy link
Contributor

Thanks to @JonathanGregory for putting together the pull request that will close this issue (as well as #298). This PR (#331) should be merged on 23rd July, three weeks from today, if no concerns are raised.

@JonathanGregory
Copy link
Contributor

There have been no further comments for three weeks and sufficient support has been expressed, so this change is therefore accepted according to the rules. I have merged #331. Thanks to all contributors to the discussion, especially @Dave-Allured, who raised this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Proposals to add new capabilities, improve existing ones in the conventions, improve style or format
Projects
None yet
Development

No branches or pull requests

7 participants