Skip to content

Commit

Permalink
Yet more formatting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mataeui committed Feb 20, 2025
1 parent b1c5b18 commit 26aa442
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion satpy/readers/netcdf_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,15 @@ def _collect_global_attrs(self, obj):
self.file_content[fc_key] = global_attrs[key] = value
self.file_content["/attrs"] = global_attrs

def _get_object_attrs(self, obj):
@classmethod
def _get_object_attrs(cls, obj):
"""Do not try to use __dict__ if obj is a compound variable."""
try:
if obj.dtype.kind == "V":
LOG.warning(f"Warning: Cannot load attributes for compound variable ({obj.name})")
return {}
except (AttributeError, KeyError):
pass
return obj.__dict__

def _collect_attrs(self, name, obj):
Expand Down

0 comments on commit 26aa442

Please sign in to comment.