home / github

Menu
  • Search all tables
  • GraphQL API

issues

Table actions
  • GraphQL API for issues

1 row where repo = 13221727 and user = 5311739 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: created_at (date), updated_at (date)

type 1

  • issue 1

state 1

  • open 1

repo 1

  • xarray · 1 ✖
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
1672146474 I_kwDOAMm_X85jqu4q 7763 xr.concat error behaviour differs based on input DataArray ordering oliverhiggs 5311739 open 0     1 2023-04-18T00:13:27Z 2023-04-24T16:04:37Z   NONE      

What happened?

When using xr.concat without specifying the coords argument and with input DataArrays of differing dimensions, where one is missing a dimension that is present in the others, the behaviour of the function will depend on the order and number of the arrays in the input list. The expected behaviour is that a ValueError prompting the use of coords='minimal' will be raised, however this error is not raised when either: * There are only two DataArrays in the provided list; or * The DataArray with the missing dimension is first in the list.

In these instances, the xr.concat function acts as if coords='minimal' has been specified and broadcasts the smaller DataArray without erroring.

What did you expect to happen?

The raising of errors when using xr.concat should be consistent and not depend on the ordering or number of inputs.

Minimal Complete Verifiable Example

```Python a = xr.DataArray([[1,2,3],[4,5,6]], coords=[('first', [10, 20]), ('second', ['a', 'b', 'c'])]) b = xr.DataArray([[10,20,30],[40,50,60]], coords=[('first', [30, 40]), ('second', ['a', 'b', 'c'])]) c = xr.DataArray([100, 200], coords=[('first', [10, 20])])

xr.concat([a, b, c], dim='first') # Errors as expected xr.concat([b, a, c], dim='first') # Errors as expected xr.concat([c, a, b], dim='first') # Does not error xr.concat([a, c], dim='first') # Does not error xr.concat([c, a], dim='first') # Does not error ```

MVCE confirmation

  • [X] Minimal example — the example is as focused as reasonably possible to demonstrate the underlying issue in xarray.
  • [X] Complete example — the example is self-contained, including all data and the text of any traceback.
  • [X] Verifiable example — the example copy & pastes into an IPython prompt or Binder notebook, returning the result.
  • [X] New issue — a search of GitHub Issues suggests this is not a duplicate.

Relevant log output

No response

Anything else we need to know?

No response

Environment

INSTALLED VERSIONS ------------------ commit: None python: 3.10.11 (main, Apr 5 2023, 14:15:10) [GCC 9.4.0] python-bits: 64 OS: Linux OS-release: 5.15.90.1-microsoft-standard-WSL2 machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: C.UTF-8 LOCALE: ('en_US', 'UTF-8') libhdf5: None libnetcdf: None xarray: 2023.4.0 pandas: 2.0.0 numpy: 1.24.2 scipy: None netCDF4: None pydap: None h5netcdf: None h5py: None Nio: None zarr: None cftime: None nc_time_axis: None PseudoNetCDF: None iris: None bottleneck: None dask: None distributed: None matplotlib: None cartopy: None seaborn: None numbagg: None fsspec: None cupy: None pint: None sparse: None flox: None numpy_groupies: None setuptools: 65.3.0 pip: 22.2.2 conda: None pytest: None mypy: None IPython: 8.12.0 sphinx: None
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/7763/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 issue

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [issues] (
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [number] INTEGER,
   [title] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [state] TEXT,
   [locked] INTEGER,
   [assignee] INTEGER REFERENCES [users]([id]),
   [milestone] INTEGER REFERENCES [milestones]([id]),
   [comments] INTEGER,
   [created_at] TEXT,
   [updated_at] TEXT,
   [closed_at] TEXT,
   [author_association] TEXT,
   [active_lock_reason] TEXT,
   [draft] INTEGER,
   [pull_request] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [performed_via_github_app] TEXT,
   [state_reason] TEXT,
   [repo] INTEGER REFERENCES [repos]([id]),
   [type] TEXT
);
CREATE INDEX [idx_issues_repo]
    ON [issues] ([repo]);
CREATE INDEX [idx_issues_milestone]
    ON [issues] ([milestone]);
CREATE INDEX [idx_issues_assignee]
    ON [issues] ([assignee]);
CREATE INDEX [idx_issues_user]
    ON [issues] ([user]);
Powered by Datasette · Queries took 1442.495ms · About: xarray-datasette