home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 953235338

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
953235338 MDExOlB1bGxSZXF1ZXN0Njk3MzA3NDc3 5636 Refactor index vs. coordinate variable(s) 4160723 closed 0     4 2021-07-26T19:54:25Z 2023-08-30T09:21:55Z 2021-08-09T07:56:56Z MEMBER   0 pydata/xarray/pulls/5636
  • [x] Closes #5553
  • [x] Tests added
  • [x] Passes pre-commit run --all-files
  • [x] User visible changes (including notable bug fixes) are documented in whats-new.rst

This implements option 3 (sort of) described in https://github.com/pydata/xarray/issues/5553#issue-933551030:

  • the goal is to avoid wrapping an xarray.Index into an xarray.Variable and keep those two concepts distinct from each other.
  • the xarray.Index.from_variables class constructor accepts a dictionary of xarray.Variable objects as argument and may (or should?) also return corresponding xarray.IndexVariable objects to ensure immutability.
  • for PandasIndex, the new returned xarray.IndexVariable wraps the underlying pd.Index via a PandasIndexingAdapter (this reverts some changes made in #5102).
  • for PandasMultiIndex, this PR adds PandasMultiIndexingAdapter so that we can wrap the pandas multi-index in separate coordinate variables objects: one for the dimension + one for each level. The level coordinates data internally hold a reference to the dimension coordinate data to avoid indexing the same underlying pd.MultiIndex for each of those coordinates (PandasMultiIndexingAdapter.__getitem__ is memoized for that purpose).

This is very much work in progress, I need to update (or revert) all related parts of Xarray's internals, update tests, etc. At this stage any comment on the approach described above is welcome.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/5636/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    13221727 pull

Links from other tables

  • 2 rows from issues_id in issues_labels
  • 4 rows from issue in issue_comments
Powered by Datasette · Queries took 0.532ms · About: xarray-datasette