Skip to content

Commit

Permalink
add version in netcdf
Browse files Browse the repository at this point in the history
  • Loading branch information
kavvkon committed Feb 21, 2020
1 parent 24e9d8c commit 4cc0681
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dispaset/postprocessing/data_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def inputs_to_xarray(inputs):
#Remove config from dict and add it later as dataset attribute (metadata)
__ = in_keys.pop('Config')
config = inputs['config']

version = inputs.get('version','')
all_ds = []
# Iterate all and build values nad coordinates
for k,v in in_keys.items():
Expand All @@ -254,6 +254,7 @@ def inputs_to_xarray(inputs):

all_ds.append(ds)
inputs = xr.merge(all_ds)
inputs.attrs['version'] = version
for key in config:
if isinstance(config[key], (float,int,str)):
inputs.attrs[key] = config[key]
Expand Down

0 comments on commit 4cc0681

Please sign in to comment.