We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
core.composition
Open this in case it got forgotten.
As found out by @janosh in #3792 (comment), there is an obvious bug with Composition comparison where True is returned too early:
Composition
True
pymatgen/pymatgen/core/composition.py
Lines 195 to 212 in 6c696cd
On top of this obvious bug, there are a few questions:
Should ONLY be used for defining a sort order (the behavior is probably not what you'd expect).
How should we define the behavior when an Element is only in one of the Composition and this Composition is not a superset of another? For example:
Element
Composition({"O": 1, "N": 1})
Composition({"O": 1})
Composition({"N": 1})
Composition({"O": 2, "N": 1})
Composition({"O": 2, "C": 1})
So should we prevent Composition with different Element from being compared altogether?
pymatgen/tests/core/test_composition.py
Lines 504 to 516 in 6c696cd
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Bug in
core.composition
comparisonOpen this in case it got forgotten.
As found out by @janosh in #3792 (comment), there is an obvious bug with
Composition
comparison whereTrue
is returned too early:pymatgen/pymatgen/core/composition.py
Lines 195 to 212 in 6c696cd
On top of this obvious bug, there are a few questions:
Should ONLY be used for defining a sort order (the behavior is probably not what you'd expect).
.How to define the comparison behavior
How should we define the behavior when an
Element
is only in one of theComposition
and thisComposition
is not a superset of another? For example:Composition({"O": 1, "N": 1})
>Composition({"O": 1})
# This makes senseComposition({"N": 1})
>Composition({"O": 1})
# This feels a bit weird though the atomic number is indeed greaterComposition({"O": 2, "N": 1})
>Composition({"O": 2, "C": 1})
# This doesn't seem to make sense? But this could be inferred from (2)So should we prevent
Composition
with differentElement
from being compared altogether?pymatgen/tests/core/test_composition.py
Lines 504 to 516 in 6c696cd
The text was updated successfully, but these errors were encountered: