[pyferret] 39/110: Add Python3 support

Alastair McKinstry mckinstry at moszumanska.debian.org
Fri Jul 28 08:41:52 UTC 2017


This is an automated email from the git hooks/post-receive script.

mckinstry pushed a commit to branch debian/master
in repository pyferret.

commit 39fccab472e93216a4212673a0153fb36a027482
Author: Alastair McKinstry <mckinstry at debian.org>
Date:   Sat Oct 31 10:43:38 2015 +0000

    Add Python3 support
---
 debian/changelog             |    1 +
 debian/patches/python3.patch | 3042 +++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 3035 insertions(+), 8 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 9292134..f10c75b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,7 @@
 pyferret (1.1.0-2) UNRELEASED; urgency=medium
 
   * Depend on python?-future for Python3 patch
+  * Add Python3 support
 
  -- Alastair McKinstry <mckinstry at debian.org>  Sat, 31 Oct 2015 10:41:17 +0000
 
diff --git a/debian/patches/python3.patch b/debian/patches/python3.patch
index 0fa7625..9bd3267 100644
--- a/debian/patches/python3.patch
+++ b/debian/patches/python3.patch
@@ -1,3 +1,8 @@
+Author: Alastair McKinstry <mckinstry at debian.org>
+Description: Support Python3
+Last-Updated: 2015-10-30
+Forwarded: no
+
 Index: pyferret-1.1.0/ferretmagic.py
 ===================================================================
 --- pyferret-1.1.0.orig/ferretmagic.py
@@ -311,15 +316,33 @@ Index: pyferret-1.1.0/pviewmod/__init__.py
 ===================================================================
 --- pyferret-1.1.0.orig/pviewmod/__init__.py
 +++ pyferret-1.1.0/pviewmod/__init__.py
-@@ -8,6 +8,7 @@ This package was developed by the Therma
+@@ -8,6 +8,8 @@ This package was developed by the Therma
  Pacific Marine Environmental Lab (PMEL).
  '''
  
 +from __future__ import print_function
++from builtins import input
  from multiprocessing import Pipe
  import sys
  
-@@ -222,16 +223,16 @@ if __name__ == "__main__":
+@@ -32,14 +34,14 @@ class PipedViewer(object):
+         (self.__rspdrecvpipe, self.__rspdsendpipe) = Pipe(False)
+         if viewertype == "PipedViewerPQ":
+             try:
+-                from pipedviewerpq import PipedViewerPQProcess
++                from .pipedviewerpq import PipedViewerPQProcess
+             except ImportError:
+                 raise TypeError("The PQ viewers requires PyQt4")
+             self.__vprocess = PipedViewerPQProcess(self.__cmndrecvpipe,
+                                                    self.__rspdsendpipe)
+         elif viewertype == "PipedImagerPQ":
+             try:
+-                from pipedimagerpq import PipedImagerPQProcess
++                from .pipedimagerpq import PipedImagerPQProcess
+             except ImportError:
+                 raise TypeError("The PQ viewers requires PyQt4")
+             self.__vprocess = PipedImagerPQProcess(self.__cmndrecvpipe,
+@@ -222,23 +224,23 @@ if __name__ == "__main__":
      drawcmnds.append( { "action":"exit" } )
      # Test each known viewer.
      for viewername in ( "PipedViewerPQ", ):
@@ -338,8 +361,11 @@ Index: pyferret-1.1.0/pviewmod/__init__.py
 +                print ("Response: %s" % str(response))
                  response = pviewer.checkForResponse()
              if cmd["action"] == "show":
-                 raw_input("Press Enter to continue")
-@@ -241,4 +242,4 @@ if __name__ == "__main__":
+-                raw_input("Press Enter to continue")
++                input("Press Enter to continue")
+         # end of the commands - shut down and check return value
+         pviewer.waitForViewerExit()
+         result = pviewer.getViewerExitCode()
          if result != 0:
              sys.exit(result)
          else:
@@ -349,7 +375,7 @@ Index: pyferret-1.1.0/pviewmod/pyferretbindings.py
 ===================================================================
 --- pyferret-1.1.0.orig/pviewmod/pyferretbindings.py
 +++ pyferret-1.1.0/pviewmod/pyferretbindings.py
-@@ -15,9 +15,10 @@ This package was developed by the Therma
+@@ -15,9 +15,11 @@ This package was developed by the Therma
  Pacific Marine Environmental Lab (PMEL).
  '''
  
@@ -358,10 +384,11 @@ Index: pyferret-1.1.0/pviewmod/pyferretbindings.py
  from pipedviewer import PipedViewer
 -
 +from past.builtins import xrange
