NOAA-PMEL / PyFerret

The PyFerret program and Python module from NOAA/PMEL
https://ferret.pmel.noaa.gov/Ferret/
The Unlicense
59 stars 22 forks source link

Updates to build for Python 3.6 that still build under 2.6, 2.7; also NumPy updates #34

Closed karlmattsmith closed 7 years ago

karlmattsmith commented 7 years ago

Mostly 2to3 updates, but also inspected to keep code unchanged for 2.6, 2.7 builds. The from future import print_function added to deal with that huge difference; otherwise using compiler directive #if PY_MAJOR_VERSION > 2 for incompatible differences (for PyString... to PyUnicode... and PyInt... to PyLong...). Some changes to import statements that still need to be checked under 2.x. Change from xrange to range left in for 2; might be slower but hopefully optimization under 2.x will translate that back.

Also updated C code interface with NumPy - largely switching to PyArrayObject, and insert _ARRAY into some flags. Since this is applicable to current NumPy under 2.6, 2.7, these changes should be okay in all versions.

karlmsmith commented 7 years ago

Also includes using PyQt5 (which requires Python 3.x) if available; otherwise back to PyQt4.

karlmsmith commented 7 years ago

I am going to add this in and then fix anything that this might break in Python 2.x There are still some includes in the pipedviewer (pviewmod) that need to be fixed for Python 3.x