-
Notifications
You must be signed in to change notification settings - Fork 8
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
Issues using non-zero bin-overlaps #127
Comments
Hello! This should be fixed in the new branch feature/gridded_data ps. sorry for the delay in fixing this, I was taking a long break after my phd |
Thank you and no worry about the delay. I will test this out and compare it to my fix. |
Yeah I changed more things than that, I hope that is not a problem. It was a long time that I wanted to offer support for "gridded" data (each bin starts at second 0). |
I have committed my solution to a clean fork of your project here. I realize that you are addressing this in a different way (and entirely refactoring the _bins method), so I thought I would ask before I submitted a pull request. Also, apologies for not testing that branch yet, I am in the middle of some analysis and want to stick with what is working. The fix is small but mostly is just replacing bin_overlap with noverlap in the sf.blocks call, but also corrects the time keeping. |
I've run into an issue using bin overlaps in file class methods which call _bins, for example if attempting to do this:
In this case (i.e. using float bin_overlaps between 0 and 1), soundfile.blocks throws a type error:
TypeError: slice indices must be integers or None or have an __index__ method
I believe that maybe in the sf.blocks call in the _bins method (below), overlap should be set to 'noverlap', rather than 'bin_overlap', as the latter is the integer/sample representation of the fractional overlap.
Doing this solves the error (or at least the file.rms call doesn't error), however, the resulting dataset does not appear to show start_sample and end_sample values which I would expect, if there were some overlap. This is the resulting dataset if I replace bin_overlap with noverlap:
I appreciate any help here, and have really been enjoying learning this package.
The text was updated successfully, but these errors were encountered: