-
Notifications
You must be signed in to change notification settings - Fork 868
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
How to improve Composition.__repr__
#3181
Comments
Another example mp-18767: Composition('Li+:2 Mn3+:2 O2-:4') Before Comp: Li2 Mn2 O4 |
This is a good proposal, but what if in the future we consider even more detailed information like partial charge, would it be more complicated? I guess we can just round the partial charge to formal charge and use formal charge as species tag? |
For added background, the plan is to keep the current
|
Yup, retracted my comment! :) |
I think changing repr is fine. No one should be using repr for any purposes. |
Cool. @tschaume @yang-ruoxi any downstream implications for |
There's a problem with
Composition.__repr__
.These 3 compositions all print
which isn't ideal given only the first 2 are equal.
Ideally, the output of
Composition.__repr__
should allow to recreate theComposition
by pasting that string into the Python interpreter. Current__repr__
is lackingoxi_state
information and also doesn't produce valid Python code.Suggestion
How about we change to:
This would strictly speaking be a breaking change since people might have written code that depends on how
Composition
stringifies. Curious to hear opinion @mkhorton @shyuep.The text was updated successfully, but these errors were encountered: