issues: 354151953
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
354151953 | MDU6SXNzdWUzNTQxNTE5NTM= | 2382 | Add option to choose the source of global attributes in mfdataset. | 1186928 | closed | 0 | 0 | 2018-08-27T01:45:23Z | 2020-01-11T15:22:56Z | 2020-01-11T15:22:56Z | CONTRIBUTOR | Code Sample```python import numpy as np import xarray as xr prepare fake datatime = np.arange(1000) data = time**2 write to multiple netcdf filesfor i in range(10): filename = 'ds{:d}.nc'.format(i) ds = xr.Dataset({'data': (['time'], data[100i:100i+100])}, coords={'time': time[100i:100i+100]}, attrs={'history': 'Created ' + filename + '.'}) ds.to_netcdf(filename) open as mfdatasetwith xr.open_mfdataset('ds?.nc') as ds: print ds.history ``` Problem descriptionCurrently, global attributes of multi-file datasets are taken from the first file in the list. I think this is a problem in the context of consecutive model runs where history is appended in each subsequent run. When opening the results as mfdataset, history is taken from the first run file all subsequent history is lost. NetCDF4 has a new keyword argument to set the Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/2382/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |