Skip to content

Commit

Permalink
Ignored iris warnings about global attributes (#2400)
Browse files Browse the repository at this point in the history
  • Loading branch information
schlunma authored Apr 30, 2024
1 parent 89891ef commit 7488131
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion esmvalcore/preprocessor/_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,19 @@ def save(cubes,
logger.debug('Changing var_name from %s to %s', cube.var_name,
alias)
cube.var_name = alias
iris.save(cubes, **kwargs)

# Ignore some warnings when saving
with catch_warnings():
filterwarnings(
'ignore',
message=(
".* is being added as CF data variable attribute, but .* "
"should only be a CF global attribute"
),
category=UserWarning,
module='iris',
)
iris.save(cubes, **kwargs)

return filename

Expand Down

0 comments on commit 7488131

Please sign in to comment.