Replaced quicktions with built-in fractions. #1490
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.