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
Faster and simpler iris.util.array_equal #5610
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5610 +/- ##
=======================================
Coverage 89.68% 89.69%
=======================================
Files 90 90
Lines 22818 22807 -11
Branches 5446 5441 -5
=======================================
- Hits 20465 20456 -9
+ Misses 1619 1618 -1
+ Partials 734 733 -1 ☔ 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.
Great, this is a really useful simplification
- I must say I found the old code hard to grasp, though I think I originally wrote it !
Thanks @bouweandela a definite improvement ! And this really shows how the array API dispatch improves things -- so the new code is no longer concerned at all whether data is lazy or not. However, it does rely on the odd fact that bool() forces computation of lazy arrays. |
Thanks for reviewing!
The answer is simpler than I expected, have a look at the |
Thanks, I see ! I still think it's a shame this is not highlighted in the user docs somewhere, though. |
Good point. I opened a pull request to document it: dask/dask#10686 |
* main: Adopt inital noop ruff linter (SciTools#5623) Update links to https (SciTools#5621) Bump actions/stale from 8 to 9 (SciTools#5616) Faster and simpler iris.util.array_equal (SciTools#5610) Updated environment lockfiles (SciTools#5608) Bump actions/setup-python from 4 to 5 (SciTools#5614) Possible citation updates -- not clear whether appropriate. (SciTools#5453) Whats new updates for v3.7.0 . (SciTools#5451)
🚀 Pull Request
Description
The function
iris.util.array_equal
realizes the data multiple times, instead of just once. This means that data is pulled from disk multiple times, which is slower than necessary. This pull request simplifies the code so it lets Dask figure out what the best way to handle the computation is.Consult Iris pull request check list