Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cfapyx/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
def open_cfa_dataset(
filename_or_obj,
drop_variables=None,
mask_and_scale=None,
mask_and_scale=True,
decode_times=True,
concat_characters=None,
decode_coords=None,
Expand Down Expand Up @@ -87,7 +87,7 @@ def open_dataset(
filename_or_obj,
*,
drop_variables=None,
mask_and_scale=None,
mask_and_scale=True,
decode_times=True,
concat_characters=None,
decode_coords=None,
Expand Down
10 changes: 7 additions & 3 deletions cfapyx/creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,10 +532,14 @@ def _accumulate_attrs(self, attrs: dict, ncattrs: dict) -> dict:
if not np.array_equal(attrs[attr], ncattrs[attr]):
attrs[attr] = self.concat_msg
continue
if attrs[attr] != ncattrs[attr]:
try:
if attrs.get(attr) != ncattrs.get(attr):
attrs[attr] = self.concat_msg
else:
attrs[attr] = ncattrs[attr]
except ValueError:
# Typically numpy array comparisons fail here.
attrs[attr] = self.concat_msg
else:
attrs[attr] = ncattrs[attr]
return attrs

class CFAWriteMixin:
Expand Down
Loading