Skip to content

Conversation

@jswhit
Copy link
Collaborator

@jswhit jswhit commented Jan 8, 2026

same as 'proleptic_gregorian', but only valid for dates after 1958-01-01.

exceptions are raised if dates before 1958 are requested or a base date before 1958-01-01 is used.

Tests added by @ChrisBarker-NOAA

@jswhit
Copy link
Collaborator Author

jswhit commented Jan 8, 2026

@ChrisBarker-NOAA could you take a look?

Copy link

@ChrisBarker-NOAA ChrisBarker-NOAA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me -- thanks Jeff!

It could use some tests, though. maybe I'll find a bit of time to write a couple soon -- but don't wait for me.

@ChrisBarker-NOAA
Copy link

ChrisBarker-NOAA commented Jan 9, 2026

Hmm -- I'm adding some tests -- stay tuned for that.

But looking at the code more, should assert_valid_date check for < 1958 for tai?

though it doesn't seem to know which calendar it's using, so I guess not, but there should be a check somewhere.

and there is -- before assert_valid_date() is called :-)

@ChrisBarker-NOAA
Copy link

Looking, I can't tell for sure, but I think that a tai calendar could get a TZInfo attached to it, which should be illegal.

@ChrisBarker-NOAA
Copy link

Scratch that -- I see that the cftime.datetime class init doesn't take that keyword anyway.

@ChrisBarker-NOAA
Copy link

OK -- I did add tests -- see: #389

Once I was thinking about it, I figured why not?

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

Successfully merging this pull request may close these issues.

4 participants