Fix unstable entries sorting in PhaseDiagram causing intermittent CI failure#4584
Merged
shyuep merged 1 commit intomaterialsproject:masterfrom Feb 18, 2026
Merged
Conversation
0eed43b to
3eb2338
Compare
pre-commit auto-fixes
58e6e41 to
faa4466
Compare
Contributor
Author
|
@shyuep I'm still seeing intermittent CI failure because of this issue, maybe you could review this? thanks |
shyuep
reviewed
Feb 18, 2026
| all_entries: list[PDEntry] = [] | ||
| for composition, group_iter in itertools.groupby(entries, key=lambda e: e.composition.reduced_composition): | ||
| group = list(group_iter) | ||
| min_entry = min(group, key=lambda e: e.energy_per_atom) |
Member
There was a problem hiding this comment.
If you already sorted by composition and energy, then this need not use min any more? You can just do group[0]?
Member
|
Nvm, i will fix it on my side. Thanks. |
Contributor
Author
|
thanks that's a good point, i was about to push but it has been merged ;) |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fix currently intermittent CI failure, cc @Andrew-S-Rosen :
I tried to extract the mismatch:
Looks like when entries have the same composition, their sorting sort might be unstable