Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Yeo <40734014+trexfeathers@users.noreply.github.com>
  • Loading branch information
stephenworsley and trexfeathers committed Mar 21, 2023
1 parent e6a4ed8 commit 4287b5f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
3 changes: 1 addition & 2 deletions benchmarks/benchmarks/generate_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,7 @@ def external(*args, **kwargs):
Saving to a file allows the original python executable to pick back up.
Remember that all arguments must work as strings, hence the fresh
construction of a ``coord_system`` within the function.
Remember that all arguments must work as strings.
"""
from iris import save
Expand Down
12 changes: 9 additions & 3 deletions esmf_regrid/tests/unit/experimental/io/test_round_tripping.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,15 @@ def test_GridToMeshESMFRegridder_curvilinear_round_trip(tmp_path):
assert np.array_equal(original_result.mask, loaded_result.mask)


def test_GridToMeshESMFRegridder_masked_round_trip(tmp_path):
"""Test save/load round tripping for `GridToMeshESMFRegridder`."""
original_rg, src = _make_grid_to_mesh_regridder(masks=True)
# TODO: parametrize the rest of the tests in this module.
@pytest.mark.parametrize(
"rg_maker",
[_make_grid_to_mesh_regridder, _make_mesh_to_grid_regridder],
ids=["grid_to_mesh", "mesh_to_grid"],
)
def test_MeshESMFRegridder_masked_round_trip(tmp_path, rg_maker):
"""Test save/load round tripping for the Mesh regridder classes."""
original_rg, src = rg_maker(masks=True)
filename = tmp_path / "regridder.nc"
save_regridder(original_rg, filename)
loaded_rg = load_regridder(str(filename))
Expand Down

0 comments on commit 4287b5f

Please sign in to comment.