spectralpython / spectral

Python module for hyperspectral image processing
MIT License
582 stars 139 forks source link

Support for python 3.x #14

Open tboggs opened 10 years ago

tboggs commented 10 years ago

SPy is currently developed for python 2.{6,7}. This enhancement will add support for python3. The current plan is to have a single code base that works for both python 2 and 3 (I realize some people discourage this).

The basic tasks to get this done are

The last item above is probably the hardest part because those functions rely on wxPython, which is not ported to python3. I've confirmed that most of the needed matplotlib functions that are used for interactive GUI capabilities in SPy will work under alternate matplotlib backends (with python3) but the two functions mentioned will need to be migrated to another GUI toolkit that provides an OpenGL wrapper (unless wxPython gets ported). If there isn't a relatively easy way to port those two functions, it is probably still worth making the rest of the module work with python3 and deferring those two functions until later.

JohnLunzer commented 10 years ago

I recommend taking a look at PyQtGraph for interactive GUI capabilities. It's Python 2 and 3 compatible, super fast, and has OpenGL capabilities built in. It's core capabilities are easily modified and added to using PyQt. I've used it extensively for viewing large spectral datasets.

tboggs commented 10 years ago

Thanks for the recommendation! I hadn't looked PyQtGraph before but it looks like a potentially great candidate. If I had known about this earlier (and it's development was far enough along at the time), I could probably have used this to implement the ROI selection and zoom window features in the spectral package.

tboggs commented 10 years ago

As of commit 165a5036a3617e2bc45a1a72a8c4ea1f253a25f7 (from branch python3), all unit tests pass under python 2.7, 3.3, and 3.4 from the same code base.

The only functions remaining to be updated for python3 are view_cube and view_nd. These two functions will likely be migrated from WX to Qt. Functions for 2D raster views of image data work under python3 (and python2) using the matplotlib qt4 backend (tested with PySide).

lewismc commented 7 years ago

I can confirm this as well. I've just tested spectral python3 branch for the same.

tboggs commented 7 years ago

@lewismc Not sure what you confirming - that it does work or doesn't work? I received an email copy of you comment that also include a comment about Travis-CI, which is already being used.

lewismc commented 7 years ago

Hi @tboggs I confirm that it does work : ) Yes, I deleted the other comment regarding TravisCI. I see it's already implemented.

gpshead commented 6 years ago

wxPython supports Python 3 these days.