home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 439742167

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/2550#issuecomment-439742167 https://api.github.com/repos/pydata/xarray/issues/2550 439742167 MDEyOklzc3VlQ29tbWVudDQzOTc0MjE2Nw== 4806877 2018-11-19T00:52:03Z 2018-11-19T00:52:03Z CONTRIBUTOR

Ah I don't think I understood that adding source to encoding was a new addition. In latest master ('0.11.0+3.g70e9eb8) this works fine:

```python def func(ds): var = next(var for var in ds) return ds.assign(path=ds[var].encoding['source'])

ds = xr.open_mfdataset(['./air_1.nc', './air_2.nc'], concat_dim='path', preprocess=func) ```

I do think it is misleading though that after you've concatenated the data, the encoding['source'] on a concatenated var seems to be the first path.

```python

ds['air'].encoding['source'] '~/air_1.nc' ```

I'll close this one though since there is a clear way to access the filename. Thanks for the tip @jhamman!

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