tags 478463 + patch
thanks

Please find attached a preliminary patch to fix this bug. More testing
is needed to ensure that I have used the correct numpy functions.

Thanks.

Kumar
-- 
Kumar Appaiah
diff -u sixpack-0.66/lsqfitter.py sixpack-0.66/lsqfitter.py
--- sixpack-0.66/lsqfitter.py
+++ sixpack-0.66/lsqfitter.py
@@ -3,7 +3,7 @@
 from spdirvars import *
 from spglobalfuncs import *
 import spplotter
-from Numeric import *
+from numpy import *
 from Tkinter import *
 from Ifeffit import *
 import Pmw
diff -u sixpack-0.66/spsamview.py sixpack-0.66/spsamview.py
--- sixpack-0.66/spsamview.py
+++ sixpack-0.66/spsamview.py
@@ -3,7 +3,7 @@
 import xasinput
 from spdirvars import *
 from spglobalfuncs import *
-from Numeric import *
+from numpy import *
 from Tkinter import *
 import Pmw
 import Tix
@@ -13,7 +13,6 @@
 import os
 import math
 from string import *
-import MLab
 from Scientific.Functions.LeastSquares import leastSquaresFit
 
 #root=Tix.Tk()
@@ -714,8 +713,8 @@
     def getderiv(self,x,y):
         #returns deriv in ans(x,y)
         ans=[]
-        difx=MLab.diff(x,n=1)
-        dify=MLab.diff(y,n=1)
+        difx=diff(x,n=1)
+        dify=diff(y,n=1)
         ans.append(self.dxdata(x))
         ans.append(dify/difx)
         return ans
diff -u sixpack-0.66/debian/control sixpack-0.66/debian/control
--- sixpack-0.66/debian/control
+++ sixpack-0.66/debian/control
@@ -11,7 +11,7 @@
 Package: sixpack
 Architecture: all
 Depends: ${misc:Depends}, ${python:Depends}, ifeffit, python-tk, python-pmw, 
-         tix, python-ifeffit, python-numeric, blt, python-scientific
+         tix, python-ifeffit, python-numpy, blt, python-scientific
 XB-Python-Version: ${python:Versions}
 Provides: ${python:Provides}
 Description: full-featured package for XAS analysis
only in patch2:
unchanged:
--- sixpack-0.66.orig/func.py
+++ sixpack-0.66/func.py
@@ -1,11 +1,11 @@
-import Numeric
-from Numeric import *
+import numpy
+from numpy import *
 import operator
 import math
 from types import *
 
 ArrayType = type(asarray(1.0))
-UfuncType = type(Numeric.add)
+UfuncType = type(numpy.add)
 
 # unary function objects (maybe rename to UN_FUNC?)
 
@@ -19,22 +19,22 @@
 	return UnCompose(self, f)
    
     def __add__(self, f):
-	return BinCompose(Numeric.add, self, f)
+	return BinCompose(numpy.add, self, f)
    
     def __sub__(self, f):
-	return BinCompose(Numeric.subtract, self, f)
+	return BinCompose(numpy.subtract, self, f)
    
     def __mul__(self, f):
-	return BinCompose(Numeric.multiply, self, f)
+	return BinCompose(numpy.multiply, self, f)
    
     def __div__(self, f):
-	return BinCompose(Numeric.divide, self, f)
+	return BinCompose(numpy.divide, self, f)
    
     def __neg__(self):
-	return UnCompose(Numeric.negative, self)
+	return UnCompose(numpy.negative, self)
 
     def __pow__(self, f):
-	return BinCompose(Numeric.power, self, f)
+	return BinCompose(numpy.power, self, f)
 
     def __coerce__(self, x):
 	if type(x) in [IntType, FloatType, LongType, ComplexType]:
@@ -50,10 +50,10 @@
 	    return self.call(arg)
 
     def exp(self):
-	return UnCompose(Numeric.exp, self)
+	return UnCompose(numpy.exp, self)
    
     def log(self):
-	return UnCompose(Numeric.log, self)
+	return UnCompose(numpy.log, self)
 	    
    
 
only in patch2:
unchanged:
--- sixpack-0.66.orig/spkpca.py
+++ sixpack-0.66/spkpca.py
@@ -3,7 +3,7 @@
 import xasinput
 from spdirvars import *
 from spglobalfuncs import *
-from Numeric import *
+from numpy import *
 from Tkinter import *
 #from Ifeffit import *
 import Pmw
@@ -15,7 +15,6 @@
 import math
 import types
 from string import *
-import LinearAlgebra
 import spline
 import varimax
 
@@ -736,7 +735,7 @@
         #reshape datmat
         datmat=transpose(datmat)
         #do svd and eigens for pca
-        (evect,eval,weight)=LinearAlgebra.singular_value_decomposition(datmat)
+        (evect,eval,weight)=linalg.singular_value_decomposition(datmat)
         evalmat=identity(len(eval))*eval
         #prop=matrixmultiply(evalmat,weight)
         prop=weight
only in patch2:
unchanged:
--- sixpack-0.66.orig/xasinput.py
+++ sixpack-0.66/xasinput.py
@@ -17,7 +17,7 @@
 # self.iF  -- will be array if multielement is used
 # self.ICR -- data for Ge13's, else array of ones
 
-from Numeric import *
+from numpy import *
 from string import *
 from struct import *
 import Pmw
@@ -1582,4 +1582,4 @@
         #    return generic(fn,master)
         
 
-        
\ No newline at end of file
+        
only in patch2:
unchanged:
--- sixpack-0.66.orig/spline.py
+++ sixpack-0.66/spline.py
@@ -1,5 +1,5 @@
 import func
-from Numeric import *
+from numpy import *
 
 BadInput = "Bad xa input to routine splint."
 
only in patch2:
unchanged:
--- sixpack-0.66.orig/varimax.py
+++ sixpack-0.66/varimax.py
@@ -4,10 +4,8 @@
 #Adapted from MATLAB code modified by Tevor Park in 2002 from original code by J.O. Ramsay
 #
 
-from Numeric import *
+from numpy import *
 from math import *
-import MLab
-import LinearAlgebra
 
 def angle(z):
     a=z.real
@@ -15,7 +13,7 @@
     return arctan2(b,a)
 
 def var(z):
-    s=MLab.std(z)
+    s=std(z)
     return s**2
 
 def vcomplex(a,b):
@@ -41,7 +39,7 @@
         if len(target_basis.shape)!=2:
             raise ValueError, 'TARGET_BASIS must be 2-dimensional'
         if alltrue(target_basis.shape==(n,n)):
-            amat=LinearAlgebra.solve_linear_equations(target_basis,amat)
+            amat=linalg.solve(target_basis,amat)
         else:
             raise ValueError, 'TARGET_BASIS must be a basis for the column space'
     else:

Attachment: signature.asc
Description: Digital signature

Reply via email to