++from builtins import input
  
  class PyFerretBindings(AbstractPyFerretBindings):
      '''
-@@ -884,7 +885,7 @@ if __name__ == "__main__":
+@@ -884,7 +886,7 @@ if __name__ == "__main__":
      # Initiate pyferret, but stay in python
      pyferret.init(None, False)
      for viewertype in ( "PipedViewerPQ", ):
@@ -370,7 +397,25 @@ Index: pyferret-1.1.0/pviewmod/pyferretbindings.py
          # Create a viewer window
          title = viewertype + "Tester"
          bindinst = pyferret.graphbind.createWindow(viewertype, title, True)
-@@ -971,5 +972,5 @@ if __name__ == "__main__":
+@@ -920,7 +922,7 @@ if __name__ == "__main__":
+         bindinst.endView()
+         # Window should already be shown, but just to make sure
+         bindinst.showWindow(True)
+-        raw_input("Press Enter to continue")
++        input("Press Enter to continue")
+         # Create a view of the whole window
+         bindinst.beginView(0.0, 1.0, 1.0, 0.0, True)
+         # Draw magenta points using various symbols
+@@ -963,7 +965,7 @@ if __name__ == "__main__":
+         bindinst.endView()
+         # Window should already be shown, but just to make sure
+         bindinst.showWindow(True)
+-        raw_input("Press Enter to continue")
++        input("Press Enter to continue")
+         try:
+             while 1:
+                 bindinst.deleteColor(mycolors.pop())
+@@ -971,5 +973,5 @@ if __name__ == "__main__":
              pass
          bindinst.deleteFont(myfont)
          bindinst.deleteWindow()
@@ -403,11 +448,2992 @@ Index: pyferret-1.1.0/pyfermod/__init__.py
 ===================================================================
 --- pyferret-1.1.0.orig/pyfermod/__init__.py
 +++ pyferret-1.1.0/pyfermod/__init__.py
-@@ -46,6 +46,7 @@ import readline
+@@ -46,6 +46,8 @@ import readline
  import numpy
  import numpy.ma
  import StringIO
 +from past.builtins import xrange
++from buildins import input
  
  # In Debian, an application should be able to start without environmental
  # variables needing to be set. So set them here.
+@@ -1577,9 +1579,9 @@ def _readline(myprompt):
+     """
+     try:
+         if myprompt:
+-            myline = raw_input(myprompt)
++            myline = input(myprompt)
+         else:
+-            myline = raw_input()
++            myline = input()
+     except EOFError:
+         myline = None
+ 
+Index: pyferret-1.1.0/pviewmod/pipedviewerpq.py
+===================================================================
+--- pyferret-1.1.0.orig/pviewmod/pipedviewerpq.py
++++ pyferret-1.1.0/pviewmod/pipedviewerpq.py
+@@ -13,6 +13,7 @@ Project (TMAP) of the National Oceanogra
+ Administration's (NOAA) Pacific Marine Environmental Lab (PMEL).
+ '''
+ 
++from __future__ import print_function
+ import sip
+ try:
+     sip.setapi('QVariant', 2)
+@@ -1522,11 +1523,11 @@ class _CommandSubmitterPQ(QDialog):
+         or shutdown if there are no more commands to submit.
+         '''
+         try:
+-            print "Command: %s" % str(self.__cmndlist[self.__nextcmnd])
++            print ("Command: %s" % str(self.__cmndlist[self.__nextcmnd]))
+             self.__cmndpipe.send(self.__cmndlist[self.__nextcmnd])
+             self.__nextcmnd += 1
+             while self.__rspdpipe.poll():
+-                print "Response: %s" % str(self.__rspdpipe.recv())
++                print ("Response: %s" % str(self.__rspdpipe.recv()))
+         except IndexError:
+             self.__rspdpipe.close()
+             self.__cmndpipe.close()
+Index: pyferret-1.1.0/pyfermod/eofanal/eofanalysis.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/eofanal/eofanalysis.py
++++ pyferret-1.1.0/pyfermod/eofanal/eofanalysis.py
+@@ -9,7 +9,7 @@ raised by some methods in the EOFAnalysi
+ 
+ @author: Karl M. Smith
+ '''
+-
++from __future__ import print_function
+ import math
+ import numpy
+ import numpy.linalg
+@@ -495,8 +495,8 @@ if __name__ == '__main__':
+     cosT = numpy.cos(months * numpy.pi / 6.0)
+     sinT = numpy.sin(months * numpy.pi / 6.0)
+ 
+-    print
+-    print 'spacetime = [ cosT, sinT + 1 ]'
++    print ()
++    print ('spacetime = [ cosT, sinT + 1 ]')
+     spacetimedata = numpy.matrix([cosT,
+                                   sinT + 1.0]).T
+     eofanal = EOFAnalysis(spacetimedata)
+@@ -504,24 +504,24 @@ if __name__ == '__main__':
+     defminsignif = eofanal.minsignif();
+     eofanal.setminsignif(0.1)
+     fracsignifs = eofanal.signiffracs()
+-    print 'EOF fractional significances:'
+-    print formatter.pformat(fracsignifs)
++    print ('EOF fractional significances:')
++    print (formatter.pformat(fracsignifs))
+     numeofs = eofanal.numeofs()
+-    print 'Number of significant EOFs: %d' % numeofs
++    print ('Number of significant EOFs: %d' % numeofs)
+     totalcontrib = eofanal.datapiece(0)
+     for k in xrange(1, numeofs+1):
+         eofvec = eofanal.eofvec(k)
+         sqnorm = numpy.dot(eofvec, eofvec)
+-        print 'EOF %d has norm^2: %#.4f' % (k, sqnorm)
+-        print formatter.pformat(eofvec)
++        print ('EOF %d has norm^2: %#.4f' % (k, sqnorm))
++        print (formatter.pformat(eofvec))
+         tafvec = eofanal.tafvec(k)
+         sqnorm = numpy.dot(tafvec, tafvec)
+-        print 'TAF %d has norm^2: %#.4f' % (k, sqnorm)
+-        print formatter.pformat(tafvec)
++        print ('TAF %d has norm^2: %#.4f' % (k, sqnorm))
++        print (formatter.pformat(tafvec))
+         tafeof = numpy.outer(tafvec, eofvec) 
+         contrib = eofanal.datapiece(k)
+         if numpy.allclose(contrib, tafeof):
+-            print 'datapiece(%d) all close to expected values' % k
++            print ('datapiece(%d) all close to expected values' % k)
+         else:
+             raise ValueError(
+                     'datapiece(%d):\n    expected\n%s\n    found\n%s' % \
+@@ -530,7 +530,7 @@ if __name__ == '__main__':
+         totalcontrib += contrib
+         expdata = eofanal.dataexplained(k)
+         if numpy.allclose(expdata, totalcontrib):
+-            print 'dataexplained(%d) all close to expected values' % k
++            print ('dataexplained(%d) all close to expected values' % k)
+         else:
+             raise ValueError(
+                     'dataexplained(%d):\n    expected\n%s\n    found\n%s' % \
+@@ -539,18 +539,18 @@ if __name__ == '__main__':
+         datadeltas = numpy.array(numpy.abs(spacetimedata - expdata)).flatten()
+         maxdiff = numpy.max(datadeltas)
+         rmsdiff = math.sqrt(numpy.average(datadeltas * datadeltas))
+-        print 'Max and RMS diff btwn data explained by %d most' % k
+-        print '    influential EOFs and actual data: %#.8f, %#.8f' % \
+-              (maxdiff, rmsdiff)
++        print ('Max and RMS diff btwn data explained by %d most' % k)
++        print ('    influential EOFs and actual data: %#.8f, %#.8f' % \
++              (maxdiff, rmsdiff))
+     datadeltas = numpy.array(numpy.abs(spacetimedata - totalcontrib)).flatten()
+     maxdiff = numpy.max(datadeltas)
+     rmsdiff = math.sqrt(numpy.average(datadeltas * datadeltas))
+-    print 'Max and RMS diff btwn sum of all significant'
+-    print '    data pieces and actual data: %#.8f, %#.8f' % \
+-          (maxdiff, rmsdiff)
++    print ('Max and RMS diff btwn sum of all significant')
++    print ('    data pieces and actual data: %#.8f, %#.8f' % \
++          (maxdiff, rmsdiff))
+ 
+-    print
+-    print 'spacetime = [ cosT * cosT, cosT * sinT + 1, cosT * sinT + 2, sinT * sinT + 3 ]'
++    print ()
++    print ('spacetime = [ cosT * cosT, cosT * sinT + 1, cosT * sinT + 2, sinT * sinT + 3 ]')
+     spacetimedata = numpy.matrix([ cosT * cosT,
+                                    cosT * sinT + 1.0,
+                                    cosT * sinT + 2.0,
+@@ -558,24 +558,24 @@ if __name__ == '__main__':
+     eofanal = EOFAnalysis(spacetimedata)
+     eofanal.analyze()
+     fracsignifs = eofanal.signiffracs()
+-    print 'EOF fractional significances:'
+-    print formatter.pformat(fracsignifs)
++    print ('EOF fractional significances:')
++    print (formatter.pformat(fracsignifs))
+     numeofs = eofanal.numeofs()
+-    print 'Number of significant EOFs: %d' % numeofs
++    print ('Number of significant EOFs: %d' % numeofs)
+     totalcontrib = eofanal.datapiece(0)
+     for k in xrange(1, numeofs+1):
+         eofvec = eofanal.eofvec(k)
+         sqnorm = numpy.dot(eofvec, eofvec)
+-        print 'EOF %d has norm^2: %#.4f' % (k, sqnorm)
+-        print formatter.pformat(eofvec)
++        print ('EOF %d has norm^2: %#.4f' % (k, sqnorm))
++        print (formatter.pformat(eofvec))
+         tafvec = eofanal.tafvec(k)
+         sqnorm = numpy.dot(tafvec, tafvec)
+-        print 'TAF %d has norm^2: %#.4f' % (k, sqnorm)
+-        print formatter.pformat(tafvec)
++        print ('TAF %d has norm^2: %#.4f' % (k, sqnorm))
++        print (formatter.pformat(tafvec)))
+         tafeof = numpy.outer(tafvec, eofvec) 
+         contrib = eofanal.datapiece(k)
+         if numpy.allclose(contrib, tafeof):
+-            print 'datapiece(%d) all close to expected values' % k
++            print ('datapiece(%d) all close to expected values' % k)
+         else:
+             raise ValueError(
+                     'datapiece(%d):\n    expected\n%s\n    found\n%s' % \
+@@ -584,7 +584,7 @@ if __name__ == '__main__':
+         totalcontrib += contrib
+         expdata = eofanal.dataexplained(k)
+         if numpy.allclose(expdata, totalcontrib):
+-            print 'dataexplained(%d) all close to expected values' % k
++            print ('dataexplained(%d) all close to expected values' % k)
+         else:
+             raise ValueError(
+                     'dataexplained(%d):\n    expected\n%s\n    found\n%s' % \
+@@ -593,31 +593,31 @@ if __name__ == '__main__':
+         datadeltas = numpy.array(numpy.abs(spacetimedata - expdata)).flatten()
+         maxdiff = numpy.max(datadeltas)
+         rmsdiff = math.sqrt(numpy.average(datadeltas * datadeltas))
+-        print 'Max and RMS diff btwn data explained by %d most' % k
+-        print '    influential EOFs and actual data: %#.8f, %#.8f' % \
+-              (maxdiff, rmsdiff)
++        print ('Max and RMS diff btwn data explained by %d most' % k)
++        print ('    influential EOFs and actual data: %#.8f, %#.8f' % \
++              (maxdiff, rmsdiff))
+     datadeltas = numpy.array(numpy.abs(spacetimedata - totalcontrib)).flatten()
+     maxdiff = numpy.max(datadeltas)
+     rmsdiff = math.sqrt(numpy.average(datadeltas * datadeltas))
+-    print 'Max and RMS diff btwn sum of all significant'
+-    print '    data pieces and actual data: %#.8f, %#.8f' % \
+-          (maxdiff, rmsdiff)
++    print ('Max and RMS diff btwn sum of all significant')
++    print ('    data pieces and actual data: %#.8f, %#.8f' % \
++          (maxdiff, rmsdiff))
+ 
+     fmat = spacetimedata - eofanal.datapiece(0)
+     for k in xrange(1, spacetimedata.shape[1] - numeofs + 1):
+         nullvec = eofanal.nullvec(k)
+         sqnorm = numpy.dot(nullvec, nullvec)
+-        print 'Null-space vector %d has norm^2: %#.4f' % (k, sqnorm)
+-        print formatter.pformat(nullvec)
++        print ('Null-space vector %d has norm^2: %#.4f' % (k, sqnorm))
++        print (formatter.pformat(nullvec)))
+         tafvec = numpy.array(fmat * numpy.matrix(nullvec).T).squeeze()
+         sqnorm = numpy.dot(tafvec, tafvec)
+-        print 'F * NSV %d has norm^2: %#.4f' % (k, sqnorm)
++        print ('F * NSV %d has norm^2: %#.4f' % (k, sqnorm))
+         # print formatter.pformat(tafvec)
+ 
+     import cPickle
+ 
+     eofpicklestring = cPickle.dumps(eofanal)
+-    print 'length of the eofanal pickle string: %d' % len(eofpicklestring)
++    print ('length of the eofanal pickle string: %d' % len(eofpicklestring))
+     neweofanal = cPickle.loads(eofpicklestring)
+-    print 'unpickled eofanal.numeofs() = %d' % neweofanal.numeofs()
++    print ('unpickled eofanal.numeofs() = %d' % neweofanal.numeofs())
+ 
+Index: pyferret-1.1.0/pyfermod/eofanal/eofanalysistests.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/eofanal/eofanalysistests.py
++++ pyferret-1.1.0/pyfermod/eofanal/eofanalysistests.py
+@@ -4,7 +4,8 @@ Tests for the eofanalysis module.
+ @author: Karl Smith
+ '''
+ 
+-import eofanalysis
++from . import eofanalysis
++from past.builtins import xrange
+ import math
+ import numpy
+ import unittest
+Index: pyferret-1.1.0/pviewmod/pipedimagerpq.py
+===================================================================
+--- pyferret-1.1.0.orig/pviewmod/pipedimagerpq.py
++++ pyferret-1.1.0/pviewmod/pipedimagerpq.py
+@@ -13,6 +13,7 @@ Project (TMAP) of the National Oceanogra
+ Administration's (NOAA) Pacific Marine Environmental Lab (PMEL).
+ '''
+ 
++from __future__ import print_function
+ import sip
+ try:
+     sip.setapi('QVariant', 2)
+@@ -28,6 +29,7 @@ from PyQt4.QtGui  import QAction, QAppli
+ from cmndhelperpq import CmndHelperPQ
+ from scaledialogpq import ScaleDialogPQ
+ from multiprocessing import Pipe, Process
++from past.builtins import xrange
+ import sys
+ import time
+ import os
+@@ -785,11 +787,11 @@ class _CommandSubmitterPQ(QDialog):
+             cmndstr = str(self.__cmndlist[self.__nextcmnd])
+             if len(cmndstr) > 188:
+                 cmndstr = cmndstr[:188] + '...'
+-            print "Command: %s" % cmndstr
++            print ("Command: %s" % cmndstr)
+             self.__cmndpipe.send(self.__cmndlist[self.__nextcmnd])
+             self.__nextcmnd += 1
+             while self.__rspdpipe.poll():
+-                print "Response: %s" % str(self.__rspdpipe.recv())
++                print ("Response: %s" % str(self.__rspdpipe.recv()))
+         except IndexError:
+             self.__rspdpipe.close()
+             self.__cmndpipe.close()
+Index: pyferret-1.1.0/pyfermod/regrid/__init__.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/regrid/__init__.py
++++ pyferret-1.1.0/pyfermod/regrid/__init__.py
+@@ -10,9 +10,9 @@ import numpy
+ 
+ # Import classes given in modules in this package so they are all seen here.
+ try:
+-    from esmpcontrol import ESMPControl
+-    from regrid2d import CurvRectRegridder
+-    from regrid3d import CurvRect3DRegridder
++    from .esmpcontrol import ESMPControl
++    from .regrid2d import CurvRectRegridder
++    from .regrid3d import CurvRect3DRegridder
+ except ImportError:
+     # No ESMP, but do not raise an error until attempting to actually use it
+     pass
+Index: pyferret-1.1.0/pyfermod/regrid/curv2rect.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/regrid/curv2rect.py
++++ pyferret-1.1.0/pyfermod/regrid/curv2rect.py
+@@ -10,7 +10,7 @@ import numpy
+ import pyferret
+ import ESMP
+ import pyferret.regrid as regrid
+-
++from past.builtins import xrange
+ 
+ def ferret_init(efid):
+     '''
+Index: pyferret-1.1.0/pyfermod/regrid/curv3srect.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/regrid/curv3srect.py
++++ pyferret-1.1.0/pyfermod/regrid/curv3srect.py
+@@ -12,7 +12,7 @@ import numpy
+ import pyferret
+ import ESMP
+ import pyferret.regrid as regrid
+-
++from past.builtins import xrange
+ 
+ def ferret_init(efid):
+     '''
+Index: pyferret-1.1.0/pyfermod/regrid/esmpcontroltests.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/regrid/esmpcontroltests.py
++++ pyferret-1.1.0/pyfermod/regrid/esmpcontroltests.py
+@@ -4,7 +4,7 @@ Tests of ESMPControl singleton class
+ @author: Karl Smith
+ '''
+ import unittest
+-from esmpcontrol import ESMPControl
++from .esmpcontrol import ESMPControl
+ 
+ 
+ class Test(unittest.TestCase):
+Index: pyferret-1.1.0/pyfermod/regrid/regrid2dexample2.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/regrid/regrid2dexample2.py
++++ pyferret-1.1.0/pyfermod/regrid/regrid2dexample2.py
+@@ -5,10 +5,11 @@ and also serves as a coding example of u
+ @author: Karl Smith
+ '''
+ 
++from __future__ import print_function
+ import numpy
+ import ESMP
+-from esmpcontrol import ESMPControl
+-from regrid2d import CurvRectRegridder
++from .esmpcontrol import ESMPControl
++from .regrid2d import CurvRectRegridder
+ 
+ 
+ def createExampleData():
+@@ -198,20 +199,20 @@ def printDiffs(grid_lons, grid_lats, und
+     for (_, lon, lat, expect, found) in diff_list:
+         if expect == undef_val:
+             num_not_undef += 1
+-            print "lon = %#7.3f, lat = %7.3f, expect =  undef, found = %#8.5f" \
+-                  % (lon, lat, found)
++            print ("lon = %#7.3f, lat = %7.3f, expect =  undef, found = %#8.5f" \
++                  % (lon, lat, found))
+         elif found == undef_val:
+             num_undef += 1
+-            print "lon = %#7.3f, lat = %7.3f, expect = %#8.5f, found =  undef" \
+-                  % (lon, lat, expect)
++            print ("lon = %#7.3f, lat = %7.3f, expect = %#8.5f, found =  undef" \
++                  % (lon, lat, expect))
+         else:
+             num_diff += 1
+-            print "lon = %#7.3f, lat = %7.3f, expect = %#8.5f, found = %#8.5f, " \
+-                  "diff = %#8.5f" % (lon, lat, expect, found, found - expect)
+-    print "%3d undefined when defined might be expected" % num_undef
+-    print "%3d with absolute difference > %#.5f" % (num_diff, max_negl)
+-    print "%3d defined when undefined expected" % num_not_undef
+-    print "%3d values in the grid" % (expect_data.shape[0] * expect_data.shape[1])
++            print ("lon = %#7.3f, lat = %7.3f, expect = %#8.5f, found = %#8.5f, " \
++                  "diff = %#8.5f" % (lon, lat, expect, found, found - expect))
++    print ("%3d undefined when defined might be expected" % num_undef)
++    print ("%3d with absolute difference > %#.5f" % (num_diff, max_negl))
++    print ("%3d defined when undefined expected" % num_not_undef)
++    print ("%3d values in the grid" % (expect_data.shape[0] * expect_data.shape[1]))
+ 
+ 
+ # main routine - for testing "by hand"
+@@ -279,16 +280,16 @@ if __name__ == '__main__':
+     # Regrid from curvilinear to rectilinear using the bilinear method
+     rect_regrid_data = regridder.regridCurvToRect(undef_val, ESMP.ESMP_REGRIDMETHOD_BILINEAR)
+     # Print the differences between the expected and regrid data
+-    print ""
+-    print "analytic (expect) versus bilinear regridded (found) differences"
++    print ("")
++    print ("analytic (expect) versus bilinear regridded (found) differences")
+     printDiffs(rect_2d_center_lons, rect_2d_center_lats, undef_val, max_negl,
+                rect_expect_data, rect_regrid_data)
+ 
+     # Regrid from curvilinear to rectilinear using the patch method
+     rect_regrid_data = regridder.regridCurvToRect(undef_val, ESMP.ESMP_REGRIDMETHOD_PATCH)
+     # Print the differences between the expected and regrid data
+-    print ""
+-    print "analytic (expect) versus patch regridded (found) differences"
++    print ("")
++    print ("analytic (expect) versus patch regridded (found) differences")
+     printDiffs(rect_2d_center_lons, rect_2d_center_lats, undef_val, max_negl,
+                rect_expect_data, rect_regrid_data)
+ 
+@@ -296,8 +297,8 @@ if __name__ == '__main__':
+     # Corners required for this method
+     rect_regrid_data = regridder.regridCurvToRect(undef_val, ESMP.ESMP_REGRIDMETHOD_CONSERVE)
+     # Print the differences between the expected and regrid data
+-    print ""
+-    print "analytic (expect) versus conserve regridded (found) differences"
++    print ("")
++    print ("analytic (expect) versus conserve regridded (found) differences")
+     printDiffs(rect_2d_center_lons, rect_2d_center_lats, undef_val, max_negl,
+                rect_expect_data, rect_regrid_data)
+ 
+Index: pyferret-1.1.0/pyfermod/regrid/regrid2dexample.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/regrid/regrid2dexample.py
++++ pyferret-1.1.0/pyfermod/regrid/regrid2dexample.py
+@@ -5,10 +5,12 @@ and also serves as a coding example of u
+ @author: Karl Smith
+ '''
+ 
++from __future__ import print_function
+ import numpy
+ import ESMP
+-from esmpcontrol import ESMPControl
+-from regrid2d import CurvRectRegridder
++from builtins import input
++from .esmpcontrol import ESMPControl
++from .regrid2d import CurvRectRegridder
+ 
+ 
+ def createExampleCurvData():
+@@ -775,32 +777,32 @@ def printDiffs(grid_lons, grid_lats, und
+     for (_, lon, lat, expect, found) in diff_list:
+         if expect == undef_val:
+             num_not_undef += 1
+-            print "lon = %#7.3f, lat = %7.3f, expect =  undef, found = %#6.3f" \
+-                  % (lon, lat, found)
++            print ("lon = %#7.3f, lat = %7.3f, expect =  undef, found = %#6.3f" \
++                  % (lon, lat, found))
+         elif found == undef_val:
+             num_undef += 1
+-            print "lon = %#7.3f, lat = %7.3f, expect = %#6.3f, found =  undef" \
+-                  % (lon, lat, expect)
++            print ("lon = %#7.3f, lat = %7.3f, expect = %#6.3f, found =  undef" \
++                  % (lon, lat, expect))
+         else:
+             num_diff += 1
+-            print "lon = %#7.3f, lat = %7.3f, expect = %#6.3f, found = %#6.3f, " \
+-                  "diff = %#6.3f" % (lon, lat, expect, found, found - expect)
+-    print "%3d undefined when defined might be expected" % num_undef
+-    print "%3d with absolute difference > %#.3f" % (num_diff, max_negl)
+-    print "%3d defined when undefined expected" % num_not_undef
+-    print "%3d values in the grid" % (expect_data.shape[0] * expect_data.shape[1])
++            print ("lon = %#7.3f, lat = %7.3f, expect = %#6.3f, found = %#6.3f, " \
++                  "diff = %#6.3f" % (lon, lat, expect, found, found - expect))
++    print ("%3d undefined when defined might be expected" % num_undef)
++    print ("%3d with absolute difference > %#.3f" % (num_diff, max_negl))
++    print ("%3d defined when undefined expected" % num_not_undef)
++    print ("%3d values in the grid" % (expect_data.shape[0] * expect_data.shape[1]))
+ 
+ 
+ # main routine - for testing "by hand"
+ if __name__ == '__main__':
+     try:
+         while True:
+-            print 'cw2r: curvilinear with corners to rectilinear'
+-            print 'co2r: curvilinear without corners to rectilinear'
+-            print 'r2cw: rectilinear to curvilinear with corners'
+-            print 'r2co: rectilinear to curvilinear without corners'
+-            print 'Ctrl-D to quit'
+-            direction = raw_input('Regrid test to run? ')
++            print ('cw2r: curvilinear with corners to rectilinear')
++            print ('co2r: curvilinear without corners to rectilinear')
++            print ('r2cw: rectilinear to curvilinear with corners')
++            print ('r2co: rectilinear to curvilinear without corners')
++            print ('Ctrl-D to quit')
++            direction = input('Regrid test to run? ')
+             direction = direction.strip().lower()
+             if direction in ('cw2r', 'co2r', 'r2cw', 'r2co'):
+                 break
+@@ -848,11 +850,11 @@ if __name__ == '__main__':
+ 
+     if direction in ('cw2r', 'co2r'):
+ 
+-        print ""
++        print ("")
+         if direction == 'cw2r':
+-            print "Examining rectilinear results from curvilinear with corners"
++            print ("Examining rectilinear results from curvilinear with corners")
+         else:
+-            print "Examining rectilinear results from curvilinear without corners"
++            print ("Examining rectilinear results from curvilinear without corners")
+ 
+         # Create the curvilinear source field
+         regridder.assignCurvField(curv_data)
+@@ -868,16 +870,16 @@ if __name__ == '__main__':
+         # Regrid from curvilinear to rectilinear using the bilinear method
+         rect_regrid_data = regridder.regridCurvToRect(undef_val, ESMP.ESMP_REGRIDMETHOD_BILINEAR)
+         # Print the differences between the expected and regrid data
+-        print ""
+-        print "analytic (expect) versus bilinear regridded (found) differences"
++        print ("")
++        print ("analytic (expect) versus bilinear regridded (found) differences")
+         printDiffs(rect_2d_center_lons, rect_2d_center_lats, undef_val, 0.001,
+                    rect_expect_data, rect_regrid_data)
+ 
+         # Regrid from curvilinear to rectilinear using the patch method
+         rect_regrid_data = regridder.regridCurvToRect(undef_val, ESMP.ESMP_REGRIDMETHOD_PATCH)
+         # Print the differences between the expected and regrid data
+-        print ""
+-        print "analytic (expect) versus patch regridded (found) differences"
++        print ("")
++        print ("analytic (expect) versus patch regridded (found) differences")
+         printDiffs(rect_2d_center_lons, rect_2d_center_lats, undef_val, 0.001,
+                    rect_expect_data, rect_regrid_data)
+ 
+@@ -886,18 +888,18 @@ if __name__ == '__main__':
+             # Corners required for this method
+             rect_regrid_data = regridder.regridCurvToRect(undef_val, ESMP.ESMP_REGRIDMETHOD_CONSERVE)
+             # Print the differences between the expected and regrid data
+-            print ""
+-            print "analytic (expect) versus conserve regridded (found) differences"
++            print ("")
++            print ("analytic (expect) versus conserve regridded (found) differences")
+             printDiffs(rect_2d_center_lons, rect_2d_center_lats, undef_val, 0.05,
+                        rect_expect_data, rect_regrid_data)
+ 
+     elif direction in ('r2cw', 'r2co'):
+ 
+-        print ""
++        print ("")
+         if direction == 'r2cw':
+-            print "Examining curvilinear with corners results from rectilinear"
++            print ("Examining curvilinear with corners results from rectilinear")
+         else:
+-            print "Examining curvilinear without corners results from rectilinear"
++            print ("Examining curvilinear without corners results from rectilinear")
+ 
+         # Create the rectilinear source field
+         regridder.assignRectField(rect_data)
+@@ -909,8 +911,8 @@ if __name__ == '__main__':
+         curv_regrid_data = regridder.regridRectToCurv(undef_val, ESMP.ESMP_REGRIDMETHOD_BILINEAR)
+         # Print the differences between the expected and regrid data
+         # Ignore the edges of the regions
+-        print ""
+-        print "analytic (expect) versus bilinear regridded (found) differences"
++        print ("")
++        print ("analytic (expect) versus bilinear regridded (found) differences")
+         printDiffs(curv_center_lons[1:-1, 1:-1],
+                    curv_center_lats[1:-1, 1:-1],
+                    undef_val, 0.001,
+@@ -921,8 +923,8 @@ if __name__ == '__main__':
+         curv_regrid_data = regridder.regridRectToCurv(undef_val, ESMP.ESMP_REGRIDMETHOD_PATCH)
+         # Print the differences between the expected and regrid data
+         # Ignore the edges of the regions
+-        print ""
+-        print "analytic (expect) versus patch regridded (found) differences"
++        print ("")
++        print ("analytic (expect) versus patch regridded (found) differences")
+         printDiffs(curv_center_lons[1:-1 ,1:-1],
+                    curv_center_lats[1:-1, 1:-1],
+                    undef_val, 0.001,
+@@ -935,8 +937,8 @@ if __name__ == '__main__':
+             curv_regrid_data = regridder.regridRectToCurv(undef_val, ESMP.ESMP_REGRIDMETHOD_CONSERVE)
+             # Print the differences between the expected and regrid data
+             # Ignore the edges of the regions
+-            print ""
+-            print "analytic (expect) versus conserve regridded (found) differences"
++            print ("")
++            print ("analytic (expect) versus conserve regridded (found) differences")
+             printDiffs(curv_center_lons[1:-1,1:-1],
+                        curv_center_lats[1:-1,1:-1],
+                        undef_val, 0.1,
+Index: pyferret-1.1.0/pyfermod/regrid/regrid2d.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/regrid/regrid2d.py
++++ pyferret-1.1.0/pyfermod/regrid/regrid2d.py
+@@ -179,10 +179,10 @@ class CurvRectRegridder(object):
+                                                            center_ignore_array)
+ 
+         # Release any regridding procedures and clear the dictionaries
+-        for handle in self.__rect_to_curv_handles.values():
++        for handle in list(self.__rect_to_curv_handles.values()):
+             ESMP.ESMP_FieldRegridRelease(handle)
+         self.__rect_to_curv_handles.clear()
+-        for handle in self.__curv_to_rect_handles.values():
++        for handle in list(self.__curv_to_rect_handles.values()):
+             ESMP.ESMP_FieldRegridRelease(handle)
+         self.__curv_to_rect_handles.clear()
+         # Destroy any curvilinear ESMP_Fields
+@@ -443,10 +443,10 @@ class CurvRectRegridder(object):
+                                                            center_ignore_array)
+ 
+         # Release any regridding procedures and clear the dictionaries
+-        for handle in self.__rect_to_curv_handles.values():
++        for handle in list(self.__rect_to_curv_handles.values()):
+             ESMP.ESMP_FieldRegridRelease(handle)
+         self.__rect_to_curv_handles.clear()
+-        for handle in self.__curv_to_rect_handles.values():
++        for handle in list(self.__curv_to_rect_handles.values()):
+             ESMP.ESMP_FieldRegridRelease(handle)
+         self.__curv_to_rect_handles.clear()
+         # Destroy any rectilinear ESMP_Fields
+@@ -741,10 +741,10 @@ class CurvRectRegridder(object):
+             None
+         '''
+         # Release any regridding procedures and clear the dictionaries
+-        for handle in self.__rect_to_curv_handles.values():
++        for handle in list(self.__rect_to_curv_handles.values()):
+             ESMP.ESMP_FieldRegridRelease(handle)
+         self.__rect_to_curv_handles.clear()
+-        for handle in self.__curv_to_rect_handles.values():
++        for handle in list(self.__curv_to_rect_handles.values()):
+             ESMP.ESMP_FieldRegridRelease(handle)
+         self.__curv_to_rect_handles.clear()
+         # Destroy any ESMP_Fields
+Index: pyferret-1.1.0/pyfermod/regrid/regrid2dtests.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/regrid/regrid2dtests.py
++++ pyferret-1.1.0/pyfermod/regrid/regrid2dtests.py
+@@ -3,12 +3,14 @@ Unit tests for CurvRectRegridder
+ 
+ @author: Karl Smith
+ '''
++
++from __future__ import print_function
+ import unittest
+ import numpy
+ import ESMP
+-from esmpcontrol import ESMPControl
+-from regrid2d import CurvRectRegridder
+-
++from .esmpcontrol import ESMPControl
++from .regrid2d import CurvRectRegridder
++from past.builtins import xrange
+ 
+ class CurvRectRegridderTests(unittest.TestCase):
+     '''
+@@ -260,10 +262,11 @@ class CurvRectRegridderTests(unittest.Te
+         for i in xrange(expect_data.shape[0]):
+             for j in xrange(expect_data.shape[1]):
+                 if numpy.abs(expect_data[i, j] - regrid_data[i, j]) > 0.0007:
+-                    mismatch_found = True
+-                    print "expect = %#6.4f, found = %#6.4f for lon = %5.1f, " \
++                    mismat
++                    ch_found = True
++                    print ("expect = %#6.4f, found = %#6.4f for lon = %5.1f, " \
+                           "lat = %5.1f" % (expect_data[i, j], regrid_data[i, j],
+-                           self.rect_center_lons[i], self.rect_center_lats[j])
++                           self.rect_center_lons[i], self.rect_center_lats[j]))
+         if mismatch_found:
+             self.fail("data mismatch found")
+ 
+@@ -289,9 +292,9 @@ class CurvRectRegridderTests(unittest.Te
+             for j in xrange(expect_data.shape[1]):
+                 if numpy.abs(expect_data[i, j] - regrid_data[i, j]) > 0.0003:
+                     mismatch_found = True
+-                    print "expect = %#6.4f, found = %#6.4f for lon = %5.1f, " \
+-                          "lat = %5.1f" % (expect_data[i, j], regrid_data[i, j],
+-                           self.rect_center_lons[i], self.rect_center_lats[j])
++                    print ("expect = %#6.4f, found = %#6.4f for lon = %5.1f, " \
++                           "lat = %5.1f" % (expect_data[i, j], regrid_data[i, j],
++                            self.rect_center_lons[i], self.rect_center_lats[j]))
+         if mismatch_found:
+             self.fail("data mismatch found")
+ 
+@@ -321,9 +324,9 @@ class CurvRectRegridderTests(unittest.Te
+             for j in xrange(expect_data.shape[1]):
+                 if numpy.abs(expect_data[i, j] - regrid_data[i, j]) > 0.0011:
+                     mismatch_found = True
+-                    print "expect = %#6.4f, found = %#6.4f for lon = %5.1f, " \
++                    print ("expect = %#6.4f, found = %#6.4f for lon = %5.1f, " \
+                           "lat = %5.1f" % (expect_data[i, j], regrid_data[i, j],
+-                           self.rect_center_lons[i], self.rect_center_lats[j])
++                           self.rect_center_lons[i], self.rect_center_lats[j]))
+         if mismatch_found:
+             self.fail("data mismatch found")
+ 
+@@ -362,9 +365,9 @@ class CurvRectRegridderTests(unittest.Te
+             for j in xrange(1, expect_data.shape[1] - 1):
+                 if numpy.abs(expect_data[i, j] - regrid_data[i, j]) > 0.0004:
+                     mismatch_found = True
+-                    print "expect = %#6.4f, found = %#6.4f for lon = %7.3f, " \
++                    print ("expect = %#6.4f, found = %#6.4f for lon = %7.3f, " \
+                           "lat = %7.3f" % (expect_data[i, j], regrid_data[i, j], 
+-                          self.curv_center_lons[i][j], self.curv_center_lats[i][j])
++                          self.curv_center_lons[i][j], self.curv_center_lats[i][j]))
+         if mismatch_found:
+             self.fail("data mismatch found")
+ 
+@@ -394,7 +397,7 @@ class CurvRectRegridderTests(unittest.Te
+                     mismatch_found = True
+                     print "expect = %#6.4f, found = %#6.4f for lon = %7.3f, " \
+                           "lat = %7.3f" % (expect_data[i, j], regrid_data[i, j],
+-                          self.curv_center_lons[i][j], self.curv_center_lats[i][j])
++                          self.curv_center_lons[i][j], self.curv_center_lats[i][j]))
+         if mismatch_found:
+             self.fail("data mismatch found")
+ 
+Index: pyferret-1.1.0/pyfermod/regrid/regrid3d.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/regrid/regrid3d.py
++++ pyferret-1.1.0/pyfermod/regrid/regrid3d.py
+@@ -7,6 +7,7 @@ to ESMF to perform the regridding.
+ @author: Karl Smith
+ '''
+ 
++from __future__ import print_function # for python3
+ import numpy
+ import ESMP
+ 
+@@ -225,10 +226,10 @@ class CurvRect3DRegridder(object):
+             corner_ignore_array = None
+ 
+         # Release any regridding procedures and clear the dictionaries
+-        for handle in self.__rect_to_curv_handles.values():
++        for handle in list(self.__rect_to_curv_handles.values()):
+             ESMP.ESMP_FieldRegridRelease(handle)
+         self.__rect_to_curv_handles.clear()
+-        for handle in self.__curv_to_rect_handles.values():
++        for handle in list(self.__curv_to_rect_handles.values()):
+             ESMP.ESMP_FieldRegridRelease(handle)
+         self.__curv_to_rect_handles.clear()
+         # Destroy any curvilinear ESMP_Fields
+@@ -288,12 +289,15 @@ class CurvRect3DRegridder(object):
+             if self.__debug:
+                 fout = open("curv_corner_xyz.txt", "w")
+                 try:
+-                    print >>fout, "curv_corner_x = %s" % \
+-                        self.__myArrayStr(grid_x_coords, corner_lons_array.shape)
+-                    print >>fout, "curv_corner_y = %s" % \
+-                        self.__myArrayStr(grid_y_coords, corner_lons_array.shape)
+-                    print >>fout, "curv_corner_z = %s" % \
+-                        self.__myArrayStr(grid_z_coords, corner_lons_array.shape)
++                    print ("curv_corner_x = %s" % \
++                           self.__myArrayStr(grid_x_coords, corner_lons_array.shape), \
++                           file=fout)
++                    print ("curv_corner_y = %s" % \
++                           self.__myArrayStr(grid_y_coords, corner_lons_array.shape), \
++                           file=fout)
++                    print ("curv_corner_z = %s" % \
++                           self.__myArrayStr(grid_z_coords, corner_lons_array.shape), \
++                           file=fout)
+                 finally:
+                     fout.close()
+             
+@@ -346,12 +350,15 @@ class CurvRect3DRegridder(object):
+         if self.__debug:
+             fout = open("curv_center_xyz.txt", "w")
+             try:
+-                print >>fout, "curv_center_x = %s" % \
+-                    self.__myArrayStr(grid_x_coords, self.__curv_shape)
+-                print >>fout, "curv_center_y = %s" % \
+-                    self.__myArrayStr(grid_y_coords, self.__curv_shape)
+-                print >>fout, "curv_center_z = %s" % \
+-                    self.__myArrayStr(grid_z_coords, self.__curv_shape)
++                print ("curv_center_x = %s" % \
++                       self.__myArrayStr(grid_x_coords, self.__curv_shape), \
++                       file=fout)
++                print ("curv_center_y = %s" % \
++                       self.__myArrayStr(grid_y_coords, self.__curv_shape), \
++                       file=fout)
++                print ("curv_center_z = %s" % \
++                       self.__myArrayStr(grid_z_coords, self.__curv_shape), \
++                       file=fout)
+             finally:
+                 fout.close()
+ 
+@@ -429,8 +436,9 @@ class CurvRect3DRegridder(object):
+             if self.__debug:
+                 fout = open("curv_data.txt", "w")
+                 try:
+-                    print >>fout, "curv_data = %s" % \
+-                        self.__myArrayStr(field_ptr, self.__curv_shape)
++                    print ("curv_data = %s" % \
++                           self.__myArrayStr(field_ptr, self.__curv_shape),
++                           file=fout)
+                 finally:
+                     fout.close()
+ 
+@@ -570,10 +578,10 @@ class CurvRect3DRegridder(object):
+             corner_ignore_array = None
+ 
+         # Release any regridding procedures and clear the dictionaries
+-        for handle in self.__rect_to_curv_handles.values():
++        for handle in list(self.__rect_to_curv_handles.values()):
+             ESMP.ESMP_FieldRegridRelease(handle)
+         self.__rect_to_curv_handles.clear()
+-        for handle in self.__curv_to_rect_handles.values():
++        for handle in list(self.__curv_to_rect_handles.values()):
+             ESMP.ESMP_FieldRegridRelease(handle)
+         self.__curv_to_rect_handles.clear()
+         # Destroy any rectilinear ESMP_Fields
+@@ -642,12 +650,15 @@ class CurvRect3DRegridder(object):
+             if self.__debug:
+                 fout = open("rect_corner_xyz.txt", "w")
+                 try:
+-                    print >>fout, "rect_corner_x = %s" % \
+-                        self.__myArrayStr(grid_x_coords, corner_shape)
+-                    print >>fout, "rect_corner_y = %s" % \
+-                        self.__myArrayStr(grid_y_coords, corner_shape)
+-                    print >>fout, "rect_corner_z = %s" % \
+-                        self.__myArrayStr(grid_z_coords, corner_shape)
++                    print ("rect_corner_x = %s" % \
++                           self.__myArrayStr(grid_x_coords, corner_shape),
++                           file=fout)
++                    print ("rect_corner_y = %s" % \
++                           self.__myArrayStr(grid_y_coords, corner_shape),
++                           file=fout)
++                    print ("rect_corner_z = %s" % \
++                           self.__myArrayStr(grid_z_coords, corner_shape),
++                           file=fout)
+                 finally:
+                     fout.close()
+ 
+@@ -707,12 +718,15 @@ class CurvRect3DRegridder(object):
+         if self.__debug:
+             try:
+                 fout = open("rect_center_xyz.txt", "w")
+-                print >>fout, "rect_center_x = %s" % \
+-                    self.__myArrayStr(grid_x_coords, self.__rect_shape)
+-                print >>fout, "rect_center_y = %s" % \
+-                    self.__myArrayStr(grid_y_coords, self.__rect_shape)
+-                print >>fout, "rect_center_z = %s" % \
+-                    self.__myArrayStr(grid_z_coords, self.__rect_shape)
++                print ("rect_center_x = %s" % \
++                       self.__myArrayStr(grid_x_coords, self.__rect_shape),
++                       file=fout)
++                print ("rect_center_y = %s" % \
++                       self.__myArrayStr(grid_y_coords, self.__rect_shape),
++                       file=fout)
++                print ("rect_center_z = %s" % \
++                       self.__myArrayStr(grid_z_coords, self.__rect_shape),
++                       file=fout)
+             finally:
+                 fout.close()
+ 
+@@ -790,8 +804,9 @@ class CurvRect3DRegridder(object):
+             if self.__debug:
+                 fout = open("rect_data.txt", "w")
+                 try:
+-                    print >>fout, "rect_data = %s" % \
+-                        self.__myArrayStr(field_ptr, self.__rect_shape)
++                    print ("rect_data = %s" % \
++                           self.__myArrayStr(field_ptr, self.__rect_shape),
++                           file=fout)
+                 finally:
+                     fout.close()
+ 
+@@ -866,8 +881,9 @@ class CurvRect3DRegridder(object):
+         if self.__debug:
+             fout = open("regr_rect_data.txt", "w")
+             try:
+-                print >>fout, "regr_rect_data = %s" % \
+-                    self.__myArrayStr(result, self.__rect_shape)
++                print ("regr_rect_data = %s" % \
++                       self.__myArrayStr(result, self.__rect_shape),
++                       file=fout)
+             finally:
+                 fout.close()
+ 
+@@ -946,8 +962,9 @@ class CurvRect3DRegridder(object):
+         if self.__debug:
+             fout = open("regr_curv_data.txt", "w")
+             try:
+-                print >>fout, "regr_curv_data = %s" % \
+-                    self.__myArrayStr(result, self.__curv_shape)
++                print ("regr_curv_data = %s" % \
++                       self.__myArrayStr(result, self.__curv_shape),
++                       file=fout)
+             finally:
+                 fout.close()
+         result = result.reshape(self.__curv_shape, order='F')
+@@ -968,10 +985,10 @@ class CurvRect3DRegridder(object):
+             None
+         '''
+         # Release any regridding procedures and clear the dictionaries
+-        for handle in self.__rect_to_curv_handles.values():
++        for handle in list(self.__rect_to_curv_handles.values()):
+             ESMP.ESMP_FieldRegridRelease(handle)
+         self.__rect_to_curv_handles.clear()
+-        for handle in self.__curv_to_rect_handles.values():
++        for handle in list(self.__curv_to_rect_handles.values()):
+             ESMP.ESMP_FieldRegridRelease(handle)
+         self.__curv_to_rect_handles.clear()
+         # Destroy any ESMP_Fields
+Index: pyferret-1.1.0/pyfermod/regrid/regrid3dexample.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/regrid/regrid3dexample.py
++++ pyferret-1.1.0/pyfermod/regrid/regrid3dexample.py
+@@ -4,12 +4,12 @@ and also serves as a coding example of u
+ 
+ @author: Karl Smith
+ '''
+-
++from __future__ import print_function
+ import numpy
+ import ESMP
+-from esmpcontrol import ESMPControl
+-from regrid3d import CurvRect3DRegridder
+-
++from .esmpcontrol import ESMPControl
++from .regrid3d import CurvRect3DRegridder
++from builtins import input
+ 
+ GULF_MEX_LONS = (262.0, 278.0, 0.5)
+ GULF_MEX_LATS = (18.0, 31.0, 0.5)
+@@ -381,33 +381,33 @@ def printDiffs(grid_lons, grid_lats, gri
+     for (_, lon, lat, depth, expect, found) in diff_list:
+         if expect == undef_val:
+             num_not_undef += 1
+-            print "lon = %#7.3f, lat = %7.3f, depth = %7.2f, expect =  undef, " \
+-                  "found = %#6.3f" % (lon, lat, depth, found)
++            print ("lon = %#7.3f, lat = %7.3f, depth = %7.2f, expect =  undef, " \
++                  "found = %#6.3f" % (lon, lat, depth, found))
+         elif found == undef_val:
+             num_undef += 1
+-            # print "lon = %#7.3f, lat = %7.3f, depth = %7.2f, expect = %#6.3f, " \
+-            #       "found =  undef" % (lon, lat, depth, expect)
++            # print ("lon = %#7.3f, lat = %7.3f, depth = %7.2f, expect = %#6.3f, " \
++            #       "found =  undef" % (lon, lat, depth, expect))
+         else:
+             num_diff += 1
+-            print "lon = %#7.3f, lat = %7.3f, depth = %7.2f, expect = %#6.3f, " \
++            print ("lon = %#7.3f, lat = %7.3f, depth = %7.2f, expect = %#6.3f, " \
+                   "found = %#6.3f, diff = %#6.3f" \
+-                  % (lon, lat, depth, expect, found, found - expect)
+-    print "%3d undefined when defined might be expected" % num_undef
+-    print "%3d with absolute difference > %#.3f" % (num_diff, max_negl)
+-    print "%3d defined when undefined expected" % num_not_undef
+-    print "%3d values in the grid" \
+-            % (expect_data.shape[0] * expect_data.shape[1] * expect_data.shape[2])
++                  % (lon, lat, depth, expect, found, found - expect))
++    print ("%3d undefined when defined might be expected" % num_undef)
++    print ("%3d with absolute difference > %#.3f" % (num_diff, max_negl))
++    print ("%3d defined when undefined expected" % num_not_undef)
++    print ("%3d values in the grid" \
++            % (expect_data.shape[0] * expect_data.shape[1] * expect_data.shape[2]))
+ 
+ 
+ if __name__ == '__main__':
+     try:
+         while True:
+-            print 'cw2r: curvilinear with corners to rectilinear'
+-            print 'co2r: curvilinear without corners to rectilinear'
+-            print 'r2cw: rectilinear to curvilinear with corners'
+-            print 'r2co: rectilinear to curvilinear without corners'
+-            print 'Ctrl-D to quit'
+-            direction = raw_input('Regrid test to run? ')
++            print ('cw2r: curvilinear with corners to rectilinear')
++            print ('co2r: curvilinear without corners to rectilinear')
++            print ('r2cw: rectilinear to curvilinear with corners')
++            print ('r2co: rectilinear to curvilinear without corners')
++            print ('Ctrl-D to quit')
++            direction = input('Regrid test to run? ')
+             direction = direction.strip().lower()
+             if direction in ('cw2r', 'co2r', 'r2cw', 'r2co'):
+                 break
+@@ -460,11 +460,11 @@ if __name__ == '__main__':
+ 
+     if direction in ('cw2r', 'co2r'):
+ 
+-        print ""
++        print ("")
+         if direction == 'cw2r':
+-            print "Examining rectilinear results from curvilinear with corners"
++            print ("Examining rectilinear results from curvilinear with corners")
+         else:
+-            print "Examining rectilinear results from curvilinear without corners"
++            print ("Examining rectilinear results from curvilinear without corners")
+ 
+         # Create the curvilinear source field
+         regridder.assignCurvField(curv_data)
+@@ -492,8 +492,8 @@ if __name__ == '__main__':
+             # Corners required for this method
+             rect_regrid_data = regridder.regridCurvToRect(undef_val, ESMP.ESMP_REGRIDMETHOD_CONSERVE)
+             # Print the differences between the expected and regrid data
+-            print ""
+-            print "analytic (expect) versus conserve regridded (found) differences"
++            print ("")
++            print ("analytic (expect) versus conserve regridded (found) differences")
+             printDiffs(rect_3d_center_lons,
+                        rect_3d_center_lats,
+                        rect_3d_center_depths,
+@@ -504,8 +504,8 @@ if __name__ == '__main__':
+         # Regrid from curvilinear to rectilinear using the bilinear method
+         rect_regrid_data = regridder.regridCurvToRect(undef_val, ESMP.ESMP_REGRIDMETHOD_BILINEAR)
+         # Print the differences between the expected and regrid data
+-        print ""
+-        print "analytic (expect) versus bilinear regridded (found) differences"
++        print ("")
++        print ("analytic (expect) versus bilinear regridded (found) differences")
+         printDiffs(rect_3d_center_lons,
+                    rect_3d_center_lats,
+                    rect_3d_center_depths,
+@@ -516,8 +516,8 @@ if __name__ == '__main__':
+         # Regrid from curvilinear to rectilinear using the patch method
+         rect_regrid_data = regridder.regridCurvToRect(undef_val, ESMP.ESMP_REGRIDMETHOD_PATCH)
+         # Print the differences between the expected and regrid data
+-        print ""
+-        print "analytic (expect) versus patch regridded (found) differences"
++        print ("")
++        print ("analytic (expect) versus patch regridded (found) differences")
+         printDiffs(rect_3d_center_lons,
+                    rect_3d_center_lats,
+                    rect_3d_center_depths,
+@@ -527,11 +527,11 @@ if __name__ == '__main__':
+ 
+     elif direction in ('r2cw', 'r2co'):
+ 
+-        print ""
++        print ("")
+         if direction == 'r2cw':
+-            print "Examining curvilinear with corners results from rectilinear"
++            print ("Examining curvilinear with corners results from rectilinear")
+         else:
+-            print "Examining curvilinear without corners results from rectilinear"
++            print ("Examining curvilinear without corners results from rectilinear")
+ 
+         # Create the rectilinear source field
+         regridder.assignRectField(rect_data)
+@@ -544,8 +544,8 @@ if __name__ == '__main__':
+             # Corners required for this method
+             curv_regrid_data = regridder.regridRectToCurv(undef_val, ESMP.ESMP_REGRIDMETHOD_CONSERVE)
+             # Print the differences between the expected and regrid data
+-            print ""
+-            print "analytic (expect) versus conserve regridded (found) differences"
++            print ("")
++            print ("analytic (expect) versus conserve regridded (found) differences")
+             printDiffs(curv_center_lons[:,:,1:-1],
+                        curv_center_lats[:,:,1:-1],
+                        curv_center_depths[:,:,1:-1],
+@@ -556,8 +556,8 @@ if __name__ == '__main__':
+         # Regrid from rectilinear to curvilinear using the bilinear method
+         curv_regrid_data = regridder.regridRectToCurv(undef_val, ESMP.ESMP_REGRIDMETHOD_BILINEAR)
+         # Print the differences between the expected and regrid data
+-        print ""
+-        print "analytic (expect) versus bilinear regridded (found) differences"
++        print ("")
++        print ("analytic (expect) versus bilinear regridded (found) differences")
+         printDiffs(curv_center_lons[:,:,1:-1],
+                    curv_center_lats[:,:,1:-1],
+                    curv_center_depths[:,:,1:-1],
+@@ -568,8 +568,8 @@ if __name__ == '__main__':
+         # Regrid from rectilinear to curvilinear using the patch method
+         curv_regrid_data = regridder.regridRectToCurv(undef_val, ESMP.ESMP_REGRIDMETHOD_PATCH)
+         # Print the differences between the expected and regrid data
+-        print ""
+-        print "analytic (expect) versus patch regridded (found) differences"
++        print ("")
++        print ("analytic (expect) versus patch regridded (found) differences")
+         printDiffs(curv_center_lons[:,:,1:-1],
+                    curv_center_lats[:,:,1:-1],
+                    curv_center_depths[:,:,1:-1],
+Index: pyferret-1.1.0/pyfermod/regrid/regrid3dtests.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/regrid/regrid3dtests.py
++++ pyferret-1.1.0/pyfermod/regrid/regrid3dtests.py
+@@ -3,11 +3,12 @@ Unit tests for CurvRect3DRegridder
+ 
+ @author: Karl Smith
+ '''
++from __future__ import print_function   #python3
+ import unittest
+ import numpy
+ import ESMP
+-from esmpcontrol import ESMPControl
+-from regrid3d import CurvRect3DRegridder
++from .esmpcontrol import ESMPControl
++from .regrid3d import CurvRect3DRegridder
+ 
+ 
+ class CurvRect3DRegridderTests(unittest.TestCase):
+@@ -347,10 +348,10 @@ class CurvRect3DRegridderTests(unittest.
+                 for k in xrange(margin, expect_data.shape[2] - margin):
+                     if numpy.abs(expect_data[i, j, k] - regrid_data[i, j, k]) > delta:
+                         mismatch_found = True
+-                        print "expect = %#6.4f, found = %#6.4f for lon = %5.1f, " \
++                        print ("expect = %#6.4f, found = %#6.4f for lon = %5.1f, " \
+                               "lat = %5.1f, lev = %5.1f" % (expect_data[i, j, k], 
+                               regrid_data[i, j, k], self.rect_center_lons[i], 
+-                              self.rect_center_lats[j], self.rect_center_levs[k])
++                              self.rect_center_lats[j], self.rect_center_levs[k]))
+         if mismatch_found:
+             self.fail("data mismatch found for bilinear regridding without flags")
+ 
+@@ -372,10 +373,10 @@ class CurvRect3DRegridderTests(unittest.
+                 for k in xrange(margin, expect_data.shape[2] - margin):
+                     if numpy.abs(expect_data[i, j, k] - regrid_data[i, j, k]) > delta:
+                         mismatch_found = True
+-                        print "expect = %#6.4f, found = %#6.4f for lon = %5.1f, " \
+-                              "lat = %5.1f, lev = %5.1f" % (expect_data[i, j, k], 
+-                              regrid_data[i, j, k], self.rect_center_lons[i], 
+-                              self.rect_center_lats[j], self.rect_center_levs[k])
++                        print ("expect = %#6.4f, found = %#6.4f for lon = %5.1f, " \
++                               "lat = %5.1f, lev = %5.1f" % (expect_data[i, j, k], 
++                                regrid_data[i, j, k], self.rect_center_lons[i], 
++                              self.rect_center_lats[j], self.rect_center_levs[k]))
+         if mismatch_found:
+             self.fail("data mismatch found for bilinear regridding with flags")
+ 
+@@ -408,10 +409,10 @@ class CurvRect3DRegridderTests(unittest.
+                 for k in xrange(margin, expect_data.shape[2] - margin):
+                     if numpy.abs(expect_data[i, j, k] - regrid_data[i, j, k]) > delta:
+                         mismatch_found = True
+-                        print "expect = %#6.4f, found = %#6.4f for lon = %5.1f, " \
++                        print ("expect = %#6.4f, found = %#6.4f for lon = %5.1f, " \
+                               "lat = %5.1f, lev = %5.1f" % (expect_data[i, j, k], 
+                               regrid_data[i, j, k], self.rect_center_lons[i], 
+-                              self.rect_center_lats[j], self.rect_center_levs[k])
++                              self.rect_center_lats[j], self.rect_center_levs[k]))
+         if mismatch_found:
+             self.fail("data mismatch found for conservative regridding")
+ 
+@@ -441,10 +442,10 @@ class CurvRect3DRegridderTests(unittest.
+                 for k in xrange(margin, expect_data.shape[2] - margin):
+                     if numpy.abs(expect_data[i, j, k] - regrid_data[i, j, k]) > delta:
+                         mismatch_found = True
+-                        print "expect = %#6.4f, found = %#6.4f for lon = %5.1f, " \
++                        print ("expect = %#6.4f, found = %#6.4f for lon = %5.1f, " \
+                               "lat = %5.1f, lev = %5.1f" % (expect_data[i, j, k], 
+                               regrid_data[i, j, k], self.rect_center_lons[i], 
+-                              self.rect_center_lats[j], self.rect_center_levs[k])
++                              self.rect_center_lats[j], self.rect_center_levs[k]))
+         if mismatch_found:
+             self.fail("data mismatch found for patch regridding")
+ 
+@@ -474,10 +475,10 @@ class CurvRect3DRegridderTests(unittest.
+                 for k in xrange(margin, expect_data.shape[2] - margin):
+                     if numpy.abs(expect_data[i, j, k] - regrid_data[i, j, k]) > delta:
+                         mismatch_found = True
+-                        print "expect = %#6.4f, found = %#6.4f for lon = %5.1f, " \
++                        print ("expect = %#6.4f, found = %#6.4f for lon = %5.1f, " \
+                               "lat = %5.1f, lev = %5.1f" % (expect_data[i, j, k], 
+                               regrid_data[i, j, k], self.curv_center_lons[i][j][k], 
+-                              self.curv_center_lats[i][j][k], self.curv_center_levs[i][j][k])
++                              self.curv_center_lats[i][j][k], self.curv_center_levs[i][j][k]))
+         if mismatch_found:
+             self.fail("data mismatch found for bilinear regridding without flags")
+ 
+@@ -499,10 +500,10 @@ class CurvRect3DRegridderTests(unittest.
+                 for k in xrange(margin, expect_data.shape[2] - margin):
+                     if numpy.abs(expect_data[i, j, k] - regrid_data[i, j, k]) > delta:
+                         mismatch_found = True
+-                        print "expect = %#6.4f, found = %#6.4f for lon = %5.1f, " \
++                        print ("expect = %#6.4f, found = %#6.4f for lon = %5.1f, " \
+                               "lat = %5.1f, lev = %5.1f" % (expect_data[i, j, k], 
+                               regrid_data[i, j, k], self.curv_center_lons[i][j][k], 
+-                              self.curv_center_lats[i][j][k], self.curv_center_levs[i][j][k])
++                              self.curv_center_lats[i][j][k], self.curv_center_levs[i][j][k]))
+         if mismatch_found:
+             self.fail("data mismatch found for bilinear regridding with flags")
+ 
+@@ -535,10 +536,10 @@ class CurvRect3DRegridderTests(unittest.
+                 for k in xrange(margin, expect_data.shape[2] - margin):
+                     if numpy.abs(expect_data[i, j, k] - regrid_data[i, j, k]) > delta:
+                         mismatch_found = True
+-                        print "expect = %#6.4f, found = %#6.4f for lon = %5.1f, " \
++                        print ("expect = %#6.4f, found = %#6.4f for lon = %5.1f, " \
+                               "lat = %5.1f, lev = %5.1f" % (expect_data[i, j, k], 
+                               regrid_data[i, j, k], self.curv_center_lons[i][j][k], 
+-                              self.curv_center_lats[i][j][k], self.curv_center_levs[i][j][k])
++                              self.curv_center_lats[i][j][k], self.curv_center_levs[i][j][k]))
+         if mismatch_found:
+             self.fail("data mismatch found for conservative regridding")
+ 
+@@ -570,10 +571,10 @@ class CurvRect3DRegridderTests(unittest.
+                 for k in xrange(margin, expect_data.shape[2] - margin):
+                     if numpy.abs(expect_data[i, j, k] - regrid_data[i, j, k]) > delta:
+                         mismatch_found = True
+-                        print "expect = %#6.4f, found = %#6.4f for lon = %5.1f, " \
++                        print ("expect = %#6.4f, found = %#6.4f for lon = %5.1f, " \
+                               "lat = %5.1f, lev = %5.1f" % (expect_data[i, j, k], 
+                               regrid_data[i, j, k], self.curv_center_lons[i][j][k], 
+-                              self.curv_center_lats[i][j][k], self.curv_center_levs[i][j][k])
++                              self.curv_center_lats[i][j][k], self.curv_center_levs[i][j][k]))
+         if mismatch_found:
+             self.fail("data mismatch found for patch regridding")
+ 
+Index: pyferret-1.1.0/pyfermod/regrid/regridtests.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/regrid/regridtests.py
++++ pyferret-1.1.0/pyfermod/regrid/regridtests.py
+@@ -5,7 +5,8 @@ Tests of the regrid.__init__ functions
+ '''
+ import unittest
+ import numpy
+-import __init__ as regrid
++from . import __init__ as regrid
++from past.builtins import xrange
+ 
+ class RegridTests(unittest.TestCase):
+     '''
+Index: pyferret-1.1.0/pyfermod/eofanal/eofdatapiece.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/eofanal/eofdatapiece.py
++++ pyferret-1.1.0/pyfermod/eofanal/eofdatapiece.py
+@@ -6,7 +6,8 @@ Time Amplitude Funtion (TAF)
+ 
+ @author: Karl Smith
+ '''
+-
++from __future__ import print_function
++from past.builtins import xrange
+ import numpy
+ import pyferret
+ import pyferret.eofanal as eofanal
+@@ -145,12 +146,12 @@ if __name__ == "__main__":
+     tdata = -5.0 * numpy.cos((tdata - 2190.0) * numpy.pi / 4380.0)
+     yztdata += numpy.outer(yzdata, tdata).reshape((1, 17, 6, 25, 1, 1))
+     yztdata += 6.0
+-    print "time series at Y = 0.0, Z = 0.0"
+-    print str(yztdata[0, 8, 0, :, 0, 0])
+-    print "depth series at Y = 0.0, T = start of April"
+-    print str(yztdata[0, 8, :, 6, 0, 0])
+-    print "latitude series at Z = 0.0, T = start of April"
+-    print str(yztdata[0, :, 0, 6, 0, 0])
++    print ("time series at Y = 0.0, Z = 0.0")
++    print (str(yztdata[0, 8, 0, :, 0, 0]))
++    print ("depth series at Y = 0.0, T = start of April")
++    print (str(yztdata[0, 8, :, 6, 0, 0]))
++    print ("latitude series at Z = 0.0, T = start of April")
++    print (str(yztdata[0, :, 0, 6, 0, 0]))
+     # Create the result array and the other ferret_compute arguments
+     result = numpy.zeros((1, 17, 6, 25, 17*6, 1))
+     resbdf = numpy.array([1.0E20])
+@@ -163,17 +164,17 @@ if __name__ == "__main__":
+     for m in xrange(17 * 6):
+         if numpy.allclose(result[:, :, :, :, m, 0], resbdf):
+             break;
+-        print "EOF-TAF piece %d" % m
+-        print "    time series at Y = 0.0, Z = 0.0"
+-        print "    " + str(result[0, 8, 0, :, m, 0])
+-        print "    depth series at Y = 0.0, T = start of April"
+-        print "    " + str(result[0, 8, :, 6, m, 0])
+-        print "    latitude series at Z = 0.0, T = start of April"
+-        print "    " + str(result[0, :, 0, 6, m, 0])
++        print ("EOF-TAF piece %d" % m)
++        print ("    time series at Y = 0.0, Z = 0.0")
++        print ("    " + str(result[0, 8, 0, :, m, 0]))
++        print ("    depth series at Y = 0.0, T = start of April")
++        print ("    " + str(result[0, 8, :, 6, m, 0]))
++        print ("    latitude series at Z = 0.0, T = start of April")
++        print ("    " + str(result[0, :, 0, 6, m, 0]))
+         lastone = m
+         piecesum += result[:, :, :, :, m, 0]
+     if numpy.allclose(piecesum, yztdata[:, :, :, :, 0, 0]):
+-        print "sum of %d pieces all close to input data" % lastone
++        print ("sum of %d pieces all close to input data" % lastone)
+     else:
+-        print "sum %d pieces different from input data" % lastone
++        print ("sum %d pieces different from input data" % lastone)
+ 
+Index: pyferret-1.1.0/pyfermod/eofanal/eofdatasum.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/eofanal/eofdatasum.py
++++ pyferret-1.1.0/pyfermod/eofanal/eofdatasum.py
+@@ -8,7 +8,8 @@ Functions (EOFs) and their corresponding
+ @author: Karl Smith
+ '''
+ 
+-
++from __future__ import print_function
++from past.builtins import xrange
+ import numpy
+ import pyferret
+ import pyferret.eofanal as eofanal
+@@ -146,12 +147,12 @@ if __name__ == "__main__":
+     tdata = -5.0 * numpy.cos((tdata - 2190.0) * numpy.pi / 4380.0)
+     yztdata += numpy.outer(yzdata, tdata).reshape((1, 17, 6, 25, 1, 1))
+     yztdata += 6.0
+-    print "time series at Y = 0.0, Z = 0.0"
+-    print str(yztdata[0, 8, 0, :, 0, 0])
+-    print "depth series at Y = 0.0, T = start of April"
+-    print str(yztdata[0, 8, :, 6, 0, 0])
+-    print "latitude series at Z = 0.0, T = start of April"
+-    print str(yztdata[0, :, 0, 6, 0, 0])
++    print ("time series at Y = 0.0, Z = 0.0")
++    print (str(yztdata[0, 8, 0, :, 0, 0]))
++    print ("depth series at Y = 0.0, T = start of April")
++    print (str(yztdata[0, 8, :, 6, 0, 0]))
++    print ("latitude series at Z = 0.0, T = start of April")
++    print (str(yztdata[0, :, 0, 6, 0, 0]))
+     # Create the result array and the other ferret_compute arguments
+     result = numpy.zeros((1, 17, 6, 25, 17*6, 1))
+     resbdf = numpy.array([1.0E20])
+@@ -163,17 +164,17 @@ if __name__ == "__main__":
+     for m in xrange(17 * 6):
+         if numpy.allclose(result[:, :, :, :, m, 0], resbdf):
+             break;
+-        print "EOF-TAF sum %d" % m
+-        print "    time series at Y = 0.0, Z = 0.0"
+-        print "    " + str(result[0, 8, 0, :, m, 0])
+-        print "    depth series at Y = 0.0, T = start of April"
+-        print "    " + str(result[0, 8, :, 6, m, 0])
+-        print "    latitude series at Z = 0.0, T = start of April"
+-        print "    " + str(result[0, :, 0, 6, m, 0])
++        print ("EOF-TAF sum %d" % m)
++        print ("    time series at Y = 0.0, Z = 0.0")
++        print ("    " + str(result[0, 8, 0, :, m, 0]))
++        print ("    depth series at Y = 0.0, T = start of April")
++        print ("    " + str(result[0, 8, :, 6, m, 0]))
++        print ("    latitude series at Z = 0.0, T = start of April")
++        print ("    " + str(result[0, :, 0, 6, m, 0]))
+         lastone = m
+     if numpy.allclose(result[:, :, :, :, lastone, 0], 
+                      yztdata[:, :, :, :, 0, 0]):
+-        print "sum %d all close to input data" % lastone
++        print ("sum %d all close to input data" % lastone)
+     else:
+-        print "sum %d different from input data" % lastone
++        print ("sum %d different from input data" % lastone)
+ 
+Index: pyferret-1.1.0/pyfermod/eofanal/__init__.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/eofanal/__init__.py
++++ pyferret-1.1.0/pyfermod/eofanal/__init__.py
+@@ -6,5 +6,5 @@ especially for Python external functions
+ '''
+ 
+ # Import classes given in modules in this package so they are all seen here.
+-from eofanalysis import InvalidStateError, EOFAnalysis
++from .eofanalysis import InvalidStateError, EOFAnalysis
+ 
+Index: pyferret-1.1.0/pyfermod/fershp/__init__.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/fershp/__init__.py
++++ pyferret-1.1.0/pyfermod/fershp/__init__.py
+@@ -2,6 +2,7 @@
+ Helper functions for pyferret shapefile external functions.
+ """
+ 
++from __future__ import print_function
+ import numpy
+ import shapefile
+ import os
+@@ -33,7 +34,7 @@ def createprjfile(shapefile_mapprj, shap
+         prj_descript = pyferret.fershp.mapprj.name_to_descript(shapefile_mapprj)
+     (sfname, ext) = os.path.splitext(shapefile_name)
+     prjfile = file("%s.prj" % sfname, "w")
+-    print >>prjfile, prj_descript
++    print (prj_descript, file=prjfile)
+     prjfile.close()
+ 
+ 
+@@ -241,7 +242,7 @@ if __name__ == "__main__":
+                          "    expect: %s\n" \
+                          "    found:  %s" % (wgs84upsnorth_descript, descript))
+     del prjfile, datalines, descript
+-    print "createprjfile: SUCCESS"
++    print ("createprjfile: SUCCESS")
+ 
+     # Test quadxycentroids
+     xvals = ( ( 0, 1 ), ( 3, 4 ) )
+@@ -268,7 +269,7 @@ if __name__ == "__main__":
+         raise ValueError("Centroid Y values: expected %s; found %s" % \
+                           (str(expecty), str(centy)))
+     del xvals, yvals, expectx, expecty, centx, centy
+-    print "quadxycentroids: SUCCESS"
++    print ("quadxycentroids: SUCCESS")
+ 
+     # Test quadxycenters
+     xvals = ( ( 0, 1 ), ( 3, 4 ) )
+@@ -295,7 +296,7 @@ if __name__ == "__main__":
+         raise ValueError("Centroid Y values: expected %s; found %s" % \
+                           (str(expecty), str(centy)))
+     del xvals, yvals, expectx, expecty, centx, centy
+-    print "quadxycenters: SUCCESS"
++    print ("quadxycenters: SUCCESS")
+ 
+     # Test addquadxyvalues
+     coords = [ [0.0, 0.0], [1.0, 0.0], [1.0, -1.0], [2.0, 1.0] ]
+@@ -337,5 +338,5 @@ if __name__ == "__main__":
+     os.remove("%s.shx" % shapefilename)
+     os.remove("%s.prj" % shapefilename)
+ 
+-    print "addquadxyvalues: SUCCESS"
++    print ("addquadxyvalues: SUCCESS")
+ 
+Index: pyferret-1.1.0/pyfermod/fershp/mapprj.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/fershp/mapprj.py
++++ pyferret-1.1.0/pyfermod/fershp/mapprj.py
+@@ -2,6 +2,8 @@
+ Map projection file utility functions
+ """
+ 
++from __future__ import print_function
++
+ def name_to_descript(mapprj_name):
+     """
+     Returns the map projection file contents of the given common name
+@@ -2709,4 +2711,4 @@ if __name__ == "__main__":
+     if num_descripts != 1337:
+         raise ValueError("Number of entries in _DESCRIPT_DICT: expect: 1337, found: %d" % num_descripts)
+ 
+-    print "mapprj: SUCCESS"
++    print ("mapprj: SUCCESS")
+Index: pyferret-1.1.0/pyfermod/fershp/shapefile_readxy.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/fershp/shapefile_readxy.py
++++ pyferret-1.1.0/pyfermod/fershp/shapefile_readxy.py
+@@ -4,6 +4,8 @@ coordinates from the points in the indic
+ The missing value separates coordinates between shapes.
+ """
+ 
++from __future__ import print_function
++from past.builtins import xrange
+ import numpy
+ import pyferret
+ import shapefile
+@@ -86,9 +88,9 @@ if __name__ == "__main__":
+     inpbdfs = numpy.array([-8888.0, -7777.0], dtype=numpy.float64)
+     maxpts = 3200 * 2400
+     result = -6666.0 * numpy.ones((maxpts,2,1,1,1,1), dtype=numpy.float64, order='F')
+-    print "ferret_compute start: time = %s" % time.asctime()
++    print ("ferret_compute start: time = %s" % time.asctime())
+     ferret_compute(0, result, resbdf, ("tl_2010_us_county10", maxpts, ), inpbdfs)
+-    print "ferret_compute done; time = %s" % time.asctime()
++    print ("ferret_compute done; time = %s" % time.asctime())
+     good_x = numpy.logical_and((-180.0 <= result[:,0,0,0,0,0]), (result[:,0,0,0,0,0] <= -65.0))
+     good_x = numpy.logical_or(good_x,
+                  numpy.logical_and((172.0 <= result[:,0,0,0,0,0]), (result[:,0,0,0,0,0] <= 180.0)))
+@@ -110,7 +112,7 @@ if __name__ == "__main__":
+             if count == 0:
+                 at_end = True
+             else:
+-                # print "Count[%d] = %d" % (shape_num, count)
++                # print ("Count[%d] = %d" % (shape_num, count))
+                 shape_num += 1
+                 total += count + 1
+                 count = 0
+@@ -119,8 +121,8 @@ if __name__ == "__main__":
+         else:
+             count += 1
+     total += count
+-    print "total (including missing-value separators) = %d" % total
+-    print "out of a maximum of %d" %  result.shape[0]
+-    print "number of shapes = %d" % shape_num
+-    print "shapefile_readxy: SUCCESS"
++    print ("total (including missing-value separators) = %d" % total)
++    print ("out of a maximum of %d" %  result.shape[0])
++    print ("number of shapes = %d" % shape_num)
++    print ("shapefile_readxy: SUCCESS")
+ 
+Index: pyferret-1.1.0/pyfermod/fershp/shapefile_readxyval.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/fershp/shapefile_readxyval.py
++++ pyferret-1.1.0/pyfermod/fershp/shapefile_readxyval.py
+@@ -4,6 +4,8 @@ latitude), as well as a value for shapes
+ The missing value separates coordinates between shapes.
+ """
+ 
++from __future__ import print_function
++from past.builtins import xrange
+ import numpy
+ import pyferret
+ import shapefile
+@@ -76,10 +78,10 @@ def ferret_compute(efid, result, resbdf,
+         if sf.fields[k][0] == fieldname:
+             break
+     else:
+-        print "Known fields (name, type, size, precision):"
++        print ("Known fields (name, type, size, precision):")
+         for field in sf.fields:
+             if field[0] != 'DeletionFlag':
+-                print "    %s" % str(field)
++                print ("    %s" % str(field))
+         raise ValueError("No field with the name '%s' found" % fieldname)
+     if sf.fields[0][0] == 'DeletionFlag':
+         field_index = k - 1
+@@ -126,10 +128,10 @@ if __name__ == "__main__":
+     inpbdfs = numpy.array([-8888.0, -7777.0], dtype=numpy.float64)
+     maxpts = 3200 * 2400
+     result = -6666.0 * numpy.ones((maxpts,3,1,1,1,1), dtype=numpy.float64, order='F')
+-    print "ferret_compute start: time = %s" % time.asctime()
++    print ("ferret_compute start: time = %s" % time.asctime())
+     # INTPTLAT10 == latitude of an internal point in each county
+     ferret_compute(0, result, resbdf, ("tl_2010_us_county10", "INTPTLAT10", maxpts, ), inpbdfs)
+-    print "ferret_compute done; time = %s" % time.asctime()
++    print ("ferret_compute done; time = %s" % time.asctime())
+     good_x = numpy.logical_and((-180.0 <= result[:,0,0,0,0,0]), (result[:,0,0,0,0,0] <= -65.0))
+     good_x = numpy.logical_or(good_x,
+                  numpy.logical_and((172.0 <= result[:,0,0,0,0,0]), (result[:,0,0,0,0,0] <= 180.0)))
+@@ -151,7 +153,7 @@ if __name__ == "__main__":
+             if count == 0:
+                 at_end = True
+             else:
+-                # print "Count[%d] = %d" % (shape_num, count)
++                # print ("Count[%d] = %d" % (shape_num, count))
+                 shape_num += 1
+                 total += count + 1
+                 count = 0
+@@ -167,5 +169,5 @@ if __name__ == "__main__":
+     num_good = len(result[:,2,0,0,0,0][good_val])
+     if num_good != shape_num:
+         raise ValueError("number of values: expected %d, found %d" % (shape_num, num_good))
+-    print "shapefile_readxyval: SUCCESS"
++    print ("shapefile_readxyval: SUCCESS")
+ 
+Index: pyferret-1.1.0/pyfermod/fershp/shapefile_readxyz.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/fershp/shapefile_readxyz.py
++++ pyferret-1.1.0/pyfermod/fershp/shapefile_readxyz.py
+@@ -3,7 +3,7 @@ Returns the X, Y, and Z (presumably long
+ coordinates from the points in the indicated shapefile.
+ The missing value separates coordinates between shapes.
+ """
+-
++from __future__ import print_function
+ import numpy
+ import pyferret
+ import shapefile
+@@ -82,6 +82,6 @@ if __name__ == "__main__":
+     info = ferret_init(0)
+ 
+     # this is tested under shapefile_writexyzval
+-    print "shapefile_readxyz: SUCCESS (limited)"
+-    print "    run shapefile_writexyzval for full test"
++    print ("shapefile_readxyz: SUCCESS (limited)")
++    print ("    run shapefile_writexyzval for full test")
+ 
+Index: pyferret-1.1.0/pyfermod/fershp/shapefile_readxyzval.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/fershp/shapefile_readxyzval.py
++++ pyferret-1.1.0/pyfermod/fershp/shapefile_readxyzval.py
+@@ -4,7 +4,8 @@ latitude, and level), as well as a value
+ a shapefile.  The missing value separates coordinates
+ between shapes.
+ """
+-
++from __future__ import print_function
++from past.builtins import xrange
+ import numpy
+ import pyferret
+ import shapefile
+@@ -78,10 +79,10 @@ def ferret_compute(efid, result, resbdf,
+         if sf.fields[k][0] == fieldname:
+             break
+     else:
+-        print "Known fields (name, type, size, precision):"
++        print ("Known fields (name, type, size, precision):")
+         for field in sf.fields:
+             if field[0] != 'DeletionFlag':
+-                print "    %s" % str(field)
++                print ("    %s" % str(field))
+         raise ValueError("No field with the name '%s' found" % fieldname)
+     if sf.fields[0][0] == 'DeletionFlag':
+         field_index = k - 1
+@@ -124,6 +125,6 @@ if __name__ == "__main__":
+     info = ferret_init(0)
+ 
+     # this is tested under shapefile_writexyzval
+-    print "shapefile_readxyzval: SUCCESS (limited)"
+-    print "    run shapefile_writexyzval for full test"
++    print ("shapefile_readxyzval: SUCCESS (limited)")
++    print ("    run shapefile_writexyzval for full test")
+ 
+Index: pyferret-1.1.0/pyfermod/fershp/shapefile_writeval.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/fershp/shapefile_writeval.py
++++ pyferret-1.1.0/pyfermod/fershp/shapefile_writeval.py
+@@ -5,7 +5,8 @@ this axis is used).  The vertices of the
+ of the bounding boxes of the X and Y axes of the given value array.  The
+ value(s) associated with each shape comes from the value array.
+ """
+-
++from __future__ import print_function
++from past.builtins import xrange
+ import pyferret
+ import pyferret.fershp
+ import shapefile
+@@ -145,4 +146,4 @@ if __name__ == "__main__":
+     # Testing ferret_compute difficult due to call
+     # to get_axis_box_limits and get_axis_coordinates
+ 
+-    print "shapefile_writeval: SUCCESS (limited)"
++    print ("shapefile_writeval: SUCCESS (limited)")
+Index: pyferret-1.1.0/pyfermod/fershp/shapefile_writexyval.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/fershp/shapefile_writexyval.py
++++ pyferret-1.1.0/pyfermod/fershp/shapefile_writexyval.py
+@@ -9,7 +9,8 @@ element of the value for the previously
+ Quadrilaterals associated with missing values are omitted from
+ the shapefile.
+ """
+-
++from __future__ import print_function
++from past.builtins import xrange
+ import shapefile
+ import pyferret
+ import pyferret.fershp
+@@ -288,7 +289,7 @@ if __name__ == "__main__":
+                sortedvals[2 * numvals // 5],
+                sortedvals[3 * numvals // 5],
+                sortedvals[4 * numvals // 5], ]
+-    print str( [ sortedvals[0] ] + limits + [ sortedvals[-1] ] )
++    print (str( [ sortedvals[0] ] + limits + [ sortedvals[-1] ] ))
+ 
+     partvals = vals.copy()
+     partvals[ partvals >= limits[0] ] = inpbdfs[3]
+@@ -323,5 +324,5 @@ if __name__ == "__main__":
+                                        fieldname, ""), inpbdfs)
+     """
+ 
+-    print "shapefile_writexyval: SUCCESS"
++    print ("shapefile_writexyval: SUCCESS")
+ 
+Index: pyferret-1.1.0/pyfermod/fershp/shapefile_writexyzval.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/fershp/shapefile_writexyzval.py
++++ pyferret-1.1.0/pyfermod/fershp/shapefile_writexyzval.py
+@@ -10,6 +10,8 @@ mentioned quadrilateral.  Quadrilaterals
+ values are omitted from the shapefile.
+ """
+ 
++from __future__ import print_function
++from past.builtins import xrange
+ import shapefile
+ import pyferret
+ import pyferret.fershp
+@@ -310,12 +312,12 @@ if __name__ == "__main__":
+                          "    expect: %s\n" \
+                          "    found:  %s" % (wgs84_descript, descript))
+ 
+-    print "shapefile_writexyzval: SUCCESS"
++    print ("shapefile_writexyzval: SUCCESS")
+ 
+     # Check the result for calling ferret_compute of shapefile_readxyz
+     # in this directory.  This assumes the ordering of the shapes does
+     # not change, which appears to be the case but is not required.
+-    import shapefile_readxyz
++    from . import shapefile_readxyz
+     maxpts = len(expcurvals[0])
+     result = -11111.0 * numpy.ones((maxpts, 3, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+     shapefile_readxyz.ferret_compute(0, result, resbdf, (shapefilename, maxpts), inpbdfs[:2])
+@@ -329,7 +331,7 @@ if __name__ == "__main__":
+         raise ValueError("Zs from shapefile_readxyz:\n   expected\n%s\n   found\n%s" % \
+                          (str(expcurvals[2]), str(result[:,2,0,0,0,0])))
+ 
+-    print "shapefile_readxyz: SUCCESS"
++    print ("shapefile_readxyz: SUCCESS")
+ 
+     # Check the result for calling ferret_compute of shapefile_readxyzval
+     # in this directory.  This assumes the ordering of the shapes does
+@@ -354,7 +356,7 @@ if __name__ == "__main__":
+         raise ValueError("Extra values from shapefile_readxyzval: expected all %s\n   found\n%s" % \
+                          (str(float(resbdf[0])), str(result[numvals:,3,0,0,0,0])))
+ 
+-    print "shapefile_readxyzval: SUCCESS"
++    print ("shapefile_readxyzval: SUCCESS")
+ 
+     os.remove("%s.dbf" % shapefilename)
+     os.remove("%s.shp" % shapefilename)
+Index: pyferret-1.1.0/pyfermod/graphbind/__init__.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/graphbind/__init__.py
++++ pyferret-1.1.0/pyfermod/graphbind/__init__.py
+@@ -10,7 +10,7 @@ instance is returned.
+ Other methods of the bindings instance are called directly to perform
+ graphics operations on this Window.
+ '''
+-
++from __future__ import print_function
+ from abstractpyferretbindings import AbstractPyFerretBindings
+ 
+ __pyferret_bindings_classes = { }
+@@ -108,4 +108,4 @@ if __name__ == "__main__":
+        (known_engines[0] != TestBindings.engine_name):
+         raise RuntimeError("Unexpected tuple of known engines: %s" % \
+                            str(known_engines))
+-    print "Success"
++    print ("Success")
+Index: pyferret-1.1.0/pyfermod/stats/__init__.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/stats/__init__.py
++++ pyferret-1.1.0/pyfermod/stats/__init__.py
+@@ -1,6 +1,8 @@
+ """
+ Helper functions for pyferret stats external functions.
+ """
++from __future__ import print_function
++from past.builtins import xrange
+ import math
+ import numpy
+ try:
+@@ -883,7 +885,7 @@ if __name__ == "__main__":
+     distname = "beta"
+     descript = getdistparams(distname, None)
+     if len(descript) != 2:
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("number of parameter description pairs for %s: expected 2; found %d" % \
+                          (distname, len(descript)))
+     del descript
+@@ -902,7 +904,7 @@ if __name__ == "__main__":
+                           (alpha * beta * (alpha + beta + 2.0) * (alpha + beta + 3.0)),
+                     )
+     if not numpy.allclose(foundstats, expectedstats):
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("(mean, var, skew, kurtosis) of %s(%.1f, %.1f): expected %s; found %s" % \
+                           (distname, distparms[0], distparms[1], str(expectedstats), str(foundstats)))
+     del alpha, beta, foundstats, expectedstats
+@@ -912,25 +914,25 @@ if __name__ == "__main__":
+     distparms.append(1.0)
+     newparms = getdistparams(distname, getdistparams(distname, distparms, tostd=False), tostd=True)
+     if not numpy.allclose(newparms, distparms):
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("conversion of full %s params to scipy then back to std changed" % distname)
+     # sample = distf.rvs(25000)
+     # fitparms = getfitparams(sample, distname, distparms)
+-    # print "%s fitparams: %s" % (distname, str(fitparms))
++    # print ("%s fitparams: %s" % (distname, str(fitparms)))
+     # if not numpy.allclose(fitparms, distparms, rtol=0.1, atol=0.2):
+-    #     print "%s: FAIL" % distname
++    #     print ("%s: FAIL" % distname)
+     #     raise ValueError("fitparams of %s: expected %s; found %s" % \
+     #                                   (distname, str(distparms), str(fitparms)))
+     del distparms, distf, newparms # , sample, fitparms
+ 
+-    print "%s: PASS" % distname
++    print ("%s: PASS" % distname)
+ 
+ 
+     # Binomial distribution
+     distname = "binom"
+     descript = getdistparams(distname, None)
+     if len(descript) != 2:
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("number of parameter description pairs for %s: expected 2; found %d:" % \
+                          (distname, len(descript)))
+     del descript
+@@ -946,26 +948,26 @@ if __name__ == "__main__":
+                       (1.0 - 6.0 * prob * (1.0 - prob)) / (ntrials * prob * (1.0 - prob)),
+                     )
+     if not numpy.allclose(foundstats, expectedstats):
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("(mean, var, skew, kurtosis) of %s(%.1f, %.1f): expected %s; found %s" % \
+                           (distname, distparms[0], distparms[1], str(expectedstats), str(foundstats)))
+     del ntrials, prob, foundstats, expectedstats
+ 
+     newparms = getdistparams(distname, getdistparams(distname, distparms, tostd=False), tostd=True)
+     if not numpy.allclose(newparms, distparms):
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("conversion of full %s params to scipy then back to std changed" % distname)
+     # no binom.fit function
+     del distparms, distf, newparms
+ 
+-    print "%s: PASS" % distname
++    print ("%s: PASS" % distname)
+ 
+ 
+     # Cauchy distribution
+     distname = "cauchy"
+     descript = getdistparams(distname, None)
+     if len(descript) != 2:
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("number of parameter description pairs for %s: expected 2; found %d:" % \
+                          (distname, len(descript)))
+     del descript
+@@ -979,32 +981,32 @@ if __name__ == "__main__":
+     foundpdfs = distf.pdf(xvals)
+     expectedpdfs = (gamma / numpy.pi) / ((xvals - m)**2 + gamma**2)
+     if not numpy.allclose(foundpdfs, expectedpdfs):
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("pdfs(0.0:10.1:0.5) of %s(%#.1f,%#.1f): expected %s; found %s" % \
+                           (distname, distparms[0], distparms[1], str(expectedpdfs), str(foundpdfs)))
+     del m, gamma, xvals, foundpdfs, expectedpdfs
+ 
+     newparms = getdistparams(distname, getdistparams(distname, distparms, tostd=False), tostd=True)
+     if not numpy.allclose(newparms, distparms):
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("conversion of full %s params to scipy then back to std changed" % distname)
+     # sample = distf.rvs(25000)
+     # fitparms = getfitparams(sample, distname, distparms)
+-    # print "%s fitparams: %s" % (distname, str(fitparms))
++    # print ("%s fitparams: %s" % (distname, str(fitparms)))
+     # if not numpy.allclose(fitparms, distparms, rtol=0.1, atol=0.2):
+-    #     print "%s: FAIL" % distname
++    #     print ("%s: FAIL" % distname)
+     #     raise ValueError("fitparams of %s: expected %s; found %s" % \
+     #                                   (distname, str(distparms), str(fitparms)))
+     del distparms, distf, newparms # , sample, fitparms
+ 
+-    print "%s: PASS" % distname
++    print ("%s: PASS" % distname)
+ 
+ 
+     # Chi distribution
+     distname = "chi"
+     descript = getdistparams(distname, None)
+     if len(descript) != 1:
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("number of parameter description pairs for %s: expected 1; found %d:" % \
+                          (distname, len(descript)))
+     del descript
+@@ -1024,7 +1026,7 @@ if __name__ == "__main__":
+                       2.0 * (1.0 - mean * stdev * skew - variance) / variance,
+                     )
+     if not numpy.allclose(foundstats, expectedstats):
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("(mean, var, skew, kurtosis) of %s(%d.0): expected %s; found %s" % \
+                           (distname, distparms[0], str(expectedstats), str(foundstats)))
+     del degfree, foundstats, mean, variance, stdev, skew, expectedstats
+@@ -1034,25 +1036,25 @@ if __name__ == "__main__":
+     distparms.append(1.0)
+     newparms = getdistparams(distname, getdistparams(distname, distparms, tostd=False), tostd=True)
+     if not numpy.allclose(newparms, distparms):
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("conversion of full %s params to scipy then back to std changed" % distname)
+     # sample = distf.rvs(25000)
+     # fitparms = getfitparams(sample, distname, distparms)
+-    # print "%s fitparams: %s" % (distname, str(fitparms))
++    # print ("%s fitparams: %s" % (distname, str(fitparms)))
+     # if not numpy.allclose(fitparms, distparms, rtol=0.4, atol=0.4):
+-    #     print "%s: FAIL" % distname
++    #     print ("%s: FAIL" % distname)
+     #     raise ValueError("fitparams of %s: expected %s; found %s" % \
+     #                                   (distname, str(distparms), str(fitparms)))
+     del distparms, distf, newparms # , sample, fitparms
+ 
+-    print "%s: PASS" % distname
++    print ("%s: PASS" % distname)
+ 
+ 
+     # Chi-squared distribution
+     distname = "chi2"
+     descript = getdistparams(distname, None)
+     if len(descript) != 1:
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("number of parameter description pairs for %s: expected 1; found %d:" % \
+                          (distname, len(descript)))
+     del descript
+@@ -1068,7 +1070,7 @@ if __name__ == "__main__":
+                       12.0 / degfree,
+                     )
+     if not numpy.allclose(foundstats, expectedstats):
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("(mean, var, skew, kurtosis) of %s(%s): expected %s; found %s" % \
+                           (distname, distparms[0], str(expectedstats), str(foundstats)))
+     del degfreestr, foundstats, expectedstats
+@@ -1077,25 +1079,25 @@ if __name__ == "__main__":
+     distparms = [ degfree, 0.0, 1.0 ]
+     newparms = getdistparams(distname, getdistparams(distname, distparms, tostd=False), tostd=True)
+     if not numpy.allclose(newparms, distparms):
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("conversion of full %s params to scipy then back to std changed" % distname)
+     # sample = distf.rvs(25000)
+     # fitparms = getfitparams(sample, distname, distparms)
+-    # print "%s fitparams: %s" % (distname, str(fitparms))
++    # print ("%s fitparams: %s" % (distname, str(fitparms)))
+     # if not numpy.allclose(fitparms, distparms, rtol=0.4, atol=0.4):
+-    #     print "%s: FAIL" % distname
++    #     print ("%s: FAIL" % distname)
+     #     raise ValueError("fitparams of %s: expected %s; found %s" % \
+     #                                   (distname, str(distparms), str(fitparms)))
+     del degfree, distparms, distf, newparms # , sample, fitparms
+ 
+-    print "%s: PASS" % distname
++    print ("%s: PASS" % distname)
+ 
+ 
+     # Exponential distribution
+     distname = "expon"
+     descript = getdistparams(distname, None)
+     if len(descript) != 1:
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("number of parameter description pairs for %s: expected 1; found %d:" % \
+                          (distname, len(descript)))
+     del descript
+@@ -1106,7 +1108,7 @@ if __name__ == "__main__":
+     foundstats = distf.stats("mvsk")
+     expectedstats = ( 1.0 / lambdaflt, 1.0 / lambdaflt**2, 2.0, 6.0 )
+     if not numpy.allclose(foundstats, expectedstats):
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("(mean, var, skew, kurtosis) of %s(%.1f): expected %s; found %s" % \
+                           (distname, distparms[0], str(expectedstats), str(foundstats)))
+     del lambdaflt, foundstats, expectedstats
+@@ -1115,25 +1117,25 @@ if __name__ == "__main__":
+     distparms.append(0.0)
+     newparms = getdistparams(distname, getdistparams(distname, distparms, tostd=False), tostd=True)
+     if not numpy.allclose(newparms, distparms):
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("conversion of full %s params to scipy then back to std changed" % distname)
+     # sample = distf.rvs(25000)
+     # fitparms = getfitparams(sample, distname, distparms)
+-    # print "%s fitparams: %s" % (distname, str(fitparms))
++    # print ("%s fitparams: %s" % (distname, str(fitparms)))
+     # if not numpy.allclose(fitparms, distparms, rtol=0.1, atol=0.2):
+-    #     print "%s: FAIL" % distname
++    #     print ("%s: FAIL" % distname)
+     #     raise ValueError("fitparams of %s: expected %s; found %s" % \
+     #                                   (distname, str(distparms), str(fitparms)))
+     del distparms, distf, newparms # , sample, fitparms
+ 
+-    print "%s: PASS" % distname
++    print ("%s: PASS" % distname)
+ 
+ 
+     # Exponentiated Weibull distribution
+     distname = "exponweib"
+     descript = getdistparams(distname, None)
+     if len(descript) != 3:
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("number of parameter description pairs for %s: expected 3; found %d:" % \
+                          (distname, len(descript)))
+     del descript
+@@ -1149,7 +1151,7 @@ if __name__ == "__main__":
+     foundcdfs = distf.cdf(xvals)
+     expectedcdfs = numpy.power(1.0 - numpy.exp(-1.0 * numpy.power(xvals / lambdaflt, k)), alpha)
+     if not numpy.allclose(foundcdfs, expectedcdfs):
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("cdfs(0.0:10.1:0.5) of %s(%#.1f,%#.1f%#.1f): expected %s; found %s" % \
+                           (distname, distparms[0], distparms[1], distparms[2], str(expectedcdfs), str(foundcdfs)))
+     del k, lambdaflt, alpha, xvals, foundcdfs, expectedcdfs
+@@ -1158,25 +1160,25 @@ if __name__ == "__main__":
+     distparms.append(0.0)
+     newparms = getdistparams(distname, getdistparams(distname, distparms, tostd=False), tostd=True)
+     if not numpy.allclose(newparms, distparms):
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("conversion of full %s params to scipy then back to std changed" % distname)
+     # sample = distf.rvs(25000)
+     # fitparms = getfitparams(sample, distname, distparms)
+-    # print "%s fitparams: %s" % (distname, str(fitparms))
++    # print ("%s fitparams: %s" % (distname, str(fitparms)))
+     # if not numpy.allclose(fitparms, distparms, rtol=0.1, atol=0.2):
+-    #     print "%s: FAIL" % distname
++    #     print ("%s: FAIL" % distname)
+     #     raise ValueError("fitparams of %s: expected %s; found %s" % \
+     #                                   (distname, str(distparms), str(fitparms)))
+     del distparms, distf, newparms # , sample, fitparms
+ 
+-    print "%s: PASS" % distname
++    print ("%s: PASS" % distname)
+ 
+ 
+     # F distribution
+     distname = "f"
+     descript = getdistparams(distname, None)
+     if len(descript) != 2:
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("number of parameter description pairs for %s: expected 2; found %d:" % \
+                          (distname, len(descript)))
+     del descript
+@@ -1198,7 +1200,7 @@ if __name__ == "__main__":
+                     )
+     if not numpy.allclose(foundstats, expectedstats):
+         # raise ValueError("(mean, var, skew, kurtosis) of %s(%.1f, %.1f): expected %s; found %s" % \
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("(mean, var) of %s(%.1f, %.1f): expected %s; found %s" % \
+                           (distname, distparms[0], distparms[1], str(expectedstats), str(foundstats)))
+     # since skew and kurtosis is not coming out as expected, check some pdf values
+@@ -1210,7 +1212,7 @@ if __name__ == "__main__":
+     expectedpdfs = factor * numpy.power(xvals, 0.5 * dofn - 1.0) / \
+                    numpy.power(dofd + dofn * xvals, 0.5 * (dofn + dofd))
+     if not numpy.allclose(foundpdfs, expectedpdfs):
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("pdfs(0.5:10.1:0.5) of %s(%#.1f,%#.1f): expected %s; found %s" % \
+                           (distname, distparms[0], distparms[1], str(expectedpdfs), str(foundpdfs)))
+     del dofn, dofd, foundstats, expectedstats, xvals, foundpdfs, factor, expectedpdfs
+@@ -1220,25 +1222,25 @@ if __name__ == "__main__":
+     distparms.append(1.0)
+     newparms = getdistparams(distname, getdistparams(distname, distparms, tostd=False), tostd=True)
+     if not numpy.allclose(newparms, distparms):
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("conversion of full %s params to scipy then back to std changed" % distname)
+     # sample = distf.rvs(25000)
+     # fitparms = getfitparams(sample, distname, distparms)
+-    # print "%s fitparams: %s" % (distname, str(fitparms))
++    # print ("%s fitparams: %s" % (distname, str(fitparms)))
+     # if not numpy.allclose(fitparms, distparms, rtol=0.2, atol=0.4):
+-    #     print "%s: FAIL" % distname
++    #     print ("%s: FAIL" % distname)
+     #     raise ValueError("fitparams of %s: expected %s; found %s" % \
+     #                                   (distname, str(distparms), str(fitparms)))
+     del distparms, distf, newparms # , sample, fitparms
+ 
+-    print "%s: PASS" % distname
++    print ("%s: PASS" % distname)
+ 
+ 
+     # Gamma distribution
+     distname = "gamma"
+     descript = getdistparams(distname, None)
+     if len(descript) != 2:
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("number of parameter description pairs for %s: expected 2; found %d:" % \
+                          (distname, len(descript)))
+     del descript
+@@ -1250,7 +1252,7 @@ if __name__ == "__main__":
+     foundstats = distf.stats("mvsk")
+     expectedstats = ( alpha * theta, alpha * theta**2, 2.0 / math.sqrt(alpha), 6.0 / alpha )
+     if not numpy.allclose(foundstats, expectedstats):
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("(mean, var, skew, kurtosis) of %s(%.1f, %.1f): expected %s; found %s" % \
+                           (distname, distparms[0], distparms[1], str(expectedstats), str(foundstats)))
+     del alpha, theta, foundstats, expectedstats
+@@ -1259,24 +1261,24 @@ if __name__ == "__main__":
+     distparms.append(0.0)
+     newparms = getdistparams(distname, getdistparams(distname, distparms, tostd=False), tostd=True)
+     if not numpy.allclose(newparms, distparms):
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("conversion of full %s params to scipy then back to std changed" % distname)
+     sample = distf.rvs(25000)
+     fitparms = getfitparams(sample, distname, distparms)
+     if not numpy.allclose(fitparms, distparms, rtol=0.1, atol=0.2):
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("fitparams of %s: expected %s; found %s" % \
+                                       (distname, str(distparms), str(fitparms)))
+     del distparms, distf, newparms, sample, fitparms
+ 
+-    print "%s: PASS" % distname
++    print ("%s: PASS" % distname)
+ 
+ 
+     # Geometric distribution
+     distname = "geom"
+     descript = getdistparams(distname, None)
+     if len(descript) != 1:
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("number of parameter description pairs for %s: expected 1; found %d:" % \
+                          (distname, len(descript)))
+     del descript
+@@ -1291,26 +1293,26 @@ if __name__ == "__main__":
+                      6.0 + prob**2 / (1.0 - prob),
+                     )
+     if not numpy.allclose(foundstats, expectedstats):
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("(mean, var, skew, kurtosis) of %s(%.1f): expected %s; found %s" % \
+                           (distname, distparms[0], str(expectedstats), str(foundstats)))
+     del prob, foundstats, expectedstats
+ 
+     newparms = getdistparams(distname, getdistparams(distname, distparms, tostd=False), tostd=True)
+     if not numpy.allclose(newparms, distparms):
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("conversion of full %s params to scipy then back to std changed" % distname)
+     # no geom.fit function
+     del distparms, distf, newparms
+ 
+-    print "%s: PASS" % distname
++    print ("%s: PASS" % distname)
+ 
+ 
+     # Hypergeometric distribution
+     distname = "hypergeom"
+     descript = getdistparams(distname, None)
+     if len(descript) != 3:
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("number of parameter description pairs for %s: expected 3; found %d:" % \
+                          (distname, len(descript)))
+     del descript
+@@ -1335,26 +1337,26 @@ if __name__ == "__main__":
+                       #      3.0 * numdrawn * (numtotal - numdrawn) * (numtotal + 6.0) / numtotal**2 - 6.0),
+                     )
+     if not numpy.allclose(foundstats, expectedstats):
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("(mean, var, skew, kurtosis) of %s(%.1f, %.1f, %.1f): expected %s; found %s" % \
+                           (distname, distparms[0], distparms[1], distparms[2], str(expectedstats), str(foundstats)))
+     del numtotal, numgood, numdrawn, foundstats, expectedstats
+ 
+     newparms = getdistparams(distname, getdistparams(distname, distparms, tostd=False), tostd=True)
+     if not numpy.allclose(newparms, distparms):
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("conversion of full %s params to scipy then back to std changed" % distname)
+     # no hypergeom.fit function
+     del distparms, distf, newparms
+ 
+-    print "%s: PASS" % distname
++    print ("%s: PASS" % distname)
+ 
+ 
+     # Inverse-Gamma distribution
+     distname = "invgamma"
+     descript = getdistparams(distname, None)
+     if len(descript) != 2:
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("number of parameter description pairs for %s: expected 2; found %d:" % \
+                          (distname, len(descript)))
+     del descript
+@@ -1370,7 +1372,7 @@ if __name__ == "__main__":
+                       (30.0 * alpha - 66.0)/ ((alpha - 3.0) * (alpha - 4.0)),
+                     )
+     if not numpy.allclose(foundstats, expectedstats):
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("(mean, var, skew, kurtosis) of %s(%.1f, %.1f): expected %s; found %s" % \
+                           (distname, distparms[0], distparms[1], str(expectedstats), str(foundstats)))
+     del alpha, beta, foundstats, expectedstats
+@@ -1379,25 +1381,25 @@ if __name__ == "__main__":
+     distparms.append(0.0)
+     newparms = getdistparams(distname, getdistparams(distname, distparms, tostd=False), tostd=True)
+     if not numpy.allclose(newparms, distparms):
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("conversion of full %s params to scipy then back to std changed" % distname)
+     # sample = distf.rvs(25000)
+     # fitparms = getfitparams(sample, distname, distparms)
+-    # print "%s fitparams: %s" % (distname, str(fitparms))
++    # print ("%s fitparams: %s" % (distname, str(fitparms)))
+     # if not numpy.allclose(fitparms, distparms, rtol=0.2, atol=0.4):
+-    #     print "%s: FAIL" % distname
++    #     print ("%s: FAIL" % distname)
+     #     raise ValueError("fitparams of %s: expected %s; found %s" % \
+     #                                   (distname, str(distparms), str(fitparms)))
+     del distparms, distf, newparms # , sample, fitparms
+ 
+-    print "%s: PASS" % distname
++    print ("%s: PASS" % distname)
+ 
+ 
+     # Laplace distribution
+     distname = "laplace"
+     descript = getdistparams(distname, None)
+     if len(descript) != 2:
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("number of parameter description pairs for %s: expected 2; found %d:" % \
+                          (distname, len(descript)))
+     del descript
+@@ -1409,31 +1411,31 @@ if __name__ == "__main__":
+     foundstats = distf.stats("mvsk")
+     expectedstats = ( mu, 2.0 * b**2, 0.0, 3.0 )
+     if not numpy.allclose(foundstats, expectedstats):
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("(mean, var, skew, kurtosis) of %s(%.1f, %.1f): expected %s; found %s" % \
+                           (distname, distparms[0], distparms[1], str(expectedstats), str(foundstats)))
+     del mu, b, foundstats, expectedstats
+ 
+     newparms = getdistparams(distname, getdistparams(distname, distparms, tostd=False), tostd=True)
+     if not numpy.allclose(newparms, distparms):
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("conversion of full %s params to scipy then back to std changed" % distname)
+     sample = distf.rvs(25000)
+     fitparms = getfitparams(sample, distname, distparms)
+     if not numpy.allclose(fitparms, distparms, rtol=0.1, atol=0.2):
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("fitparams of %s: expected %s; found %s" % \
+                                       (distname, str(distparms), str(fitparms)))
+     del distparms, distf, newparms, sample, fitparms
+ 
+-    print "%s: PASS" % distname
++    print ("%s: PASS" % distname)
+ 
+ 
+     # Log-normal distribution
+     distname = "lognorm"
+     descript = getdistparams(distname, None)
+     if len(descript) != 2:
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("number of parameter description pairs for %s: expected 2; found %d:" % \
+                          (distname, len(descript)))
+     del descript
+@@ -1449,7 +1451,7 @@ if __name__ == "__main__":
+                       math.exp(4.0 * sigma**2) + 2.0 * math.exp(3.0 * sigma**2) + 3.0 * math.exp(2.0 * sigma**2) - 6,
+                     )
+     if not numpy.allclose(foundstats, expectedstats):
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("(mean, var, skew, kurtosis) of %s(%.1f, %.1f): expected %s; found %s" % \
+                           (distname, distparms[0], distparms[1], str(expectedstats), str(foundstats)))
+     del mu, sigma, foundstats, expectedstats
+@@ -1458,25 +1460,25 @@ if __name__ == "__main__":
+     distparms.append(0.0)
+     newparms = getdistparams(distname, getdistparams(distname, distparms, tostd=False), tostd=True)
+     if not numpy.allclose(newparms, distparms):
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("conversion of full %s params to scipy then back to std changed" % distname)
+     # sample = distf.rvs(25000)
+     # fitparms = getfitparams(sample, distname, distparms)
+-    # print "%s fitparams: %s" % (distname, str(fitparms))
++    # print ("%s fitparams: %s" % (distname, str(fitparms)))
+     # if not numpy.allclose(fitparms, distparms, rtol=0.1, atol=0.2):
+-    #     print "%s: FAIL" % distname
++    #     print ("%s: FAIL" % distname)
+     #     raise ValueError("fitparams of %s: expected %s; found %s" % \
+     #                                   (distname, str(distparms), str(fitparms)))
+     del distparms, distf, newparms # , sample, fitparms
+ 
+-    print "%s: PASS" % distname
++    print ("%s: PASS" % distname)
+ 
+ 
+     # Negative-binomial distribution
+     distname = "nbinom"
+     descript = getdistparams(distname, None)
+     if len(descript) != 2:
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("number of parameter description pairs for %s: expected 2; found %d:" % \
+                          (distname, len(descript)))
+     del descript
+@@ -1492,26 +1494,26 @@ if __name__ == "__main__":
+                       (prob**2 - 6.0 * prob + 6.0) / (numsuccess * (1.0 - prob)),
+                     )
+     if not numpy.allclose(foundstats, expectedstats):
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("(mean, var, skew, kurtosis) of %s(%.1f, %.1f): expected %s; found %s" % \
+                           (distname, distparms[0], distparms[1], str(expectedstats), str(foundstats)))
+     del numsuccess, prob, foundstats, expectedstats
+ 
+     newparms = getdistparams(distname, getdistparams(distname, distparms, tostd=False), tostd=True)
+     if not numpy.allclose(newparms, distparms):
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("conversion of full %s params to scipy then back to std changed" % distname)
+     # no nbinom.fit function
+     del distparms, distf, newparms
+ 
+-    print "%s: PASS" % distname
++    print ("%s: PASS" % distname)
+ 
+ 
+     # Normal distribution
+     distname = "norm"
+     descript = getdistparams(distname, None)
+     if len(descript) != 2:
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("number of parameter description pairs for %s: expected 2; found %d:" % \
+                          (distname, len(descript)))
+     del descript
+@@ -1523,24 +1525,24 @@ if __name__ == "__main__":
+     foundstats = distf.stats("mvsk")
+     expectedstats = ( mu, sigma**2, 0.0, 0.0 )
+     if not numpy.allclose(foundstats, expectedstats):
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("(mean, var, skew, kurtosis) of %s(%.1f, %.1f): expected %s; found %s" % \
+                           (distname, distparms[0], distparms[1], str(expectedstats), str(foundstats)))
+     del mu, sigma, foundstats, expectedstats
+ 
+     newparms = getdistparams(distname, getdistparams(distname, distparms, tostd=False), tostd=True)
+     if not numpy.allclose(newparms, distparms):
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("conversion of full %s params to scipy then back to std changed" % distname)
+     sample = distf.rvs(25000)
+     fitparms = getfitparams(sample, distname, distparms)
+     if not numpy.allclose(fitparms, distparms, rtol=0.1, atol=0.2):
+-        print "%s: FAIL" % distname
++        print ("%s: FAIL" % distname)
+         raise ValueError("fitparams of %s: expected %s; found %s" % \
+                                       (distname, str(distparms), str(fitparms)))
+     del distparms, distf, newparms, sample, fitparms
+ 
+-    print "%s: PASS" % distname
++    print ("%s: PASS" % distname)
+ 
+ 
+     # Pareto distribution
+Index: pyferret-1.1.0/pyfermod/stats/stats_cdf.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/stats/stats_cdf.py
++++ pyferret-1.1.0/pyfermod/stats/stats_cdf.py
+@@ -2,6 +2,8 @@
+ Returns the array of cumulative distribution function values
+ for a probability distribution and set of abscissa values.
+ """
++from __future__ import print_function
++from past.builtins import xrange
+ import numpy
+ import scipy.stats
+ import pyferret
+@@ -78,10 +80,10 @@ if __name__ == "__main__":
+     result = -888.0 * numpy.ones((1, dimen, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+     ferret_compute(0, result, resbdf, (abscissa, pfname, pfparams), inpbdfs)
+     if not numpy.allclose(result, expected):
+-        print "Expected (flattened) = %s" % str(expected.reshape(-1))
+-        print "Result (flattened) = %s" % str(result.reshape(-1))
++        print ("Expected (flattened) = %s" % str(expected.reshape(-1)))
++        print ("Result (flattened) = %s" % str(result.reshape(-1)))
+         raise ValueError("Unexpected result")
+ 
+     # All successful
+-    print "Success"
++    print ("Success")
+ 
+Index: pyferret-1.1.0/pyfermod/stats/stats_chisquare.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/stats/stats_chisquare.py
++++ pyferret-1.1.0/pyfermod/stats/stats_chisquare.py
+@@ -3,6 +3,8 @@ Performs a chi-square test that a sample
+ counts of categorical data comes from a population with the
+ given expected counts or relative frequencies of that data.
+ """
++from __future__ import print_function
++from past.builtins import xrange
+ import numpy
+ import pyferret
+ import scipy.stats
+@@ -109,12 +111,12 @@ if __name__ == "__main__":
+         histgr = numpy.array(histgr, dtype=numpy.float64)
+         exphist = numpy.ones((nbins,), dtype=numpy.float64) * histgr.mean()
+         chival = ((histgr - exphist)**2 / exphist).sum()
+-        print "created a sample with chival = %f" % chival
++        print ("created a sample with chival = %f" % chival)
+     prob = scipy.stats.chi2(nbins - 1 - ddof).sf(chival)
+     expect = numpy.array([chival, prob, nbins], dtype=numpy.float64)
+-    print "sample histogram = \n%s" % str(histgr)
+-    print "expect histogram value for all bins = %f" % exphist[0]
+-    print "expect result = %s" % str(expect)
++    print ("sample histogram = \n%s" % str(histgr))
++    print ("expect histogram value for all bins = %f" % exphist[0])
++    print ("expect result = %s" % str(expect))
+ 
+     # setup for the call to ferret_compute - one non-singular axis
+     inpbdfs = numpy.array([-9999.0, -8888.0, -7777.0], dtype=numpy.float64)
+@@ -128,7 +130,7 @@ if __name__ == "__main__":
+     # call ferret_compute and check the result
+     ferret_compute(0, result, resbdf, (samhist, pophist, ddofarr), inpbdfs)
+     result = result.reshape(-1)
+-    print " found result = %s" % str(result)
++    print (" found result = %s" % str(result))
+     if not numpy.allclose(result, expect):
+         raise ValueError("Unexpected result")
+ 
+@@ -145,10 +147,10 @@ if __name__ == "__main__":
+     # call ferret_compute and check the result
+     ferret_compute(0, result, resbdf, (samhist, pophist, ddofarr), inpbdfs)
+     result = result.reshape(-1)
+-    print " found result = %s" % str(result)
++    print (" found result = %s" % str(result))
+     if not numpy.allclose(result, expect):
+         raise ValueError("Unexpected result")
+ 
+     # All successful
+-    print "Success"
++    print ("Success")
+ 
+Index: pyferret-1.1.0/pyfermod/stats/stats_fit.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/stats/stats_fit.py
++++ pyferret-1.1.0/pyfermod/stats/stats_fit.py
+@@ -2,6 +2,8 @@
+ Returns parameter values for a specified probability distribution type
+ that best describe the distribution of a given array of values.
+ """
++from __future__ import print_function
++from past.builtins import xrange
+ import math
+ import numpy
+ import pyferret
+@@ -101,5 +103,5 @@ if __name__ == "__main__":
+         raise ValueError("Norm fit fail; expected params: %s; found %s" % (str(expected), str(result)))
+ 
+     # All successful
+-    print "Success"
++    print ("Success")
+ 
+Index: pyferret-1.1.0/pyfermod/stats/stats_helper.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/stats/stats_helper.py
++++ pyferret-1.1.0/pyfermod/stats/stats_helper.py
+@@ -2,6 +2,8 @@
+ Returns an array of strings describing
+ the parameters for a probability distribution.
+ """
++from __future__ import print_function
++from builtins.past import xrange
+ import numpy
+ import pyferret
+ import pyferret.stats
+@@ -118,7 +120,7 @@ def print_help():
+     ferret_compute(0, distrib_array, None, ( pfname, ), None)
+     # Print all the distribution short and long names, and the empty line at the end
+     for j in xrange(max_strings):
+-        print distrib_array[j]
++        print (distrib_array[j])
+     # Now go through all the distributions
+     params_array = numpy.empty((max_strings,), \
+                                dtype=numpy.dtype('S128'), order='F')
+@@ -131,7 +133,7 @@ def print_help():
+         pfname = distrib_array[j].split()[1].split('(')[0]
+         ferret_compute(0, params_array, None, ( pfname, ), None)
+         for k in xrange(max_strings):
+-            print params_array[k]
++            print (params_array[k])
+             # Stop after printing an empty line
+             if not params_array[k]:
+                 break;
+Index: pyferret-1.1.0/pyfermod/stats/stats_histogram.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/stats/stats_histogram.py
++++ pyferret-1.1.0/pyfermod/stats/stats_histogram.py
+@@ -1,6 +1,7 @@
+ """
+ Returns histogram bin counts for a given array of values.
+ """
++from __future__ import print_function
+ import numpy
+ import pyferret
+ 
+@@ -111,5 +112,5 @@ if __name__ == "__main__":
+     # verify the results
+     if not numpy.allclose(result, expected):
+         raise ValueError("Unexpected results; expected:\n%s\nfound:\n%s" % (str(expected), str(result)))
+-    print "Success"
++    print ("Success")
+ 
+Index: pyferret-1.1.0/pyfermod/stats/stats_isf.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/stats/stats_isf.py
++++ pyferret-1.1.0/pyfermod/stats/stats_isf.py
+@@ -2,6 +2,8 @@
+ Returns the array of inverse survival function values for
+ a probability distribution and set of quantile values.
+ """
++from __future__ import print_function
++from past.builtins import xrange
+ import numpy
+ import scipy.stats
+ import pyferret
+@@ -77,10 +79,10 @@ if __name__ == "__main__":
+     result = -888.0 * numpy.ones((1, dimen, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+     ferret_compute(0, result, resbdf, (quantile, pfname, pfparams), inpbdfs)
+     if not numpy.allclose(result, expected):
+-        print "Expected (flattened) = %s" % str(expected.reshape(-1))
+-        print "Result (flattened) = %s" % str(result.reshape(-1))
++        print ("Expected (flattened) = %s" % str(expected.reshape(-1)))
++        print ("Result (flattened) = %s" % str(result.reshape(-1)))
+         raise ValueError("Unexpected result")
+ 
+     # All successful
+-    print "Success"
++    print ("Success")
+ 
+Index: pyferret-1.1.0/pyfermod/stats/stats_kstest1.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/stats/stats_kstest1.py
++++ pyferret-1.1.0/pyfermod/stats/stats_kstest1.py
+@@ -2,6 +2,8 @@
+ Performs a two-sided Kolmogorov-Smirnov test that the provided
+ sample comes from the given probability distribution function.
+ """
++from __future__ import print_function
++from past.builtins import xrange
+ import numpy
+ import pyferret
+ import pyferret.stats
+@@ -117,7 +119,7 @@ if __name__ == "__main__":
+     # call ferret_compute with data from the distribution and check the results
+     ferret_compute(0, resultc, resbdf, (sampc, distname, distparams), inpbdfs)
+     resultc = resultc.reshape(-1)
+-    print "from same dist result: %s" % str(resultc)
++    print ("from same dist result: %s" % str(resultc))
+     if (resultc[0] < 0.00) or (resultc[0] > 0.01) or \
+        (resultc[1] < 0.10) or (resultc[1] > 1.00):
+         raise ValueError("Unexpected result")
+@@ -125,11 +127,11 @@ if __name__ == "__main__":
+     # call ferret_compute with data from a different distribution and check the results
+     ferret_compute(0, resultu, resbdf, (sampu, distname, distparams), inpbdfs)
+     resultu = resultu.reshape(-1)
+-    print "from diff dist result:  %s" % str(resultu)
++    print ("from diff dist result:  %s" % str(resultu))
+     if (resultu[0] < 0.99) or (resultu[0] > 1.00) or \
+        (resultu[1] < 0.00) or (resultu[1] > 0.01):
+         raise ValueError("Unexpected result")
+ 
+     # All successful
+-    print "Success"
++    print ("Success")
+ 
+Index: pyferret-1.1.0/pyfermod/stats/stats_kstest2.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/stats/stats_kstest2.py
++++ pyferret-1.1.0/pyfermod/stats/stats_kstest2.py
+@@ -2,6 +2,8 @@
+ Performs a two-sided Kolmogorov-Smirnov test that two samples
+ come from the same continuous probability distribution.
+ """
++from __future__ import print_function
++from past.builtins import xrange
+ import numpy
+ import pyferret
+ import scipy.stats
+@@ -107,7 +109,7 @@ if __name__ == "__main__":
+     # call ferret_compute with the samples from the same distribution and check the results
+     ferret_compute(0, resultb, resbdf, (arraya, arrayb), inpbdfs)
+     resultb = resultb.reshape(-1)
+-    print "from same dist result: %s" % str(resultb)
++    print ("from same dist result: %s" % str(resultb))
+     if (resultb[0] < 0.00) or (resultb[0] > 0.01) or \
+        (resultb[1] < 0.10) or (resultb[1] > 1.00):
+         raise ValueError("Unexpected result")
+@@ -115,11 +117,11 @@ if __name__ == "__main__":
+     # call ferret_compute with data from different distributions and check the results
+     ferret_compute(0, resultu, resbdf, (sampa, sampu), inpbdfs)
+     resultu = resultu.reshape(-1)
+-    print "from diff dist result: %s" % str(resultu)
++    print ("from diff dist result: %s" % str(resultu))
+     if (resultu[0] < 0.98) or (resultu[0] > 1.00) or \
+        (resultu[1] < 0.00) or (resultu[1] > 0.01):
+         raise ValueError("Unexpected result")
+ 
+     # All successful
+-    print "Success"
++    print ("Success")
+ 
+Index: pyferret-1.1.0/pyfermod/stats/stats_linregress.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/stats/stats_linregress.py
++++ pyferret-1.1.0/pyfermod/stats/stats_linregress.py
+@@ -2,6 +2,8 @@
+ Returns parameters resulting from a linear regression of one set
+ of given data against another set of given data.
+ """
++from __future__ import print_function
++from past.builtins import xrange
+ import math
+ import numpy
+ import pyferret
+@@ -149,5 +151,5 @@ if __name__ == "__main__":
+                          (str(expected), str(result)))
+ 
+     # All successful
+-    print "Success"
++    print ("Success")
+ 
+Index: pyferret-1.1.0/pyfermod/stats/stats_norm_pdf.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/stats/stats_norm_pdf.py
++++ pyferret-1.1.0/pyfermod/stats/stats_norm_pdf.py
+@@ -4,6 +4,8 @@ for the Normal probability distribution
+ using the given arrays for the abscissa or template
+ values and each of the parameters values.
+ """
++from __future__ import print_function
++from past.builtins import xrange
+ import numpy
+ import pyferret
+ import pyferret.stats
+@@ -70,10 +72,10 @@ if __name__ == "__main__":
+     result = -5555.0 * numpy.ones((xdim, ydim, zdim, tdim, 1, 1), dtype=numpy.float64, order='F')
+     ferret_compute(0, result, resbdf, (yzvals, mus, sigmas), inpbdfs)
+     if not numpy.allclose(result, pdfs):
+-        print "Expect (flattened) =\n%s" % str(pdfs.reshape(-1))
+-        print "Result (flattened) =\n%s" % str(result.reshape(-1))
++        print ("Expect (flattened) =\n%s" % str(pdfs.reshape(-1)))
++        print ("Result (flattened) =\n%s" % str(result.reshape(-1)))
+         raise ValueError("Unexpected result")
+ 
+     # All successful
+-    print "Success"
++    print ("Success")
+ 
+Index: pyferret-1.1.0/pyfermod/stats/stats_pdf.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/stats/stats_pdf.py
++++ pyferret-1.1.0/pyfermod/stats/stats_pdf.py
+@@ -2,6 +2,8 @@
+ Returns the array of probability density function values for a
+ continuous probability distribution and set of abscissa values.
+ """
++from __future__ import print_function
++from past.builtins import xrange
+ import numpy
+ import scipy.stats
+ import pyferret
+@@ -78,10 +80,10 @@ if __name__ == "__main__":
+     result = -888.0 * numpy.ones((1, dimen, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+     ferret_compute(0, result, resbdf, (abscissa, pfname, pfparams), inpbdfs)
+     if not numpy.allclose(result, expected):
+-        print "Expected (flattened) = %s" % str(expected.reshape(-1))
+-        print "Result (flattened) = %s" % str(result.reshape(-1))
++        print ("Expected (flattened) = %s" % str(expected.reshape(-1)))
++        print ("Result (flattened) = %s" % str(result.reshape(-1)))
+         raise ValueError("Unexpected result")
+ 
+     # All successful
+-    print "Success"
++    print ("Success")
+ 
+Index: pyferret-1.1.0/pyfermod/stats/stats_pearsonr.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/stats/stats_pearsonr.py
++++ pyferret-1.1.0/pyfermod/stats/stats_pearsonr.py
+@@ -2,6 +2,8 @@
+ Returns the Pearson product-moment correlation
+ coefficient between two samples of data.
+ """
++from __future__ import print_function
++from past.builtins import xrange
+ import math
+ import numpy
+ import pyferret
+@@ -141,5 +143,5 @@ if __name__ == "__main__":
+                          (str(expectu.reshape(-1)), str(resultu.reshape(-1))))
+ 
+     # All successful
+-    print "Success"
++    print ("Success")
+ 
+Index: pyferret-1.1.0/pyfermod/stats/stats_percentilesofscores.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/stats/stats_percentilesofscores.py
++++ pyferret-1.1.0/pyfermod/stats/stats_percentilesofscores.py
+@@ -1,6 +1,8 @@
+ """
+ Returns interpolated percentiles through a sample of scores (values)
+ """
++from __future__ import print_function
++from past.builtins import xrange
+ import numpy
+ import pyferret
+ import scipy.stats
+@@ -93,10 +95,10 @@ if __name__ == "__main__":
+     result = -888.0 * numpy.ones((1, 1, zdim, 1, 1, 1), dtype=numpy.float64, order='F')
+     ferret_compute(0, result, resbdf, (sample, scores), inpbdfs)
+     if not numpy.allclose(result, expected):
+-        print "Expected (flattened) = %s" % str(expected.reshape(-1))
+-        print "Result (flattened) = %s" % str(result.reshape(-1))
++        print ("Expected (flattened) = %s" % str(expected.reshape(-1)))
++        print ("Result (flattened) = %s" % str(result.reshape(-1)))
+         raise ValueError("Unexpected result")
+ 
+     # All successful
+-    print "Success"
++    print ("Success")
+ 
+Index: pyferret-1.1.0/pyfermod/stats/stats_pmf.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/stats/stats_pmf.py
++++ pyferret-1.1.0/pyfermod/stats/stats_pmf.py
+@@ -2,6 +2,8 @@
+ Returns the array of probability density function values for a
+ discrete probability distribution and set of abscissa values.
+ """
++from __future__ import print_function
++from past.builtins import xrange
+ import numpy
+ import scipy.stats
+ import pyferret
+@@ -77,10 +79,10 @@ if __name__ == "__main__":
+     result = -888.0 * numpy.ones((1, dimen, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+     ferret_compute(0, result, resbdf, (abscissa, pfname, pfparams), inpbdfs)
+     if not numpy.allclose(result, expected):
+-        print "Result (flattened) = %s" % str(result.reshape(-1))
+-        print "Expected (flattened) = %s" % str(expected.reshape(-1))
++        print ("Result (flattened) = %s" % str(result.reshape(-1)))
++        print ("Expected (flattened) = %s" % str(expected.reshape(-1)))
+         raise ValueError("Unexpected result")
+ 
+     # All successful
+-    print "Success"
++    print ("Success")
+ 
+Index: pyferret-1.1.0/pyfermod/stats/stats_ppf.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/stats/stats_ppf.py
++++ pyferret-1.1.0/pyfermod/stats/stats_ppf.py
+@@ -2,6 +2,8 @@
+ Returns the array of percent point function values for
+ a probability distribution and set of quantile values.
+ """
++from __future__ import print_function
++from past.builtins import xrange
+ import numpy
+ import scipy.stats
+ import pyferret
+@@ -77,10 +79,10 @@ if __name__ == "__main__":
+     result = -888.0 * numpy.ones((1, dimen, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+     ferret_compute(0, result, resbdf, (quantile, pfname, pfparams), inpbdfs)
+     if not numpy.allclose(result, expected):
+-        print "Expected (flattened) = %s" % str(expected.reshape(-1))
+-        print "Result (flattened) = %s" % str(result.reshape(-1))
++        print ("Expected (flattened) = %s" % str(expected.reshape(-1)))
++        print ("Result (flattened) = %s" % str(result.reshape(-1)))
+         raise ValueError("Unexpected result")
+ 
+     # All successful
+-    print "Success"
++    print ("Success")
+ 
+Index: pyferret-1.1.0/pyfermod/stats/stats_probplotvals.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/stats/stats_probplotvals.py
++++ pyferret-1.1.0/pyfermod/stats/stats_probplotvals.py
+@@ -13,6 +13,8 @@ distribution.  Thus, the slope, intercep
+ (r) of this fitted line are returned and the first three X elements
+ of the third Y axis value.
+ """
++from __future__ import print_function
++from past.builtins import xrange
+ import numpy
+ import scipy.stats
+ import pyferret
+@@ -148,15 +150,15 @@ if __name__ == "__main__":
+     ferret_compute(0, result, resbdf, (inputarr, pfname, pfparams), inpbdfs)
+     if not numpy.allclose(result, expected):
+         if not numpy.allclose(result[:,0,0,0,0,0], expected[:,0,0,0,0,0]):
+-            print "Expected[:,0,0,0,0,0] =\n%s" % str(expected[:,0,0,0,0,0])
+-            print "Result[:,0,0,0,0,0] =\n%s" % str(result[:,0,0,0,0,0])
++            print ("Expected[:,0,0,0,0,0] =\n%s" % str(expected[:,0,0,0,0,0]))
++            print ("Result[:,0,0,0,0,0] =\n%s" % str(result[:,0,0,0,0,0]))
+         if not numpy.allclose(result[:,1,0,0,0,0], expected[:,1,0,0,0,0]):
+-            print "Expected[:,1,0,0,0,0] =\n%s" % str(expected[:,1,0,0,0,0])
+-            print "Result[:,1,0,0,0,0] =\n%s" % str(result[:,1,0,0,0,0])
++            print ("Expected[:,1,0,0,0,0] =\n%s" % str(expected[:,1,0,0,0,0]))
++            print ("Result[:,1,0,0,0,0] =\n%s" % str(result[:,1,0,0,0,0]))
+         if not numpy.allclose(result[:3,2,0,0,0,0], expected[:3,2,0,0,0,0]):
+-            print "Expected[:3,2,0,0,0,0] =\n%s" % str(expected[:3,2,0,0,0,0])
+-            print "Result[:3,2,0,0,0,0] =\n%s" % str(result[:3,2,0,0,0,0])
++            print ("Expected[:3,2,0,0,0,0] =\n%s" % str(expected[:3,2,0,0,0,0]))
++            print ("Result[:3,2,0,0,0,0] =\n%s" % str(result[:3,2,0,0,0,0]))
+         raise ValueError("Unexpected result")
+ 
+     # All successful
+-    print "Success"
++    print ("Success")
+Index: pyferret-1.1.0/pyfermod/stats/stats_rvs.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/stats/stats_rvs.py
++++ pyferret-1.1.0/pyfermod/stats/stats_rvs.py
+@@ -2,6 +2,8 @@
+ Returns the array of random variates for a probability distribution
+ assigned to positions corresponding to defined values in an input array.
+ """
++from __future__ import print_function
++from past.builtins import xrange
+ import numpy
+ import scipy.stats
+ import pyferret
+@@ -96,5 +98,5 @@ if __name__ == "__main__":
+         raise ValueError("Standard deviation of random sample: expected: 0.5; found: %f" % stdev)
+ 
+     # All successful
+-    print "Success"
++    print ("Success")
+ 
+Index: pyferret-1.1.0/pyfermod/stats/stats_scoresatpercentiles.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/stats/stats_scoresatpercentiles.py
++++ pyferret-1.1.0/pyfermod/stats/stats_scoresatpercentiles.py
+@@ -1,6 +1,8 @@
+ """
+ Returns interpolated scores (values) at percentiles through a sample
+ """
++from __future__ import print_function
++from past.builtins import xrange
+ import numpy
+ import pyferret
+ import scipy.stats
+@@ -92,10 +94,10 @@ if __name__ == "__main__":
+     result = -888.0 * numpy.ones((1, 1, zdim, 1, 1, 1), dtype=numpy.float64, order='F')
+     ferret_compute(0, result, resbdf, (sample, prcnts), inpbdfs)
+     if not numpy.allclose(result, expected):
+-        print "Expected (flattened) = %s" % str(expected.reshape(-1))
+-        print "Result (flattened) = %s" % str(result.reshape(-1))
++        print ("Expected (flattened) = %s" % str(expected.reshape(-1)))
++        print ("Result (flattened) = %s" % str(result.reshape(-1)))
+         raise ValueError("Unexpected result")
+ 
+     # All successful
+-    print "Success"
++    print ("Success")
+ 
+Index: pyferret-1.1.0/pyfermod/stats/stats_sf.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/stats/stats_sf.py
++++ pyferret-1.1.0/pyfermod/stats/stats_sf.py
+@@ -2,6 +2,8 @@
+ Returns the array of survival function values for a
+ probability distribution and set of abscissa values.
+ """
++from __future__ import print_function
++from past.builtins import xrange
+ import numpy
+ import scipy.stats
+ import pyferret
+@@ -77,10 +79,10 @@ if __name__ == "__main__":
+     result = -888.0 * numpy.ones((1, dimen, 1, 1, 1, 1), dtype=numpy.float64, order='F')
+     ferret_compute(0, result, resbdf, (abscissa, pfname, pfparams), inpbdfs)
+     if not numpy.allclose(result, expected):
+-        print "Expected (flattened) = %s" % str(expected.reshape(-1))
+-        print "Result (flattened) = %s" % str(result.reshape(-1))
++        print ("Expected (flattened) = %s" % str(expected.reshape(-1)))
++        print ("Result (flattened) = %s" % str(result.reshape(-1)))
+         raise ValueError("Unexpected result")
+ 
+     # All successful
+-    print "Success"
++    print ("Success")
+ 
+Index: pyferret-1.1.0/pyfermod/stats/stats_spearmanr.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/stats/stats_spearmanr.py
++++ pyferret-1.1.0/pyfermod/stats/stats_spearmanr.py
+@@ -1,6 +1,8 @@
+ """
+ Returns Spearman's rank correlation coefficient between two samples of data.
+ """
++from __future__ import print_function
++from past.builtins import xrange
+ import math
+ import numpy
+ import pyferret
+@@ -139,5 +141,5 @@ if __name__ == "__main__":
+                          (str(expectu.reshape(-1)), str(resultu.reshape(-1))))
+ 
+     # All successful
+-    print "Success"
++    print ("Success")
+ 
+Index: pyferret-1.1.0/pyfermod/stats/stats_stats.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/stats/stats_stats.py
++++ pyferret-1.1.0/pyfermod/stats/stats_stats.py
+@@ -2,6 +2,8 @@
+ Returns the (unweighted) mean, variance, skew, and kurtoses
+ of an array of values
+ """
++from __future__ import print_function
++from past.builtins import xrange
+ import math
+ import numpy
+ import pyferret
+@@ -102,5 +104,5 @@ if __name__ == "__main__":
+                          (str(expected), str(result)))
+ 
+     # All successful
+-    print "Success"
++    print ("Success")
+ 
+Index: pyferret-1.1.0/pyfermod/stats/stats_ttest1.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/stats/stats_ttest1.py
++++ pyferret-1.1.0/pyfermod/stats/stats_ttest1.py
+@@ -2,6 +2,8 @@
+ Performs a two-sided T-test that the provided sample
+ comes from a population with the given mean(s).
+ """
++from __future__ import print_function
++from past.builtins import xrange
+ import numpy
+ import pyferret
+ import scipy.stats
+@@ -131,10 +133,10 @@ if __name__ == "__main__":
+     # call ferret_compute and check the results
+     ferret_compute(0, result, resbdf, (samparr, meanarr), inpbdfs)
+     if not numpy.allclose(result, expect):
+-        print "expect[:,:,0,0,0,0]:\n   %s" % str(expect[:, :, 0, 0, 0, 0])
+-        print "result[:,:,0,0,0,0]:\n   %s" % str(result[:, :, 0, 0, 0, 0])
++        print ("expect[:,:,0,0,0,0]:\n   %s" % str(expect[:, :, 0, 0, 0, 0]))
++        print ("result[:,:,0,0,0,0]:\n   %s" % str(result[:, :, 0, 0, 0, 0]))
+         raise ValueError("Unexpected result")
+ 
+     # All successful
+-    print "Success"
++    print ("Success")
+ 
+Index: pyferret-1.1.0/pyfermod/stats/stats_ttest2ind.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/stats/stats_ttest2ind.py
++++ pyferret-1.1.0/pyfermod/stats/stats_ttest2ind.py
+@@ -2,6 +2,8 @@
+ Performs a two-sided T-test that two independent samples
+ come from (normal) distributions with the same mean.
+ """
++from __future__ import print_function
++from past.builtins import xrange
+ import numpy
+ import pyferret
+ import scipy.stats
+@@ -111,7 +113,7 @@ if __name__ == "__main__":
+     # call ferret_compute with the samples from distribs with the same mean and check
+     ferret_compute(0, resultb, resbdf, (arraya, arrayb), inpbdfs)
+     resultb = resultb.reshape(-1)
+-    print "result from same mean: %s" % str(resultb)
++    print ("result from same mean: %s" % str(resultb))
+     if (abs(resultb[0]) > 2.0) or \
+        (resultb[1] <  0.1) or (resultb[1] > 1.0):
+         raise ValueError("Unexpected result")
+@@ -119,11 +121,11 @@ if __name__ == "__main__":
+     # call ferret_compute with the samples from distribs with different means and check
+     ferret_compute(0, resultu, resbdf, (arraya, arrayu), inpbdfs)
+     resultu = resultu.reshape(-1)
+-    print "result from diff mean: %s" % str(resultu)
++    print ("result from diff mean: %s" % str(resultu))
+     if (resultu[0] > -20.0) or \
+        (resultu[1] < 0.0) or (resultu[1] > 1.0E-5):
+         raise ValueError("Unexpected result")
+ 
+     # All successful
+-    print "Success"
++    print ("Success")
+ 
+Index: pyferret-1.1.0/pyfermod/stats/stats_ttest2rel.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/stats/stats_ttest2rel.py
++++ pyferret-1.1.0/pyfermod/stats/stats_ttest2rel.py
+@@ -2,6 +2,8 @@
+ Performs a two-sided T-test that two related (paired) samples
+ come from (normal) distributions with the same mean.
+ """
++from __future__ import print_function
++from past.builtins import xrange
+ import numpy
+ import pyferret
+ import scipy.stats
+@@ -118,7 +120,7 @@ if __name__ == "__main__":
+     # call ferret_compute with the samples with the same mean and check
+     ferret_compute(0, resultb, resbdf, (arraya, arrayb), inpbdfs)
+     resultb = resultb.reshape(-1)
+-    print "result from same mean:\n   %s" % str(resultb)
++    print ("result from same mean:\n   %s" % str(resultb))
+     if (abs(resultb[0]) > 2.0) or \
+        (resultb[1] < 0.1) or (resultb[1] > 1.0) or \
+        (abs(resultb[2] - numgood) > 1.0E-5):
+@@ -127,12 +129,12 @@ if __name__ == "__main__":
+     # call ferret_compute with samples with different means and check
+     ferret_compute(0, resultu, resbdf, (arraya, arrayu), inpbdfs)
+     resultu = resultu.reshape(-1)
+-    print "result from diff mean:\n   %s" % str(resultu)
++    print ("result from diff mean:\n   %s" % str(resultu))
+     if (resultu[0] > -2000.0) or \
+        (resultu[1] < 0.00) or (resultu[1] > 0.0001) or \
+        (abs(resultb[2] - numgood) > 1.0E-5):
+         raise ValueError("Unexpected result")
+ 
+     # All successful
+-    print "Success"
++    print ("Success")
+ 
+Index: pyferret-1.1.0/pyfermod/stats/stats_zscore.py
+===================================================================
+--- pyferret-1.1.0.orig/pyfermod/stats/stats_zscore.py
++++ pyferret-1.1.0/pyfermod/stats/stats_zscore.py
+@@ -3,6 +3,8 @@ Returns the array of standard scores for
+ standard score are for the standard distribution centered of the
+ mean value of the data with the same variance as the data.
+ """
++from __future__ import print_function
++from past.builtins import xrange
+ import math
+ import numpy
+ import pyferret
+@@ -82,10 +84,10 @@ if __name__ == "__main__":
+     # call ferret_compute and check the results
+     ferret_compute(0, result, resbdf, (input, ), inpbdfs)
+     if not numpy.allclose(result, expected, rtol=2.0E-7, atol=2.0E-7):
+-        print "expected (flattened) =\n%s" % str(expected.reshape(-1, order='F'))
+-        print "result (flattened) =\n%s" % str(result.reshape(-1, order='F'))
++        print ("expected (flattened) =\n%s" % str(expected.reshape(-1, order='F')))
++        print ("result (flattened) =\n%s" % str(result.reshape(-1, order='F')))
+         raise ValueError("Unexpected result")
+ 
+     # All successful
+-    print "Success"
++    print ("Success")
+ 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/pyferret.git



More information about the debian-science-commits mailing list