Skip to content

Commit 82065a7

Browse files
committed
o Add test for open_multigrid_mask_zero_faces
1 parent c06cf02 commit 82065a7

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/core/test_api.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,17 @@ def test_open_multigrid_with_masks(gridpath):
217217
assert grids["atm"].n_face == 20
218218

219219

220+
def test_open_multigrid_mask_zero_faces(gridpath):
221+
"""Applying masks that deactivate an entire grid should not fail."""
222+
grid_file = gridpath("scrip", "oasis", "grids.nc")
223+
mask_file = gridpath("scrip", "oasis", "masks_no_atm.nc")
224+
225+
grids = ux.open_multigrid(grid_file, mask_filename=mask_file)
226+
227+
assert grids["ocn"].n_face == 8
228+
assert grids["atm"].n_face == 0
229+
230+
220231
def test_open_multigrid_missing_grid_error(gridpath):
221232
"""Requesting a missing grid should raise."""
222233
grid_file = gridpath("scrip", "oasis", "grids.nc")

0 commit comments

Comments
 (0)