Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Compositions from weight str #4183

Merged
merged 3 commits into from
Nov 18, 2024
Merged

Conversation

CompRhys
Copy link
Contributor

Often in alloy literature we get composition strings given in weight rather than molar quantities. This PR extends upon the from_weight_dict method to give a more general from_weights method that will take strings as well as CompositionLike

@@ -639,22 +640,52 @@ def from_dict(cls, dct: dict) -> Self:
return cls(dct)

@classmethod
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think adding a few init examples for this method would be useful. Similar to the one at the init method of Composition.

@shyuep shyuep merged commit 31f1e1f into materialsproject:master Nov 18, 2024
43 checks passed
@shyuep
Copy link
Member

shyuep commented Nov 18, 2024

Thanks. Merged.

@CompRhys CompRhys deleted the from-weight-str branch November 18, 2024 20:46
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants