home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 615953378

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/issues/3774#issuecomment-615953378 https://api.github.com/repos/pydata/xarray/issues/3774 615953378 MDEyOklzc3VlQ29tbWVudDYxNTk1MzM3OA== 35968931 2020-04-18T21:33:40Z 2020-04-18T21:33:40Z MEMBER

@dcherian it looks like the old auto_combine does handle this case, but so does the new combine_nested (which is intentional, one of the purposes of combine_nested is to make it easier to explicitly combine along new dimensions):

```python import xarray as xr from xarray.core.combine import _old_auto_combine

data_0 = xr.Dataset({'temperature': ('time', [10,20,30])}, coords={'time': [0,1,2]}) data_0.coords['trial'] = 0

data_1 = xr.Dataset({'temperature': ('time', [50,60,70])}, coords={'time': [0,1,2]}) data_1.coords['trial'] = 1

all_trials = _old_auto_combine([data_0, data_1], concat_dim='trial') print(all_trials) <xarray.Dataset> Dimensions: (time: 3, trial: 2) Coordinates: * time (time) int64 0 1 2 * trial (trial) int64 0 1 Data variables: temperature (trial, time) int64 10 20 30 50 60 70 but you can get the same result withpython all_trials = xr.combine_nested([data_0, data_1], concat_dim='trial') print(all_trials) <xarray.Dataset> Dimensions: (time: 3, trial: 2) Coordinates: * time (time) int64 0 1 2 * trial (trial) int64 0 1 Data variables: temperature (trial, time) int64 10 20 30 50 60 70 ```

So technically this issue doesn't need to be closed before completely removing the old auto_combine, but we probably should fix this anyway.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  566490806
Powered by Datasette · Queries took 158.494ms · About: xarray-datasette