-
-
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
Refactor update coordinates to better handle multi-coordinate indexes #8094
Conversation
Fix more cases with multi-coordinate indexes: - do not try to align existing indexed coordinates with the new coordinates that will fully replace them - raise early if the new coordinates would corrupt the existing indexed coordinates - isolate PandasMultiIndex special cases so that it will be easier to drop support for it later (and warn now about deprecation)
when DataArray objects are passed as new coordinate objects
Need to update (replace) coordinates and data variables separately to ensure it goes through all (indexed) coordinate update checks.
Can you check if this benchmark regression is real
|
@dcherian the benchmark regression is fixed. I think this is ready for review. Regarding the multi-index deprecation warnings: there are still a lot of places where |
I can't review the code really but have suggestions on the warning message. Can you silence these two:
I think the warning should show the syntax for "passing it as coordinates"
|
Do you mind if I address this in a follow-up PR? I started silencing warnings (there are a few dozen more in the tests!). Also there are still quite many cases where the warning should be emitted but is not (e.g., passing |
assign_coords
does not drop indexes #8056whats-new.rst
This refactor should better handle multi-coordinate indexes when updating (or assigning) new coordinates.
It also fixes, better isolates and better warns a bunch of deprecated pandas multi-index special cases (i.e., directly passing
pd.MultiIndex
objects or updating a multi-index dimension coordinate). I very much look forward to seeing support for those cases dropped :).