1414
1515import iris
1616from iris import cube
17- from iris .experimental . ugrid import PARSE_UGRID_ON_LOAD , load_mesh
17+ from iris .mesh import load_mesh
1818
1919from . import BENCHMARK_DATA , REUSE_DATA , load_realised , run_function_elsewhere
2020
@@ -90,7 +90,7 @@ def sample_mesh(n_nodes=None, n_faces=None, n_edges=None, lazy_values=False):
9090 """Sample mesh wrapper for :meth:iris.tests.stock.mesh.sample_mesh`."""
9191
9292 def _external (* args , ** kwargs ):
93- from iris .experimental . ugrid import save_mesh
93+ from iris .mesh import save_mesh
9494 from iris .tests .stock .mesh import sample_mesh
9595
9696 save_path_ = kwargs .pop ("save_path" )
@@ -104,21 +104,20 @@ def _external(*args, **kwargs):
104104 save_path = (BENCHMARK_DATA / f"sample_mesh_{ args_hash } " ).with_suffix (".nc" )
105105 if not REUSE_DATA or not save_path .is_file ():
106106 _ = run_function_elsewhere (_external , * arg_list , save_path = str (save_path ))
107- with PARSE_UGRID_ON_LOAD .context ():
108- if not lazy_values :
109- # Realise everything.
110- with load_realised ():
111- mesh = load_mesh (str (save_path ))
112- else :
107+ if not lazy_values :
108+ # Realise everything.
109+ with load_realised ():
113110 mesh = load_mesh (str (save_path ))
111+ else :
112+ mesh = load_mesh (str (save_path ))
114113 return mesh
115114
116115
117116def sample_meshcoord (sample_mesh_kwargs = None , location = "face" , axis = "x" ):
118117 """Sample meshcoord wrapper for :meth:`iris.tests.stock.mesh.sample_meshcoord`.
119118
120119 Parameters deviate from the original as cannot pass a
121- :class:`iris.experimental.ugrid .Mesh to the separate Python instance - must
120+ :class:`iris.mesh .Mesh to the separate Python instance - must
122121 instead generate the Mesh as well.
123122
124123 MeshCoords cannot be saved to file, so the _external method saves the
@@ -127,7 +126,7 @@ def sample_meshcoord(sample_mesh_kwargs=None, location="face", axis="x"):
127126 """
128127
129128 def _external (sample_mesh_kwargs_ , save_path_ ):
130- from iris .experimental . ugrid import save_mesh
129+ from iris .mesh import save_mesh
131130 from iris .tests .stock .mesh import sample_mesh , sample_meshcoord
132131
133132 if sample_mesh_kwargs_ :
@@ -147,9 +146,8 @@ def _external(sample_mesh_kwargs_, save_path_):
147146 sample_mesh_kwargs_ = sample_mesh_kwargs ,
148147 save_path_ = str (save_path ),
149148 )
150- with PARSE_UGRID_ON_LOAD .context ():
151- with load_realised ():
152- source_mesh = load_mesh (str (save_path ))
149+ with load_realised ():
150+ source_mesh = load_mesh (str (save_path ))
153151 # Regenerate MeshCoord from its Mesh, which we saved.
154152 return source_mesh .to_MeshCoord (location = location , axis = axis )
155153
@@ -180,7 +178,6 @@ def _external(w_mesh_: str, save_path_: str):
180178 )
181179 if not REUSE_DATA or not save_path .is_file ():
182180 _ = run_function_elsewhere (_external , w_mesh_ = w_mesh , save_path_ = str (save_path ))
183- with PARSE_UGRID_ON_LOAD .context ():
184- context = nullcontext () if lazy else load_realised ()
185- with context :
186- return iris .load_cube (save_path , "air_potential_temperature" )
181+ context = nullcontext () if lazy else load_realised ()
182+ with context :
183+ return iris .load_cube (save_path , "air_potential_temperature" )
0 commit comments