Conversation
ggalibert
left a comment
There was a problem hiding this comment.
Looks good to me, just a minor question.
| if 'data' not in var: | ||
| raise ValueError('No data specified for variable {varname}'.format(varname=varname)) | ||
| if var['data'] is not None: | ||
| ncvar[:] = var['data'] |
There was a problem hiding this comment.
What happens to nc_var if var['data'] is None? I couldn't see where it might be set to all _FillValue.
There was a problem hiding this comment.
Fillvalue is setup at createVariable time, so if no data is added (this case, var['data'] is None), everything is fillvalue.
There was a problem hiding this comment.
Yep, that's the default behaviour. Unless you specify fill_value = False as an argument to createVariable(), you don't actually have to explicitly set the variable values to fill_value.
ocehugo
left a comment
There was a problem hiding this comment.
I just notice a typo in a new func
update_dimensinos to update_dimensions
| ncvar = self.ncobj.createVariable(varname, datatype) | ||
| else: | ||
| var_c_keys = list(self._create_var_opts(var)) | ||
| var_attr = var.get('attributes', {}) |
There was a problem hiding this comment.
EDITED: I'm blind!
Why using get at all? Better to be explicit !?
| if 'data' not in var: | ||
| raise ValueError('No data specified for variable {varname}'.format(varname=varname)) | ||
| if var['data'] is not None: | ||
| ncvar[:] = var['data'] |
There was a problem hiding this comment.
Fillvalue is setup at createVariable time, so if no data is added (this case, var['data'] is None), everything is fillvalue.
|
Typo fixed and merge conflict resolved. |
Fixes #5