home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 473187958

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/2811#issuecomment-473187958 https://api.github.com/repos/pydata/xarray/issues/2811 473187958 MDEyOklzc3VlQ29tbWVudDQ3MzE4Nzk1OA== 5821660 2019-03-15T07:39:09Z 2019-03-15T07:39:09Z MEMBER

Thanks for looking into this @shoyer.

Your system might print dataset dimensions like Frozen(SortedKeysDict({'c': 2, 'b': 3})), but the iteration order will always be sorted (including if you write the dataset to disk as netcdf file).

This isn't true for my system. If we consider this example:

python data = np.zeros((2,3)) ds = xr.Dataset({'test': (['c', 'b'], data)}, coords={'c': (['c'], np.arange(data.shape[0])), 'b': (['b'], np.arange(data.shape[1])),}) ds.to_netcdf('test_dims.nc') ds2 = xr.concat([ds, ds], dim='c') ds2.to_netcdf('test_dims2.nc') Dumping the created files gives the following:

``` netcdf test_dims { dimensions: c = 2 ; b = 3 ; variables: double test(c, b) ; test:_FillValue = NaN ; int64 c(c) ; int64 b(b) ; data:

test = 0, 0, 0, 0, 0, 0 ;

c = 0, 1 ;

b = 0, 1, 2 ; } netcdf test_dims2 { dimensions: b = 3 ; c = 4 ; variables: int64 b(b) ; double test(c, b) ; test:_FillValue = NaN ; int64 c(c) ; data:

b = 0, 1, 2 ;

test = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ;

c = 0, 1, 0, 1 ; } ``` My use case is, well, I have to use some legacy code.

Concerning my code, yes I'm trying to write it as robust as possible. Finally I wan't to replace the legacy code with the implementation relying completely on xarray, but that's a long way to go.

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