iris
iris copied to clipboard
Fixes to _discontiguity_in_bounds (attempt 2)
🚀 Pull Request
Description
Addresses #3401 and #3480, replaces #3404 which I couldn't reopen since it's targeting a deleted branch.
This adresses three problems at once:
- 2D discontiguity checking wasn't comparing enough bounds.
- The logic for determining discontiguity was somewhat garbled, I couldn't figure out exactly what it was trying to achieve so I replaced it with
np.isclose
like thenp.allclose
in 1D checking. - It was unclear how the returned diffs ought to be represented as this used to be a boolean array for 2D coords and floats for 1D coords. Since this function is private, this is effectively a case of checking how these values are used. I believe that in each case they are used, they are being treated as an array of booleans so I have changed the behaviour of 1D coord checking and the description of the function to match this.
I haven't looked closely, but I think this would also address #4473?