Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use iris.FUTURE.save_split_attrs = True to remove iris warning #2398

Merged
merged 4 commits into from
Apr 29, 2024
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
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
valeriupredoi marked this conversation as resolved.
Show resolved Hide resolved


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