You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Composition is meant to be immutable. Which is why it inherits Mapping and Hashable and not dict or MutableMapping. Composition objects are probably the one of the most used keys in dictionaries and sets. So in place modifications are not allowed. FYI, the above can be easily done using Composition({(k if k.symbol != "Fe" else "Mn"): v for k, v in comp.items()}).
Just a note that I have no objection if you want to create a method to do substitutions that return a new composition object. But in-place modifications are not supported.
Is your feature request related to a problem? Please describe.
Composition
does not support elemental substitutions.Describe the solution you'd like
New method
Composition("Fe2O3").replace({"Fe": "Mg"})
similar toStructure.replace_species()
.Describe alternatives you've considered
None.
Additional context
Useful when working with data-mined substitution matrices.
The text was updated successfully, but these errors were encountered: