hrittich / lfa-lab

Flexible local Fourier analysis library.
GNU General Public License v2.0
12 stars 2 forks source link

Porting the codebase to Python 3 #2

Closed jonas-schmitt closed 6 years ago

jonas-schmitt commented 6 years ago

Since Python 2.7 will not be maintained past 2020, it makes sense to switch to Python 3 as early as possible. This also fixes potential compatibility problems with Python 3 libraries. I ported the complete Python-codebase to Python 3, which could be mostly automated using 2to3 and by providing the -py3 flag to swig. The only exception was the PyNdRangeIterator (defined in NdRange.i), where the next() method had to be adapted to make the generated Python class compatible with Python 3.

All test seem to produce the correct output, except the one broken, mentioned in the current issue. I still invite you to carefully look at the changes and apply some additional testing.

There currently seems to be a weird problem with the Python 3 installation used in Travis CI. The build works fine on my machine (Ubuntu 16.04.4 LTS, Python 3.6.4).

jonas-schmitt commented 6 years ago

I removed the unnecessary clutter that happened through the conversion. I still do not know why the Travis CI build fails for Python 3. I anyways replicated the tests for both versions. If you want to fully support both Python 2 and 3, you probably need to add an additional option to your CMakeLists.txt. I don't know if there is an elegant way to do this besides setting things manually. Furthermore, we need to address the iterator problem with SWIG.

hrittich commented 6 years ago

All right. I will take care of the SWIG and CMake option.

Concerning the failing travis build, have you tried an out-of-source build, i.e., a build in another directory?

hrittich commented 6 years ago

Rebased and merged.

Thank you very much.

jonas-schmitt commented 6 years ago

You're welcome. I'm glad I could help