-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix CFTimeIndex-related errors stemming from updates in pandas #3764
Conversation
This is a little bit trickier than I originally anticipated. For indexing with dates very distant from the dates in the index, I'm still running into an issue at this step in
Consider the following the example:
In this example One could argue that we could fall back on using a generic
A problem occurs though when we try to take the absolute value of this index. Pandas (I think reasonably so) tries to detect the datatype of the result and construct a new index. In doing so it tries to create a Result of np.abs(difference)
So I'm a little bit back to the drawing board regarding a solution for this. Part of me is tempted to write an overriding version of |
I added some updates to this PR this morning that in principle would solve the indexing with In addition, for the time being I xfailed Finally in the process of doing this, I cleaned up the implementation of |
ping @shoyer for input. |
Re the specific issue, that's a tough one. It could be worth floating on pandas and seeing if they have thoughts... |
+1 for marking as xfail. There’s no point in keeping the master branch
failing if we know what the issue is.
…On Thu, Feb 27, 2020 at 7:22 PM Maximilian Roos ***@***.***> wrote:
Re the specific issue, that's a tough one. It could be worth floating on
pandas and seeing if they have thoughts...
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3764?email_source=notifications&email_token=AAJJFVXTH5QBZHOH47UZIQDRFB7NXA5CNFSM4KTAWZ7KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENG2V6Y#issuecomment-592292603>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJJFVQKSGKMKA35V4JDV4DRFB7NXANCNFSM4KTAWZ7A>
.
|
Hello @spencerkclark! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2020-03-09 07:37:46 UTC |
These changes look good to me. It's definitely not ideal to be overriding all these details on CFTimeIndex -- this why xarray needs its own indexing API -- but for now it seems like about the best we can do. |
It's also worth noting that this note appears to be causing our doc builds to fail: https://readthedocs.org/projects/xray/builds/10604464/ |
I'm going to merge this to see if it fixes our doc build... |
…e-size * upstream/master: (24 commits) Fix alignment with join="override" when some dims are unindexed (pydata#3839) Fix CFTimeIndex-related errors stemming from updates in pandas (pydata#3764) Doctests fixes (pydata#3846) add xpublish to related projects (pydata#3850) update installation instruction (pydata#3849) Pint support for top-level functions (pydata#3611) un-xfail tests that append to netCDF files with scipy (pydata#3805) remove panel conversion (pydata#3845) Add nxarray to related-projects.rst (pydata#3848) Implement skipna kwarg in xr.quantile (pydata#3844) Allow `where` to receive a callable (pydata#3827) update macos image (pydata#3838) Label "Installed Versions" item in Issue template (pydata#3832) Add note on diff's n differing from pandas (pydata#3822) DOC: Add rioxarray and other external examples (pydata#3757) Use stable RTD image. removed mention that 'dims' are inferred from 'coords'-dict when omit… (pydata#3821) Coarsen keep attrs 3376 (pydata#3801) Turn on html repr by default (pydata#3812) Fix zarr append with groups (pydata#3610) ...
isort -rc . && black . && mypy . && flake8
whats-new.rst
for all changes andapi.rst
for new APIThis fixes the errors identified when #3751 was created by allowing one to subtract a
pd.Index
ofcftime.datetime
objects from aCFTimeIndex
.Some new errors have come up too (not associated with any updates I made here), which I still need to work on identifying the source of: