Skip to content

Commit 9220e42

Browse files
authored
fix handling var names and empty attributes
Just notice that testing the examples in the docstring didnt work!
1 parent 3ac6c6b commit 9220e42

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

ncwriter/nc_dict.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ def createVariables(self, **kwargs):
316316
like `zlib` and friends.
317317
"""
318318
for v in self.variables.keys():
319-
varname = self.variables[v]['name']
319+
varname = v #self.variables[v]['name']
320320
datatype = self.variables[v]['type']
321321
dimensions = self.variables[v]['dims']
322322

@@ -356,7 +356,7 @@ def createVariables(self, **kwargs):
356356
self.ncobj.createVariable(
357357
varname, datatype, dimensions=dimensions, **var_c_opts)
358358

359-
if self.variables[v]['attr'] is not None:
359+
if 'attr' in self.variables[v].keys():
360360
attrs = self.variables[v]['attr'].copy()
361361
for not_attr in self._create_var_opts(attrs):
362362
attrs.pop(not_attr)

0 commit comments

Comments
 (0)