Control: tag -1 patch

Hi,

I checked through the source code (using oldnumeric/alter_code2.py from
an older numpy distribution for hints) to remove the incompatibilities
with numpy >= 1.9.

The result is in the patch. Could you add it to debian/patches so that
the packaging is working again?

Best regards

Ole
--- a/qt4lib/PyQt4/Qwt5/anynumpy.py
+++ b/qt4lib/PyQt4/Qwt5/anynumpy.py
@@ -5,7 +5,6 @@
     try:
          eval(compile('from %s import *' % name, 'eval', 'exec'))
          if name == 'numpy':
-             from numpy.oldnumeric.compat import *
              Float = float
              UInt8 = uint8
     except ImportError:
--- a/qt3examples/ImagePlotDemo.py
+++ b/qt3examples/ImagePlotDemo.py
@@ -14,7 +14,7 @@
 # from scipy.pilutil
 def bytescale(data, cmin=None, cmax=None, high=255, low=0):
     if ((hasattr(data, 'dtype') and data.dtype.char == UInt8)
-        or (hasattr(data, 'typecode') and data.typecode == UInt8)
+        or (hasattr(data, 'dtype') and data.dtype == UInt8)
         ):
         return data
     high = high - low
@@ -30,13 +30,13 @@
 
 
 def linearX(nx, ny):
-    return repeat(arange(nx, typecode = Float32)[:, NewAxis], ny, -1)
+    return repeat(arange(nx, dtype = Float32)[:, newaxis], ny, -1)
 
 # linearX()
 
 
 def linearY(nx, ny):
-    return repeat(arange(ny, typecode = Float32)[NewAxis, :], nx, 0)
+    return repeat(arange(ny, dtype = Float32)[newaxis, :], nx, 0)
 
 # linearY()
 
@@ -44,7 +44,7 @@
 def square(n, min, max):
     t = arange(min, max, float(max-min)/(n-1))
     #return outer(cos(t), sin(t))
-    return cos(t)*sin(t)[:,NewAxis]
+    return cos(t)*sin(t)[:,newaxis]
 
 # square()
     
--- a/qt4examples/ImagePlotDemo.py
+++ b/qt4examples/ImagePlotDemo.py
@@ -9,7 +9,7 @@
 # from scipy.pilutil
 def bytescale(data, cmin=None, cmax=None, high=255, low=0):
     if ((hasattr(data, 'dtype') and data.dtype.char == UInt8)
-        or (hasattr(data, 'typecode') and data.typecode == UInt8)
+        or (hasattr(data, 'dtype') and data.dtype == UInt8)
         ):
         return data
     high = high - low
@@ -25,13 +25,13 @@
 
 
 def linearX(nx, ny):
-    return repeat(arange(nx, typecode = Float32)[:, NewAxis], ny, -1)
+    return repeat(arange(nx, dtype = Float32)[:, newaxis], ny, -1)
 
 # linearX()
 
 
 def linearY(nx, ny):
-    return repeat(arange(ny, typecode = Float32)[NewAxis, :], nx, 0)
+    return repeat(arange(ny, dtype = Float32)[newaxis, :], nx, 0)
 
 # linearY()
 
@@ -39,7 +39,7 @@
 def square(n, min, max):
     t = arange(min, max, float(max-min)/(n-1))
     #return outer(cos(t), sin(t))
-    return cos(t)*sin(t)[:,NewAxis]
+    return cos(t)*sin(t)[:,newaxis]
 
 # square()
     

Reply via email to