-
Notifications
You must be signed in to change notification settings - Fork 39
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
cftime.datetime does not allow addition #198
Comments
I would be +1 on this. It's often quite useful to be able to construct datetimes starting from a string calendar name rather than an explicit |
Pull request would be welcomed. |
PR #199 implements this by changing the name of the base class |
PR #201 is an alternate fix that does not require changing the name of the base class. It does require changing the default calendar from |
PR #202 is yet another alternate fix that does not require changing the name of the base class, nor does it degrade performance by migrating the base class to python. It creates 'calendar-aware' instances of the base-class directly using the calendar kwarg to |
xarray tests pass with PR #202. nc-time-axis requires a small change to the tests. PR #202 is my preferred solution to this issue. It doesn't sacrifice any performance, and probably will have the least impact on existing code. |
closed by PR #202 |
cftime.datetime
returns an object of typecftime._cftime.datetime
, which cannot be added to or subtracted from using atimedelta
. Based on itscalendar
keyword argument, I would expect it to return a subclass such asDatetimeJulian
which has arithmetic defined.The text was updated successfully, but these errors were encountered: