-
Notifications
You must be signed in to change notification settings - Fork 220
Rename calendrical_calculations::iso
to calendrical_calculations::gregorian
#6843
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
base: main
Are you sure you want to change the base?
Conversation
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. |
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'm not really sold on this. This is one of the few modules that will get called outside of implementing that module's calendar, calling it iso (which is more accurate, and more broadly applicable) is good. The book naming is useful for verifying code correctness but I don't think we need to match it exactly. We have a fair amount of important stuff that doesn't come from the book already, like keviyah.
Furthermore, helpers like the week thing from my draft PR or the Neri/Schneider code could probably go in here.
But it's not? ISO is a specialized Gregorian calendar and interchange format, but it's first and foremost a Gregorian calendar, and all the calculations here are general Gregorian calculations, like the calculations in the I was actually looking for Gregorian logic in this crate and couldn't find anything. It took me a while (and checking the book) to figure out that everything that is called gregorian* in the book is called iso* in our crate (while the book has iso* functions that mean something completely different). |
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 don't have an opinion unless you want me to form one
I'd say the same for looking for iso logic. I'm happy with a reexport if that helps, and ensuring that the lisp method names are mentioned in the docs. |
Gregorian is by far the more common name for this calendar, and if the book uses it, we should use it at least in this crate. I honestly don't understand why we have an |
We have it as a primitive, basically. And the problem with "gregorian" is that often that includes the switchover, which you really don't want to have to think about when working with an ISO datetime primitive. Gregorian is the more used one but when writing datetime code "ISO" is thrown around a lot. The name is useful too. I'm in favor of making this more discoverable for gregorian users, I'm against making it less discoverable for ISO users or making a breaking change. I think there's plenty of stuff we can do that satisfies both. |
The only APIs that expose the year 0 difference between these calendars are
So what if we want to implement the ISO week calendar from the book? That should own the |
I meant gregorian-julian switchover. Just "Gregorian" is ambiguous. When implementing a Gregorian calendar, that's something you should check for and it's fine for that to be something you have to. When doing other calendrical stuff you should not have to worry about your main calendrical primitive being ambiguous.
I'd call it This crate is more than a wrapper around the Reingold calculations. It's mostly that, but it's more, too. |
/// represented as the number of days since ISO date 0001-01-01. | ||
pub mod rata_die; | ||
|
||
#[deprecated(since = "0.2.1", note = "use `gregorian`")] |
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 guess my problem with this is that I think most of the current users of this API should be calling it ISO, not gregorian.
Only calendar/src/cal/gregorian.rs should call it gregorian.
Definitely the zoneinfo64 code shouldn't be calling it "gregorian"; time zone code I have seen is very consistent about using "ISO".
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'm okay with the reexport, I'm not okay with this being considered second class.
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.
Definitely the zoneinfo64 code shouldn't be calling it "gregorian"; time zone code I have seen is very consistent about using "ISO".
zoneinfo64 should definitely call Gregorian, that's the calendar. I don't know where we got the concept of ISO as a calendar from (temporal?), but it's not universal (ICU4C/J doesn't have it).
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.
Temporal, yes, but I've seen the notion of "ISO date" when reading standards a fair amount.
The book uses the term "ISO calendar" for the ISO week calendar, which is another (unimplemented) calendar.
We should follow its naming in this crate.