mailr4846 - /1.3/specific_fns/relax_fit.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by sebastien . morin . 1 on January 17, 2008 - 22:13:
Author: semor
Date: Thu Jan 17 22:13:26 2008
New Revision: 4846

URL: http://svn.gna.org/viewcvs/relax?rev=4846&view=rev
Log:
Converted a specific_fns module from Numeric to numpy.

The Numeric.matrixmultiply module is deprecated and was thus replaced by the 
numpy.dot module.


Modified:
    1.3/specific_fns/relax_fit.py

Modified: 1.3/specific_fns/relax_fit.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/specific_fns/relax_fit.py?rev=4846&r1=4845&r2=4846&view=diff
==============================================================================
--- 1.3/specific_fns/relax_fit.py (original)
+++ 1.3/specific_fns/relax_fit.py Thu Jan 17 22:13:26 2008
@@ -23,7 +23,7 @@
 # Python module imports.
 from LinearAlgebra import inverse
 from math import sqrt
-from Numeric import Float64, array, average, identity, matrixmultiply, zeros
+from numpy import array, average, dot, float64, identity, zeros
 from re import match, search
 import sys
 
@@ -50,7 +50,7 @@
 
 
     def assemble_param_vector(self, index=None, sim_index=None):
-        """Function for assembling various pieces of data into a Numeric 
parameter array."""
+        """Function for assembling various pieces of data into a numpy 
parameter array."""
 
         # Initialise.
         param_vector = []
@@ -87,15 +87,15 @@
                 else:
                     param_vector.append(data.iinf)
 
-        # Return a Numeric array.
-        return array(param_vector, Float64)
+        # Return a numpy array.
+        return array(param_vector, float64)
 
 
     def assemble_scaling_matrix(self, index=None, scaling=1):
         """Function for creating the scaling matrix."""
 
         # Initialise.
-        self.scaling_matrix = identity(len(self.param_vector), Float64)
+        self.scaling_matrix = identity(len(self.param_vector), float64)
         i = 0
 
         # No diagonal scaling.
@@ -477,7 +477,7 @@
         A = []
         b = []
         n = len(self.param_vector)
-        zero_array = zeros(n, Float64)
+        zero_array = zeros(n, float64)
         i = 0
         j = 0
 
@@ -505,9 +505,9 @@
             # Increment i.
             i = i + 1
 
-        # Convert to Numeric data structures.
-        A = array(A, Float64)
-        b = array(b, Float64)
+        # Convert to numpy data structures.
+        A = array(A, float64)
+        b = array(b, float64)
 
         return A, b
 
@@ -711,7 +711,7 @@
 
             if match('[Ll][Mm]$', algor) or 
match('[Ll]evenburg-[Mm]arquardt$', algor):
                 # Reconstruct the error data structure.
-                lm_error = zeros(len(data.relax_times), Float64)
+                lm_error = zeros(len(data.relax_times), float64)
                 index = 0
                 for k in xrange(len(data.relax_times)):
                     lm_error[index:index+len(relax_error[k])] = 
relax_error[k]




Related Messages


Powered by MHonArc, Updated Thu Jan 17 22:20:11 2008