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

DateFromJulianDay : day is out of range for month #49

Closed
pelson opened this issue May 22, 2018 · 3 comments
Closed

DateFromJulianDay : day is out of range for month #49

pelson opened this issue May 22, 2018 · 3 comments
Labels

Comments

@pelson
Copy link

pelson commented May 22, 2018

The following was raised in SciTools/cf-units#77:

>>> import cftime
>>> cftime.DateFromJulianDay(2450022.5, "standard")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "cftime/_cftime.pyx", line 709, in cftime._cftime.DateFromJulianDay
ValueError: day is out of range for month

I haven't taken the time to dig further into this, but looks like reasonable input to the function.

When doing a bit of digging, I also tried:

>>> cftime.DateFromJulianDay(2450022.5, "standard", only_use_cftime_datetimes=True)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "cftime/_cftime.pyx", line 709, in cftime._cftime.DateFromJulianDay
  File "cftime/_cftime.pyx", line 1759, in cftime._cftime.DatetimeGregorian.__init__
  File "cftime/_cftime.pyx", line 1903, in cftime._cftime.assert_valid_date
ValueError: invalid day number provided in cftime.DatetimeGregorian(1995, 10, 32, 23, 59, 59, 999952, -1, 1)
@pelson pelson changed the title day is out of range for month DateFromJulianDay : day is out of range for month May 22, 2018
@jhamman jhamman added the bug label May 22, 2018
@jhamman
Copy link
Collaborator

jhamman commented May 22, 2018

Thanks @pelson for the report. This does seem like a bug.

jswhit added a commit that referenced this issue Aug 16, 2018
jswhit added a commit that referenced this issue Aug 16, 2018
This reverts commit 4cce4de.
jswhit added a commit that referenced this issue Aug 16, 2018
@jswhit
Copy link
Collaborator

jswhit commented Aug 16, 2018

pull request #65 fixes this (by re-introducing an old bug fix that was somehow lost)

@jswhit jswhit mentioned this issue Aug 16, 2018
jswhit added a commit that referenced this issue Aug 17, 2018
fix for 'day out of range error' (issue #49)
@jswhit
Copy link
Collaborator

jswhit commented Aug 17, 2018

fixed now in master, closing

@jswhit jswhit closed this as completed Aug 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants