`Coordinates` operations
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.2k
- Forks
- 1.4k
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 14
Description
What is your issue?
At the moment, the Coordinates objects are not as useful as I'd like them to be, so in this issue I'd like to collect all the methods it should support. Some of these already exist, but listing them again helps with defining a coherent API:
- coordinate variables
- assignment of new coordinates (from
Variable/DataArray/Coordinates/ any array):Coordinates.assign() - deletion of coordinates (similar to
Dataset.drop_vars): only viadel coords["x"]but aCoordinates.drop_vars()might be welcome I guess - renaming coordinates: no specific method yet,
Coordinates.rename_vars()? - renaming dimensions on coordinates: no specific method yet,
Coordinates.rename_dims()?
- assignment of new coordinates (from
- indexes
- assignment of index instances: could use
Coordinates.assign(Coordinates.from_xindex(idx_obj))but one index at a time - dropping indexes:
Coordinates.drop_indexes()(#8118) - creation of an index based on variables, a given class, and additional options:
Coordinates.set_xindex()(#8118)
- assignment of index instances: could use
- combination
- merging (also using
|)
- merging (also using
cc @benbovy, @scottyhq
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the existing Coordinates API and the unchecked operations listed in the issue, especially Coordinates.assign() and index assignment. Read the related drop_indexes() and set_xindex() work in issue #8118, then compare it with the existing deletion, renaming, and merging behavior. Done would require an agreed, coherent Coordinates API for the remaining operations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100