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

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from

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

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.

1 participant