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

Clarify return float/int type for core.Composition.reduced_composition and siblings, minor type clean up for core.Composition #4265

Merged
merged 11 commits into from
Jan 28, 2025

Conversation

DanielYang59
Copy link
Contributor

@DanielYang59 DanielYang59 commented Jan 25, 2025

Summary

  • Clarify return float/int type for core.Composition.reduced_composition and siblings, factor returned by reduce_formula would be int instead of float (as a union type of float | int):
    factor = 1
    # Enforce integers for doing gcd.
    if all(int(i) == i for i in sym_amt.values()):
    factor = abs(gcd(*(int(i) for i in sym_amt.values())))
  • Minor type clean up for core.Composition
  • reduce_formula is not covered by test

@DanielYang59 DanielYang59 marked this pull request as ready for review January 27, 2025 18:56
@shyuep shyuep merged commit 3b6a057 into materialsproject:master Jan 28, 2025
43 checks passed
@DanielYang59 DanielYang59 deleted the fix-4208-reduced_comp branch January 28, 2025 20:55
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.

2 participants