Author: semor Date: Thu Jan 17 23:00:51 2008 New Revision: 4848 URL: http://svn.gna.org/viewcvs/relax?rev=4848&view=rev Log: Converted generic_fns modules from Numeric to numpy. As point in a post by Edward d'Auvergne (minfx-devel mailing list, see below), the select_sim array (which calls 'ones()') was specified as a integer array. https://mail.gna.org/public/minfx-commits/2008-01/msg00004.html (Message-id: <E1JF9Gs-000081-9c@xxxxxxxxxxxxxxxxxx>) Modified: 1.3/generic_fns/angles.py 1.3/generic_fns/diffusion_tensor.py 1.3/generic_fns/grace.py 1.3/generic_fns/monte_carlo.py 1.3/generic_fns/structure.py Modified: 1.3/generic_fns/angles.py URL: http://svn.gna.org/viewcvs/relax/1.3/generic_fns/angles.py?rev=4848&r1=4847&r2=4848&view=diff ============================================================================== --- 1.3/generic_fns/angles.py (original) +++ 1.3/generic_fns/angles.py Thu Jan 17 23:00:51 2008 @@ -22,7 +22,7 @@ # Python module imports. from math import acos, sin -from Numeric import dot +from numpy import dot # relax module imports. from data import Data as relax_data_store Modified: 1.3/generic_fns/diffusion_tensor.py URL: http://svn.gna.org/viewcvs/relax/1.3/generic_fns/diffusion_tensor.py?rev=4848&r1=4847&r2=4848&view=diff ============================================================================== --- 1.3/generic_fns/diffusion_tensor.py (original) +++ 1.3/generic_fns/diffusion_tensor.py Thu Jan 17 23:00:51 2008 @@ -1538,7 +1538,7 @@ # Spheroid. if cdp.diff_tensor.type == 'spheroid': # Initialise. - Dpar = zeros(3, Float64) + Dpar = zeros(3, float64) # Trig. sin_theta = sin(cdp.diff_tensor.theta) @@ -1557,9 +1557,9 @@ # Ellipsoid. if cdp.diff_tensor.type == 'ellipsoid': # Initialise. - Dx = zeros(3, Float64) - Dy = zeros(3, Float64) - Dz = zeros(3, Float64) + Dx = zeros(3, float64) + Dy = zeros(3, float64) + Dz = zeros(3, float64) # Trig. sin_alpha = sin(cdp.diff_tensor.alpha) Modified: 1.3/generic_fns/grace.py URL: http://svn.gna.org/viewcvs/relax/1.3/generic_fns/grace.py?rev=4848&r1=4847&r2=4848&view=diff ============================================================================== --- 1.3/generic_fns/grace.py (original) +++ 1.3/generic_fns/grace.py Thu Jan 17 23:00:51 2008 @@ -21,7 +21,7 @@ ############################################################################### # Python module imports. -from Numeric import array +from numpy import array from os import system from re import match Modified: 1.3/generic_fns/monte_carlo.py URL: http://svn.gna.org/viewcvs/relax/1.3/generic_fns/monte_carlo.py?rev=4848&r1=4847&r2=4848&view=diff ============================================================================== --- 1.3/generic_fns/monte_carlo.py (original) +++ 1.3/generic_fns/monte_carlo.py Thu Jan 17 23:00:51 2008 @@ -23,7 +23,7 @@ # Python module imports. from copy import deepcopy from math import sqrt -from Numeric import ones +from numpy import ones from random import gauss # relax module imports. @@ -331,7 +331,7 @@ # Create the selected simulation array with all simulations selected. if all_select_sim == None: - select_sim = ones(number) + select_sim = ones(number, int) # Loop over the instances. for instance in xrange(num_instances): @@ -353,7 +353,7 @@ @params all_select_sim: The selection status of the Monte Carlo simulations. The first dimension of this matrix corresponds to the simulation and the second corresponds to the instance. - @type all_select_sim: Numeric matrix (int) + @type all_select_sim: numpy matrix (int) """ # Arguments. Modified: 1.3/generic_fns/structure.py URL: http://svn.gna.org/viewcvs/relax/1.3/generic_fns/structure.py?rev=4848&r1=4847&r2=4848&view=diff ============================================================================== --- 1.3/generic_fns/structure.py (original) +++ 1.3/generic_fns/structure.py Thu Jan 17 23:00:51 2008 @@ -22,7 +22,7 @@ # Python module imports. from math import sqrt, cos, pi, sin -from Numeric import Float64, arccos, dot, zeros +from numpy import arccos, dot, float64, zeros from os import F_OK, access from re import compile, match import Scientific.IO.PDB @@ -201,7 +201,7 @@ print "Calculating the centre of mass." # Initialise the centre of mass. - R = zeros(3, Float64) + R = zeros(3, float64) # Initialise the total mass. M = 0.0 @@ -635,7 +635,7 @@ @param res_num: The residue number. @type res_num: int @param R: The centre of mass. - @type R: Numeric array (Float64) + @type R: numpy array (float64) @param i: The Monte Carlo simulation index. @type i: int @return: None @@ -725,7 +725,7 @@ @param res_num: The residue number. @type res_num: int @param R: The centre of mass. - @type R: Numeric array (Float64) + @type R: numpy array (float64) @param i: The Monte Carlo simulation index. @type i: int @return: None @@ -1075,13 +1075,13 @@ raise RelaxError, "The increment value of " + `inc` + " must be an even number." # Generate the increment values of u. - u = zeros(inc, Float64) + u = zeros(inc, float64) val = 1.0 / float(inc) for i in xrange(inc): u[i] = float(i) * val # Generate the increment values of v. - v = zeros(inc/2+2, Float64) + v = zeros(inc/2+2, float64) val = 1.0 / float(inc/2) for i in xrange(1, inc/2+1): v[i] = float(i-1) * val + val/2.0 @@ -1584,7 +1584,7 @@ # Initialise. vector_array = [] - ave_vector = zeros(3, Float64) + ave_vector = zeros(3, float64) # Number of structures. num_str = len(relax_data_store.pdb[self.run].structures)