Skip to content
Merged
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
16 changes: 10 additions & 6 deletions esmvaltool/diag_scripts/emergent_constraints/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,12 +297,16 @@ def _get_data_frame(var_type, cubes, label_all_data, group_by=None):

def _metadata_to_dict(metadata):
"""Convert :class:`iris.cube.CubeMetadata` to :obj:`dict`."""
new_dict = {}
for (key, val) in metadata._asdict().items():
if isinstance(val, dict):
new_dict.update(val)
else:
new_dict[key] = val
new_dict = dict(metadata.attributes)
other_keys = [
'standard_name',
'long_name',
'var_name',
'units',
'cell_methods',
]
for key in other_keys:
new_dict[key] = getattr(metadata, key)
return new_dict


Expand Down