-
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
comparing vs. subtracting different calendars #236
Comments
PR #234 enabled |
Change ValueError to TypeError in datetime.__sub__ (closes issue #236)
Great, thanks @jswhit -- that indeed fixed the issue @mathause identified. The removal of It was fairly straightforward to remove nc-time-axis's use of |
Unfortunately it did not work. Actually pandas ignores the Still I think Edit: we can probably do pd.Series([time_1, time_2]).diff() which will raise the appropriate error. |
Oops, I don't know how I missed that that test still failed in the xarray test suite...thanks @mathause for correcting me. I agree we can work around this in xarray. |
I think from my side this can be closed - thanks @jswhit & @spencerkclark |
The following snipped used to raise a
TypeError
. With the changed behavior of__richcompare__
this now raises aValueError
in__sub__
which pandas ignores:This is used in xarray to avoid combining datasets with different calendars, which does not really work anymore with this change. I don't know why pandas ignores the error (and it's not silent). So it's not really a cftime issue but I thought I report it here anyway.
__sub__
between different calendars?__sub__
raise aTypeError
instead of aValueError
The text was updated successfully, but these errors were encountered: