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

Support for python 3.x #14

Open
4 of 5 tasks
tboggs opened this issue Jul 10, 2014 · 7 comments
Open
4 of 5 tasks

Support for python 3.x #14

tboggs opened this issue Jul 10, 2014 · 7 comments
Milestone

Comments

@tboggs
Copy link
Member

tboggs commented Jul 10, 2014

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

  • Run 2to3 on the entire module.

  • Add needed future imports for python2:

    from __future__ import division, print_function, unicode_literals
    
  • Fix all the miscellaneous things that are broken (most likely due to [non]integer division).

  • Verify all unit tests pass under python 2 and 3.

  • Figure out a way to get view_cube and view_nd working with python3.

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.

@tboggs tboggs added this to the python3 milestone Jul 10, 2014
@tboggs tboggs mentioned this issue Jul 10, 2014
@JohnLunzer
Copy link

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
Copy link
Member Author

tboggs commented Jul 11, 2014

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
Copy link
Member Author

tboggs commented Aug 21, 2014

As of commit 165a503 (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
Copy link
Contributor

lewismc commented Nov 9, 2016

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

@tboggs
Copy link
Member Author

tboggs commented Nov 9, 2016

@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
Copy link
Contributor

lewismc commented Nov 9, 2016

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

@gpshead
Copy link

gpshead commented Jun 12, 2018

wxPython supports Python 3 these days.

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

No branches or pull requests

4 participants