craffel / mir_eval

Evaluation functions for music/audio information retrieval/signal processing algorithms.
MIT License
588 stars 109 forks source link

More efficient chord validation #378

Closed bmcfee closed 2 months ago

bmcfee commented 3 months ago

Pulling this change out of PR #377

The chord validator was compiling a monster regexp on each call, which is pretty wasteful. This PR just lifts that regexp precompilation up to the module so it can be reused. I belive this was the main inefficiency behind issue #341 .

There should be no functional changes here, so as long as it passes linting and CI I'm happy to merge.

codecov-commenter commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 88.32%. Comparing base (7997fdf) to head (b44cb8a). Report is 5 commits behind head on main.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #378 +/- ## ========================================== + Coverage 88.31% 88.32% +0.01% ========================================== Files 19 19 Lines 2875 2878 +3 ========================================== + Hits 2539 2542 +3 Misses 336 336 ``` | [Flag](https://app.codecov.io/gh/craffel/mir_eval/pull/378/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Colin+Raffel) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/craffel/mir_eval/pull/378/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Colin+Raffel) | `88.32% <100.00%> (+0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Colin+Raffel#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.