-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix array_equal behaviour for masked arrays #4457
Conversation
Related to numpy/numpy#16022 (comment), which was merged into |
If we're worried about upsetting the default Iris behaviour, perhaps the neatest solution would be an As far as I'm aware the only calls for this alternative behaviour are cases where the caller is explicitly checking equality (rather than wanting internal Iris behaviour to be changed). |
There is also a relevant thread at numpy/numpy#14624 I think what Iris does in testing is sensible: iris/lib/iris/tests/__init__.py Lines 590 to 668 in 56a97d6
|
@rcomer It's interesting that there is an inconsistency between different numpy functions at the moment, though given that currently |
In order to maintain a backlog of relevant PRs, we automatically label them as stale after 500 days of inactivity. If this PR is still important to you, then please comment on this PR and the stale label will be removed. Otherwise this PR will be automatically closed in 28 days time. |
This stale PR has been automatically closed due to a lack of community activity. If you still care about this PR, then please either:
|
As discussed @trexfeathers @stephenworsley @bjlittle @pp-mo ... |
* main: (759 commits) Bump scitools/workflows from 2024.05.1 to 2024.06.0 (SciTools#5986) [pre-commit.ci] pre-commit autoupdate (SciTools#5980) Updated environment lockfiles (SciTools#5983) Bump scitools/workflows from 2024.05.0 to 2024.05.1 (SciTools#5984) Make `slices_over` tests go faster (SciTools#5973) Updated environment lockfiles (SciTools#5979) Update lock files with associated fixes (SciTools#5953) List 25 slowest tests (SciTools#5969) used a note to highlight some text (SciTools#5971) Lazy `iris.cube.Cube.rolling_window` (SciTools#5795) Add memory benchmarks (SciTools#5960) Whatsnew for several benchmark developments. (SciTools#5961) Remove "on-demand" from some benchmarks (SciTools#5959) Add bm_runner 'trialrun' subcommand. (SciTools#5957) Automatically install iris-test-data for benchmark data generation (SciTools#5958) Added benchmarks for collapse and aggregate (SciTools#5954) Use tracemalloc for memory measurements. (SciTools#5948) Provide a Nox `benchmarks` session as the recommended entry point (SciTools#5951) [pre-commit.ci] pre-commit autoupdate (SciTools#5952) Remove unit benchmarks (SciTools#5949) ...
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4457 +/- ##
=======================================
Coverage 89.78% 89.78%
=======================================
Files 90 90
Lines 22938 22945 +7
Branches 5023 5026 +3
=======================================
+ Hits 20595 20602 +7
Misses 1612 1612
Partials 731 731 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty much OK I think -- just a couple of comments.
New tests are good.
I'm a bit surprised this hasn't triggered test failures elsewhere, but I guess it's a bit niche.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All done. apart from the extra point I just added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I agreed with your latest, but I shifted my ground so I still think there is something to fix here..
Not long now, I should think !
Co-authored-by: Patrick Peglar <[email protected]>
Great, thanks for your patience @stephenworsley ! |
* upstream/main: (42 commits) Mesh saveload fix (SciTools#6004) used tabs for the install info (SciTools#6013) Fix array_equal behaviour for masked arrays (SciTools#4457) Bump scitools/workflows from 2024.06.1 to 2024.06.2 (SciTools#6008) [pre-commit.ci] pre-commit autoupdate (SciTools#6007) Updated environment lockfiles (SciTools#5996) Added more descriptive errors within concatenate (SciTools#6005) Bump scitools/workflows from 2024.06.0 to 2024.06.1 (SciTools#5998) [pre-commit.ci] pre-commit autoupdate (SciTools#5997) Bump scitools/workflows from 2024.05.1 to 2024.06.0 (SciTools#5986) [pre-commit.ci] pre-commit autoupdate (SciTools#5980) Updated environment lockfiles (SciTools#5983) Bump scitools/workflows from 2024.05.0 to 2024.05.1 (SciTools#5984) Make `slices_over` tests go faster (SciTools#5973) Updated environment lockfiles (SciTools#5979) Update lock files with associated fixes (SciTools#5953) List 25 slowest tests (SciTools#5969) used a note to highlight some text (SciTools#5971) Lazy `iris.cube.Cube.rolling_window` (SciTools#5795) Add memory benchmarks (SciTools#5960) ...
* upstream/main: (143 commits) Updated environment lockfiles (SciTools#6020) Add `MeshCoord.collapsed` (SciTools#6003) Bump scitools/workflows from 2024.06.2 to 2024.06.3 (SciTools#6015) Mesh saveload fix (SciTools#6004) used tabs for the install info (SciTools#6013) Fix array_equal behaviour for masked arrays (SciTools#4457) Bump scitools/workflows from 2024.06.1 to 2024.06.2 (SciTools#6008) [pre-commit.ci] pre-commit autoupdate (SciTools#6007) Updated environment lockfiles (SciTools#5996) Added more descriptive errors within concatenate (SciTools#6005) Bump scitools/workflows from 2024.06.0 to 2024.06.1 (SciTools#5998) [pre-commit.ci] pre-commit autoupdate (SciTools#5997) Bump scitools/workflows from 2024.05.1 to 2024.06.0 (SciTools#5986) [pre-commit.ci] pre-commit autoupdate (SciTools#5980) Updated environment lockfiles (SciTools#5983) Bump scitools/workflows from 2024.05.0 to 2024.05.1 (SciTools#5984) Make `slices_over` tests go faster (SciTools#5973) Updated environment lockfiles (SciTools#5979) Update lock files with associated fixes (SciTools#5953) List 25 slowest tests (SciTools#5969) ...
Current behaviour will compare the underlying data of a masked array and will sometimes compare masked arrays as unequal when they are otherwise equal for all unmasked points. This would cause an error in an iris-esmf-regrid PR as described here:
SciTools-incubator/iris-esmf-regrid#138 (comment)