iris icon indicating copy to clipboard operation
iris copied to clipboard

Fixes to _discontiguity_in_bounds (attempt 2)

Open stephenworsley opened this issue 3 years 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

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.01 :warning:

Comparison is base (333a3a9) 89.27% compared to head (19fa7dc) 89.26%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4975      +/-   ##
==========================================
- Coverage   89.27%   89.26%   -0.01%     
==========================================
  Files          88       88              
  Lines       22261    22264       +3     
  Branches     4873     4874       +1     
==========================================
+ Hits        19874    19875       +1     
- Misses       1641     1642       +1     
- Partials      746      747       +1     
Impacted Files Coverage Δ
lib/iris/util.py 89.79% <ø> (-0.35%) :arrow_down:
lib/iris/coords.py 93.18% <100.00%> (-0.02%) :arrow_down:

... and 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov[bot] avatar Apr 06 '23 14:04 codecov[bot]