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

python3 compat; pep8 linting #8

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

pkmital
Copy link
Contributor

@pkmital pkmital commented Feb 19, 2016

Using Python 3.5.1 so had to change all print functions to use parens and import print_function from future. Should at least allow you to install now w/ python3. Also ran a linter on the files I edited for PEP8.

@pkmital pkmital mentioned this pull request Feb 2, 2017
@rcythr
Copy link

rcythr commented Sep 11, 2017

You are correct in that with your change the code will compile; however, this alone will not work.

Python3 changed the semantics of division. All of the integer division operations need to be changed from "/" to "//".

@pkmital
Copy link
Contributor Author

pkmital commented Sep 11, 2017

Good call. Running the tool 2to3 on everything should catch those sort of things and potentially other issues.

@rcythr
Copy link

rcythr commented Sep 11, 2017

I tried that, actually; however, 2to3 doesn't properly catch the division issue.

I've started working on a port on my fork of this repo. It seems to work; however, I cannot find any test cases so I cannot be certain it's 100% working.

Maybe if I get some time tonight I'll test it by running the set of examples.

@weefuzzy
Copy link

Just spent a bit of time on this. In the main body of code getting things python 3 happy are pretty straightforward: stuff that 2to3 catches, plus a few integer division bits. The more complex issues are in sound.py, which does a lot of work to provide wrappers for scikit.audiolab functions if the latter is missing. Quite a bit of this is using strings as bytes, which has changed under python 3 (but is easily updated).

However, the fallback wav code was extremely slow for me (~10 m to write a 1m wav file!), and it doesn't seem as if the audiolabs stuff has much prospect of ever being py3 compatible. What I've done on my local repo is rewrite the sound.py functions with pysoundfile instead, which seems to work (although I'm not yet sure if I haven't broken anything else in the process).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants