Abjad / abjad

Abjad is a Python API for building LilyPond files. Use Abjad to make PDFs of music notation.
https://abjad.github.io
GNU General Public License v3.0
234 stars 41 forks source link

Replaced quicktions with built-in fractions. #1490

Closed trevorbaca closed 1 year ago

trevorbaca commented 1 year ago

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.

jgarte commented 1 year ago

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