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

Replaced quicktions with built-in fractions. #1490

Merged
merged 1 commit into from
Oct 30, 2022

Conversation

trevorbaca
Copy link
Member

Third-party quicktions raises an import error under Python 3.11. The replacement is the fractions module in Python's standard library.

Background. Years ago, the decision was made to replace built-in fractions with third-party quicktions. The near 10x speed increase provided by quicktions seemed important, especially at the time of Josiah's implementation of Abjad's timespan collection logic for Josiah's dissertation. Two things make quicktions no longer necessary. First, over successive releases of Python 3.x, built-in fractions has become increasingly performant: the quicktions pypi page indicates that quicktions may only be 2x faster than built-in fractions under Python 3.10. Second, the significant performance enhancements I added to Abjad in 2022 probably render the original problem moot: I think the original problem wasn't the performance of rational construction but rather calls to Python's (costly) inspect module for object comparison. Those calls to inspect are now all removed from 2022-era versions of Abjad.

Closes #1489.

@trevorbaca trevorbaca added this to the 3.14 milestone Oct 30, 2022
@trevorbaca trevorbaca self-assigned this Oct 30, 2022
@trevorbaca trevorbaca merged commit 0009b4b into main Oct 30, 2022
@trevorbaca trevorbaca deleted the trevor/replace-quicktions-with-fractions branch October 30, 2022 16:54
@jgarte
Copy link
Contributor

jgarte commented Oct 30, 2022

This sounds great to me! Reducing the number of dependencies in abjad also makes things easier to maintain, I think.

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

Successfully merging this pull request may close these issues.

Replace quicktions with built-in fractions
2 participants