iris icon indicating copy to clipboard operation
iris copied to clipboard

Fixes to _discontiguity_in_bounds (attempt 2)

Open stephenworsley opened this issue 1 year ago • 1 comments

🚀 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 the np.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.

Consult Iris pull request check list

stephenworsley avatar Sep 21 '22 11:09 stephenworsley

I haven't looked closely, but I think this would also address #4473?

rcomer avatar Sep 21 '22 16:09 rcomer