home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 911513701

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
911513701 MDU6SXNzdWU5MTE1MTM3MDE= 5436 bug or unclear definition of combine_attrs with xr.merge() 32069530 open 0     13 2021-06-04T13:43:39Z 2022-09-22T17:27:13Z   NONE      

Hi all, I use the latest version of xarray (0.18) and I have some problems. Here are very simple examples: python velocity = xr.DataArray(7.3, name='velocity', attrs={'units':'m/s'}) elevation = xr.DataArray(3.5, name='elevation', attrs={'units':'m'}) 1) When using ds =xr.merge([velocity, elevation], combine_attrs='drop') I expect ds not have any attrs but I may expect variables velocity and elevation to keep their own attributes. This is not the case. All variables loose their attributes

2) When using combine_attrs='drop_conflicts', elevation and velocity keeps their own units and ds has no attrs.

3) Then, if we set elevation units to be the same as velocity units and use combine_attrs='drop_conflicts', then ds get a new attibute wich is this common units

As a conclucion, the combine_attrs flag definition is really not clear because it seems to control the final merged dataset attrs but, in reality, can also affects merged variables attributes. From my point of view, behaviour of combine_attrs is not consistent depending on the chosen option.

I would expect merged variables to be (as much as possible) untouched when merged and the combine_attrs to only control the attributes of the merged dataset.

Thanks

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/5436/reactions",
    "total_count": 1,
    "+1": 1,
    "-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
  • 13 rows from issue in issue_comments
Powered by Datasette · Queries took 0.607ms · About: xarray-datasette