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

force floating point math for shape calculations #115

Merged
merged 1 commit into from
Sep 13, 2022
Merged

Conversation

bmcfee
Copy link
Owner

@bmcfee bmcfee commented Sep 13, 2022

This PR force-casts sampling rates to be floating point values when calculating the output shape of the resampled array.

This is designed to circumvent numerical overflows that arise when sr_new is a fixed-precision integer (eg np.int16) for some reason. This didn't arise in our tests here, but did pop up over in librosa/librosa#1569

@codecov-commenter
Copy link

codecov-commenter commented Sep 13, 2022

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.22%. Comparing base (9c9fa90) to head (69e42e8).
Report is 30 commits behind head on main.

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

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #115   +/-   ##
=======================================
  Coverage   75.22%   75.22%           
=======================================
  Files           4        4           
  Lines         113      113           
=======================================
  Hits           85       85           
  Misses         28       28           
Flag Coverage Δ
unittests 75.22% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bmcfee bmcfee merged commit a39554f into main Sep 13, 2022
@bmcfee bmcfee deleted the force-float-shape branch September 13, 2022 16:12
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.

2 participants