Skip to content
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

Add some weight-fraction-based functions #2803

Merged
merged 6 commits into from
Jan 13, 2023

Conversation

amkrajewski
Copy link
Contributor

Summary

When working with metallic alloys, weight-fraction-based notations such as Ti64 / Ti-6V-4Al or NiTiNOL60 / Ni-40Ti are commonly employed in both industrial specifications and scientific literature. Regardless of the numerous downsides of this situation, including errors in scientific experiments or NLP-parsing when they are mistaken for atomic fractions or chemical formulas, being able to create a Composition object from them (under correct interpretation) would be a useful pymatgen feature.

  • Composition class method to initialize it from a dictionary of weight fractions
  • Composition property giving a dictionary of weight fractions
  • concise tests for the two above were added

@amkrajewski amkrajewski changed the title Add weightbasedfunctions Add some weight-fraction-based functions Jan 13, 2023
@coveralls
Copy link

Coverage Status

Coverage: 78.086% (-0.8%) from 78.844% when pulling 59756e2 on amkrajewski:add_weightbasedfunctions into ff0f26a on materialsproject:master.

@shyuep shyuep merged commit a0fa7af into materialsproject:master Jan 13, 2023
@shyuep
Copy link
Member

shyuep commented Jan 13, 2023

Thanks for the useful contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants