Skip to content

Commit

Permalink
adapt to iris mesh API change
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenworsley committed Jul 22, 2024
1 parent 5240fc8 commit f17c752
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions esmf_regrid/tests/unit/schemes/test__mesh_to_MeshInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

from iris.coords import AuxCoord
from iris.cube import Cube
from iris.experimental.ugrid import Connectivity, Mesh
from iris.experimental.ugrid import Connectivity
try:
from iris.experimental.ugrid import MeshXY
except:
from iris.experimental.ugrid import Mesh as MeshXY
import numpy as np
from numpy import ma
import scipy.sparse
Expand Down Expand Up @@ -69,7 +73,7 @@ def _example_mesh():
lat_values = [60, -60, -60, 60, 10, 0]
lons = AuxCoord(lon_values, standard_name="longitude")
lats = AuxCoord(lat_values, standard_name="latitude")
mesh = Mesh(2, ((lons, "x"), (lats, "y")), fnc)
mesh = MeshXY(2, ((lons, "x"), (lats, "y")), fnc)
return mesh


Expand Down Expand Up @@ -170,7 +174,7 @@ def _gridlike_mesh(n_lons, n_lats, nsi=0):
)
lons = AuxCoord(node_lons, standard_name="longitude")
lats = AuxCoord(node_lats, standard_name="latitude")
mesh = Mesh(2, ((lons, "x"), (lats, "y")), [fnc, enc])
mesh = MeshXY(2, ((lons, "x"), (lats, "y")), [fnc, enc])

# In order to add a mesh to a cube, face locations must be added.
face_lon_coord = AuxCoord(face_lons, standard_name="longitude")
Expand Down

0 comments on commit f17c752

Please sign in to comment.