forked from pydata/xarray
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add set_xindex and drop_indexes methods (pydata#6971)
* temporary API to set custom indexes * add the temporary index API to DataArray * add options argument to Index.from_variables() It allows passing options to the constructor of a custom index class (if any). The **options arguments of Dataset.set_xindex() are passed through. Also add type annotations to set_xindex(). * fix mypy * remove temporary API warning * add the Index class in Xarray's root namespace * improve set_xindex docstrings and add to api.rst * remove temp comments * special case for pandas multi-index dim coord * add tests for set_xindex * error message tweaks * set_xindex with 1 coord: avoid reodering coords * mypy fixes * add Dataset and DataArray drop_indexes methods * improve assert_no_index_corrupted error msg * drop_indexes: add tests * add drop_indexes to api.rst * improve docstrings of legacy methods * add what's new entry * try using correct typing w/o mypy complaining * make index_cls arg optional Try setting a pandas (multi-)index by default. * docstrings fixes and tweaks * make Index.from_variables options arg keyword only * improve set_xindex invalid coordinates error msg * add xarray.indexes namespace * type tweaks Co-authored-by: Keewis <[email protected]>
- Loading branch information
Showing
9 changed files
with
415 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.