-
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
Parallel concatenate #5926
Open
bouweandela
wants to merge
11
commits into
SciTools:main
Choose a base branch
from
bouweandela:parallel-concatenate
base: main
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Parallel concatenate #5926
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
f9e0106
Simplify concatenate
bouweandela 6b01352
First attempt at parallel concatenate
bouweandela 35facc7
Clean up a bit
bouweandela 6e883da
Add support for comparing different data types
bouweandela 7cc9f19
Merge branch 'main' of github.com:scitools/iris into parallel-concate…
bouweandela add3f66
Undo unnessary change
bouweandela eb0b340
More tests
bouweandela 24615a0
Use faster lookup
bouweandela 5c68a8e
Merge branch 'main' of github.com:scitools/iris into parallel-concate…
bouweandela 2540fea
Add test to show that NaNs are considered equal
bouweandela 3bfea80
Merge branch 'main' into parallel-concatenate
bouweandela File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Clean up a bit
- Loading branch information
commit 35facc78df5ae781de01a1b6cc8e9f115dee86bf
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Would it be possible to fall back on 'normal equality' when hash equality is
False
?Sorry to add more work to this, but I've been having some offline conversations with @bjlittle and @pp-mo about equality in general and we're concerned about Iris' strictness. The changes here would make Iris more strict than it is already.
We are therefore keen to use hashing as a way to confirm equality quickly and efficiently, while still retaining the chance for more lenient comparisons such as:
NaN
(example).If this would harm the performance gains you are looking for then we would be open to configurable behaviour in
concatenate()
.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.
Thanks for providing me with feedback! ✨
I agree with this. In ESMValCore we have implemented many workarounds for this to make the life of our users easier.
As far as I'm aware, this pull request does not make any changes to Iris behaviour.
Would you have an example so I can understand when this happens?
I even made the hash comparison work for arrays of different
dtype
s because I initially expected that that would be allowed, but it turns out that even that is not allowed by the current implementation of concatenate, so I could take that out again. Or we can keep it in case you would be interested in being more lenient w.r.t. this kind of differences in the future.Arrays containing
NaN
s compare equal with the hashing implementation, I added a test to demonstrate it in 2540fea.Yes, it would be easy to add the additional comparison here:
iris/lib/iris/_concatenate.py
Lines 1077 to 1078 in 3bfea80
however, with the current strict implementation of coordinate comparison, there would be no point in doing so because the result would be the same. I'm not too concerned about the performance impact because in our use case, we expect the input to be compatible enough such that the result of the concatenation is a single cube, so the extra comparison would only happen in exceptional cases when there is something wrong with the input data.