home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 1331855489

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
1331855489 PR_kwDOAMm_X8480Dc3 6889 Harmonize returned multi-indexed indexes when applying `concat` along new dimension 19226431 closed 0     6 2022-08-08T13:12:45Z 2022-08-25T14:12:55Z 2022-08-25T11:15:54Z CONTRIBUTOR   0 pydata/xarray/pulls/6889
  • [x] Closes #6881
  • [x] Tests added

In the current implementation, the concat function does not ensure that the indexes that belong to the same MultiIndex relate to the same MultiIndex object in Dataset.indexes when concatenating along a new dimension. This becomes a problem as soon as the returned dataset needs to be aligned (for broadcasting, reindexing etc.), see #6881 for example. As far as I understand, this bug was introduced in https://github.com/pydata/xarray/pull/5692 following the idea that the concat function should disentangle indexes and dimensions.

It can be fixed by not removing the index name from the list of indexes which should be merged, see https://github.com/pydata/xarray/blob/9050a8b9efc28142b762475c7285603a87b00e83/xarray/core/concat.py#L493. All indexes contained in this list will get a new index object. Currently, this list only contains the levels of a multi-indexed index, not the index name itself. This is removed as it is contained in dim_names. Instead of removing all dimension names from this list, I suggest to only remove unlabeled dimensions from this list.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/6889/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

  • 1 row from issues_id in issues_labels
  • 6 rows from issue in issue_comments
Powered by Datasette · Queries took 4.143ms · About: xarray-datasette