Skip to content

Commit

Permalink
Avoid resetting variables
Browse files Browse the repository at this point in the history
  • Loading branch information
EtienneCmb committed Jul 26, 2021
1 parent 924cc8d commit c6f7a4d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions frites/io/io_attributes.py
Expand Up @@ -38,10 +38,8 @@ def _check_netcdf(self):
"""Check attributes for netcdf compatibility."""
keys, values = list(self.data.keys()), list(self.data.values())
for k, v in zip(keys, values):
# None to string
self.data[k] = 'none' if v is None else v
# bool to string
self.data[k] = str(v) if isinstance(v, bool) is None else v
if v is None: self.data[k] = 'none' # noqa
if isinstance(v, bool): self.data[k] = str(v) # noqa
# dict to strings
if isinstance(v, dict):
for _k, _v in v.items():
Expand Down

0 comments on commit c6f7a4d

Please sign in to comment.