issue_comments: 437161279
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-437161279 | https://api.github.com/repos/pydata/xarray/issues/2550 | 437161279 | MDEyOklzc3VlQ29tbWVudDQzNzE2MTI3OQ== | 4806877 | 2018-11-08T21:24:45Z | 2018-11-08T21:24:45Z | CONTRIBUTOR | @jhamman that looks pretty good, but I'm not seeing the source in the encoding dict. Is this what you were expecting? ```python def func(ds): var = next(var for var in ds) return ds.assign(path=ds[var].encoding['source']) xr.open_mfdataset(['./ST4.2018092500.01h', './ST4.2018092501.01h'],
engine='pynio', concat_dim='path', preprocess=func)
KeyError Traceback (most recent call last) <ipython-input-49-184da62ce353> in <module>() ----> 1 ds = xr.open_mfdataset(['./ST4.2018092500.01h', './ST4.2018092501.01h'], engine='pynio', concat_dim='path', preprocess=func) /opt/conda/lib/python3.6/site-packages/xarray/backends/api.py in open_mfdataset(paths, chunks, concat_dim, compat, preprocess, engine, lock, data_vars, coords, autoclose, parallel, **kwargs) 612 file_objs = [getattr_(ds, '_file_obj') for ds in datasets] 613 if preprocess is not None: --> 614 datasets = [preprocess(ds) for ds in datasets] 615 616 if parallel: /opt/conda/lib/python3.6/site-packages/xarray/backends/api.py in <listcomp>(.0) 612 file_objs = [getattr_(ds, '_file_obj') for ds in datasets] 613 if preprocess is not None: --> 614 datasets = [preprocess(ds) for ds in datasets] 615 616 if parallel: <ipython-input-48-fd450fa1393a> in func(ds) 1 def func(ds): 2 var = next(var for var in ds) ----> 3 return ds.assign(path=ds[var].encoding['source']) KeyError: 'source' ``` xarray version: '0.11.0+1.g575e97ae' |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
378898407 |