mailRe: r5268 - /1.3/generic_fns/grace.py


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

Header


Content

Posted by Edward d'Auvergne on April 03, 2008 - 20:48:
Hi,

I've found a few more bugs that have been introduced, please see below.


On Thu, Apr 3, 2008 at 7:04 PM,  <sebastien.morin.1@xxxxxxxxx> wrote:
Author: semor
 Date: Thu Apr  3 19:04:26 2008
 New Revision: 5268

 URL: http://svn.gna.org/viewcvs/relax?rev=5268&view=rev
 Log:
 Changed "for i in xrange(len(cdp.res)):" to the spin_loop.

 This was proposed by Edward d'Auvergne in a post at :
 https://mail.gna.org/public/relax-devel/2008-04/msg00012.html (Message-id:
 <7f080ed10804030926p4be2e72apa2ccef85a9062e57@xxxxxxxxxxxxxx>)


 Modified:
    1.3/generic_fns/grace.py

 Modified: 1.3/generic_fns/grace.py
 URL: 
http://svn.gna.org/viewcvs/relax/1.3/generic_fns/grace.py?rev=5268&r1=5267&r2=5268&view=diff
 
==============================================================================
 --- 1.3/generic_fns/grace.py (original)
 +++ 1.3/generic_fns/grace.py Thu Apr  3 19:04:26 2008
 @@ -102,29 +102,29 @@
        cdp = relax_data_store[relax_data_store.current_pipe]

         # Loop over the residues.
 -        for i in xrange(len(cdp.res)):
 +        for spin in spin_loop(spin_id):
             # Remap the data structure 'cdp.res[i]'.
 -            data = cdp.res[i]
 +            spin = cdp.res[i]

             # Skip the residue if there is no match to 'self.res_num' 
(unless it is None).
             if type(self.res_num) == int:
 -                if not data.num == self.res_num:
 +                if not spin.num == self.res_num:
                     continue
             elif type(self.res_num) == str:
 -                if not match(self.res_num, `data.num`):
 +                if not match(self.res_num, `spin.num`):
                     continue

             # Skip the residue if there is no match to 'self.res_name' 
(unless it is None).
             if self.res_name != None:
 -                if not match(self.res_name, data.name):
 +                if not match(self.res_name, spin.name):
                     continue

             # Skip deselected residues.
 -            if not data.select:
 +            if not spin.select:
                 continue

             # Number of data points per residue.
 -            if self.plot_data == 'sim':
 +            if self.plot_spin == 'sim':

This variable should not have changed.  Maybe this was introduced by a
global search and replace?


                 points = cdp.sim_number
             else:
                 points = 1
 @@ -132,43 +132,43 @@
             # Loop over the data points.
             for j in xrange(points):
                 # Initialise an empty array for the individual residue 
data.
 -                res_data = [data.num, data.name, None, None, None, None]
 +                res_spin = [spin.num, spin.name, None, None, None, None]

Again global replace?  res_data should not be renamed.



                 # Residue number on the x-axis.
 -                if self.x_data_type == 'res':
 -                    res_data[2] = data.num
 +                if self.x_spin_type == 'res':
 +                    res_spin[2] = spin.num

Both self.x_data_type and res_data should not have changed names.
Many of the changes below this have variables which shouldn't have had
name changes, but I don't think I need to point out each one.  They
are quite numerous, so maybe it would be best to revert this revision,
and start again?

Cheers,

Edward



                 # Parameter value for the x-axis.
                 else:
                     # Get the x-axis values and errors.
 -                    if self.plot_data == 'sim':
 -                        res_data[2], res_data[3] = 
self.x_return_value(self.run, i, self.x_data_type, sim=j)
 +                    if self.plot_spin == 'sim':
 +                        res_spin[2], res_spin[3] = 
self.x_return_value(self.run, i, self.x_spin_type, sim=j)
                     else:
 -                        res_data[2], res_data[3] = 
self.x_return_value(self.run, i, self.x_data_type)
 +                        res_spin[2], res_spin[3] = 
self.x_return_value(self.run, i, self.x_spin_type)

                 # Get the y-axis values and errors.
 -                if self.plot_data == 'sim':
 -                    res_data[4], res_data[5] = 
self.y_return_value(self.run, i, self.y_data_type, sim=j)
 +                if self.plot_spin == 'sim':
 +                    res_spin[4], res_spin[5] = 
self.y_return_value(self.run, i, self.y_spin_type, sim=j)
                 else:
 -                    res_data[4], res_data[5] = 
self.y_return_value(self.run, i, self.y_data_type)
 +                    res_spin[4], res_spin[5] = 
self.y_return_value(self.run, i, self.y_spin_type)

                 # Go to the next residue if there is missing data.
 -                if res_data[2] == None or res_data[4] == None:
 +                if res_spin[2] == None or res_spin[4] == None:
                     continue

                 # X-axis conversion factors.
 -                if self.x_data_type != 'res':
 -                    res_data[2] = array(res_data[2]) / 
self.x_return_conversion_factor(self.x_data_type)
 -                    if res_data[3]:
 -                        res_data[3] = array(res_data[3]) / 
self.x_return_conversion_factor(self.x_data_type)
 +                if self.x_spin_type != 'res':
 +                    res_spin[2] = array(res_spin[2]) / 
self.x_return_conversion_factor(self.x_spin_type)
 +                    if res_spin[3]:
 +                        res_spin[3] = array(res_spin[3]) / 
self.x_return_conversion_factor(self.x_spin_type)

                 # Y-axis conversion factors.
 -                res_data[4] = array(res_data[4]) / 
self.y_return_conversion_factor(self.y_data_type)
 -                if res_data[5]:
 -                    res_data[5] = array(res_data[5]) / 
self.y_return_conversion_factor(self.y_data_type)
 +                res_spin[4] = array(res_spin[4]) / 
self.y_return_conversion_factor(self.y_spin_type)
 +                if res_spin[5]:
 +                    res_spin[5] = array(res_spin[5]) / 
self.y_return_conversion_factor(self.y_spin_type)

                 # Append the array to the full data structure.
 -                self.data.append(res_data)
 +                self.spin.append(res_spin)


     def view(self, file=None, dir=None, grace_exe='xmgrace'):


 _______________________________________________
 relax (http://nmr-relax.com)

 This is the relax-commits mailing list
 relax-commits@xxxxxxx

 To unsubscribe from this list, get a password
 reminder, or change your subscription options,
 visit the list information page at
 https://mail.gna.org/listinfo/relax-commits




Related Messages


Powered by MHonArc, Updated Thu Apr 03 22:22:21 2008