home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 423749397

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
423749397 MDU6SXNzdWU0MjM3NDkzOTc= 2836 xarray.concat() with compat='identical' fails for DataArray attrs 2418513 open 0     9 2019-03-21T14:11:29Z 2021-07-08T17:42:52Z   NONE      

Not sure if it was ever supposed to work with numpy arrays, but it actually does :thinking::

```python

attr = np.array([[3, 4]]) d1 = xr.Dataset({'z': 1}, attrs={'y': attr}) d2 = xr.Dataset({'z': 2}, attrs={'y': attr.copy()}) xr.concat([d1, d2], dim='z', compat='identical') ```

However, it fails if you use DataArray attrs:

```python

attr = xr.DataArray([3, 4], {'x': [1, 2]}, 'x') d1 = xr.Dataset({'z': 1}, attrs={'y': attr}) d2 = xr.Dataset({'z': 2}, attrs={'y': attr.copy()}) xr.concat([d1, d2], dim='z', compat='identical') ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all() ```

Given that the check is simply (a is b) or (a == b), should it try to do something smarter for array-like attrs?

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

Links from other tables

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