You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove tests of regridding with masks that involve randomness
My original thinking was to reduce the regridding tests considerably, to
end up with only 2 regidding tests:
- I'm thinking we don't need to cover the case with node_mask=None,
because I assume that's already implicitly covered in pre-existing
tests
- I think we could keep a single test of test_regrid_with_node_mask
using one of the five current masks and a single regridding method
- I would remove test_regrid_with_random_node_mask, because I don't like
randomness in tests: it can be problematic when you get a test failure
and then can't reproduce it later. It does look like this test differs
a bit from test_regrid_with_node_mask, in the destination coordinates
in this random one differ from the source coordinates, whereas the
destination and source are identical in the non-random version (if I
understand the code correctly)... but I think that, for the purpose of
what this is trying to test, that shouldn't matter.
- I would keep a single test of test_regrid_with_multivalued_node_mask,
using a single regridding method. I would reduce the size considerably
– e.g., a 3x4 array rather than 100x200 – and use a hard-coded array
for src_data rather than the current random values
But Ryan O. pointed out that it can be good to have some extra test
coverage of regridding via ESMPy, so supported keeping more tests in
place. So I'm doing a more limited reduction:
- I'm removing `test_regrid_with_random_node_mask`, to remove this test
with randomness and because it doesn't look to me like it adds
significant coverage
- I'm changing `test_regrid_with_multivalued_node_mask` to use a small,
hard-coded source array rather than a random array, both to remove
randomness and to reduce the test time. (With this change, the added
test time from this PR is insignificant, whereas previously, the tests
in this PR added about 9 seconds, I _think_ mainly due to this larger
test.)
I considered also changing test_regrid_with_node_mask to use a single
mask... I tried creating a mask that felt like a hybrid of the existing
masks, `[[1, 0, 0, 1], [0, 1, 1, 0], [1, 1, 0, 0]]`, but bilinear and
patch remapping failed with that mask. This made me think that I don't
understand this well enough to choose a single mask for this test, so I
left this parametrized test as is.
0 commit comments