Skip to content

Commit

Permalink
Use iris.FUTURE.save_split_attrs = True to remove iris warning (#2398)
Browse files Browse the repository at this point in the history
  • Loading branch information
schlunma authored Apr 29, 2024
1 parent 6a98408 commit 89891ef
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dependencies:
- geopy
- humanfriendly
- importlib_metadata # required for Python < 3.10
- iris >=3.6.1
- iris >=3.8.0
- iris-esmf-regrid >=0.7.0
- isodate
- jinja2
Expand Down
4 changes: 2 additions & 2 deletions esmvalcore/_provenance.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def attribute_to_authors(entity, authors):


def attribute_to_projects(entity, projects):
"""Attribute entity to projecs."""
"""Attribute entity to projects."""
namespace = 'project'
create_namespace(entity.bundle, namespace)

Expand Down Expand Up @@ -193,7 +193,7 @@ def initialize_provenance(self, activity):
self._initialize_ancestors(activity)

def _initialize_namespaces(self):
"""Inialize the namespaces."""
"""Initialize the namespaces."""
for namespace in ('file', 'attribute', 'preprocessor', 'task'):
create_namespace(self.provenance, namespace)

Expand Down
2 changes: 2 additions & 0 deletions esmvalcore/preprocessor/_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
'alternative_dataset',
}

iris.FUTURE.save_split_attrs = True


def _get_attr_from_field_coord(ncfield, coord_name, attr):
if coord_name is not None:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
'scipy>=1.6',
# See the following issue for info on the iris pin below:
# https://github.com/ESMValGroup/ESMValTool/issues/3239#issuecomment-1613298587
'scitools-iris>=3.6.1',
'scitools-iris>=3.8.0',
'shapely>=2.0.0',
'stratify>=0.3',
'yamale',
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ def create_test_file(filename, tracking_id=None):
attributes = {}
if tracking_id is not None:
attributes['tracking_id'] = tracking_id
cube = iris.cube.Cube([], attributes=attributes)
cube = iris.cube.Cube([])
cube.attributes.globals = attributes

iris.save(cube, filename)

Expand Down
3 changes: 2 additions & 1 deletion tests/integration/recipe/test_recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ def create_test_file(filename, tracking_id=None):
attributes = {}
if tracking_id is not None:
attributes['tracking_id'] = tracking_id
cube = iris.cube.Cube([], attributes=attributes)
cube = iris.cube.Cube([])
cube.attributes.globals = attributes

iris.save(cube, filename)

Expand Down

0 comments on commit 89891ef

Please sign in to comment.