[prev in list] [next in list] [prev in thread] [next in thread] 

List:       relax-devel
Subject:    Re: r5268 - /1.3/generic_fns/grace.py
From:       Sébastien_Morin <sebastien.morin.1 () domain ! hid>
Date:       2008-04-03 20:17:43
Message-ID: 47F53B67.7010408 () domain ! hid
[Download RAW message or body]

Hi again...

I'll revert the change as you proposed and make the correct 
modifications after... I'll also check if I introduced the same kind of 
errors elsewhere.

Ciao


Séb


Edward d'Auvergne wrote:
> 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@domain.hid> 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@domain.hid>)
> > 
> > 
> > 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@domain.hid
> > 
> > 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
> > 
> > 
> 
> _______________________________________________
> relax (http://nmr-relax.com)
> 
> This is the relax-devel mailing list
> relax-devel@domain.hid
> 
> 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-devel
> 
> 


[Attachment #3 (text/html)]

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi again...<br>
<br>
I'll revert the change as you proposed and make the correct
modifications after... I'll also check if I introduced the same kind of
errors elsewhere.<br>
<br>
Ciao<br>
<br>
<br>
S&eacute;b<br>
<br>
<br>
Edward d'Auvergne wrote:
<blockquote
 cite="mid:7f080ed10804031148r75a295a2u99569bb13b99ffc5@domain.hid"
 type="cite">
  <pre wrap="">Hi,

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


On Thu, Apr 3, 2008 at 7:04 PM,  <a class="moz-txt-link-rfc2396E" \
href="mailto:sebastien.morin.1@domain.hid">&lt;sebastien.morin.1@domain.hid&gt;</a> \
wrote:  </pre>
  <blockquote type="cite">
    <pre wrap="">Author: semor
 Date: Thu Apr  3 19:04:26 2008
 New Revision: 5268

 URL: <a class="moz-txt-link-freetext" \
href="http://svn.gna.org/viewcvs/relax?rev=5268&view=rev">http://svn.gna.org/viewcvs/relax?rev=5268&amp;view=rev</a>
  Log:
 Changed "for i in xrange(len(cdp.res)):" to the spin_loop.

 This was proposed by Edward d'Auvergne in a post at :
 <a class="moz-txt-link-freetext" \
href="https://mail.gna.org/public/relax-devel/2008-04/msg00012.html">https://mail.gna.org/public/relax-devel/2008-04/msg00012.html</a> \
(Message-id:  <a class="moz-txt-link-rfc2396E" \
href="mailto:7f080ed10804030926p4be2e72apa2ccef85a9062e57@domain.hid">&lt;7f080ed10804030926p4be2e72apa2ccef85a9062e57@domain.hid&gt;</a>)



 Modified:
    1.3/generic_fns/grace.py

 Modified: 1.3/generic_fns/grace.py
 URL: <a class="moz-txt-link-freetext" \
href="http://svn.gna.org/viewcvs/relax/1.3/generic_fns/grace.py?rev=5268&r1=5267&r2=52 \
68&view=diff">http://svn.gna.org/viewcvs/relax/1.3/generic_fns/grace.py?rev=5268&amp;r1=5267&amp;r2=5268&amp;view=diff</a>
  ==============================================================================
 --- 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':
    </pre>
  </blockquote>
  <pre wrap=""><!---->
This variable should not have changed.  Maybe this was introduced by a
global search and replace?


  </pre>
  <blockquote type="cite">
    <pre wrap="">                 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]
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Again global replace?  res_data should not be renamed.



  </pre>
  <blockquote type="cite">
    <pre wrap="">                 # 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
    </pre>
  </blockquote>
  <pre wrap=""><!---->
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



  </pre>
  <blockquote type="cite">
    <pre wrap="">                 # 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 (<a class="moz-txt-link-freetext" \
href="http://nmr-relax.com">http://nmr-relax.com</a>)

 This is the relax-commits mailing list
 <a class="moz-txt-link-abbreviated" \
href="mailto:relax-commits@domain.hid">relax-commits@domain.hid</a>

 To unsubscribe from this list, get a password
 reminder, or change your subscription options,
 visit the list information page at
 <a class="moz-txt-link-freetext" \
href="https://mail.gna.org/listinfo/relax-commits">https://mail.gna.org/listinfo/relax-commits</a>


    </pre>
  </blockquote>
  <pre wrap=""><!---->
_______________________________________________
relax (<a class="moz-txt-link-freetext" \
href="http://nmr-relax.com">http://nmr-relax.com</a>)

This is the relax-devel mailing list
<a class="moz-txt-link-abbreviated" \
href="mailto:relax-devel@domain.hid">relax-devel@domain.hid</a>

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
<a class="moz-txt-link-freetext" \
href="https://mail.gna.org/listinfo/relax-devel">https://mail.gna.org/listinfo/relax-devel</a>


  </pre>
</blockquote>
</body>
</html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic