mailRe: r13103 - /branches/inversion-recovery/specific_fns/relax_fit.py


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

Header


Content

Posted by Edward d'Auvergne on June 17, 2011 - 17:10:
Oh, ok, it's a bug.  If I type at the python prompt:

if 'exp_2param_inv_neg':
...  print "a"
...

it will always print 'a'.  A string always evaluates true.  Therefore
the bug is in the lines:

if model == 'exp_2param' or 'exp_2param_neg' or 'exp_2param_inv' or
'exp_2param_inv_neg':

and the elif following.  The last three is evaluating a string, and
does not involve the model variable.  You could instead put all
strings into a list, and ask 'if model in [...]:' to get the correct
behaviour.

Regards,

Edward



On 17 June 2011 17:06, Edward d'Auvergne <edward@xxxxxxxxxxxxx> wrote:
Ok, running the following works fine:

$ ./relax test_suite/system_tests/scripts/relax_fit.py

but I am not sure why!  Need to look into it more.

Regards,

Edward



On 17 June 2011 16:49, Edward d'Auvergne <edward@xxxxxxxxxxxxx> wrote:
Hmmm, that is not normal.  I will have to have a look.

Regards,

Edward



On 17 June 2011 16:37, Sébastien Morin <sebastien.morin.1@xxxxxxxxx> wrote:
Hi Ed,

I am currently looking into this and just realized that the system tests
suite still passes without failure, although the option 'exp' is not valid
anymore for function 'relax_fit.select_model()'...

Any idea why the test does not fail yet (since I kind of deactivated the
option 'exp' and replaced it with 'exp_2param_neg')..?

Cheers,


Séb  :)


On 11-06-17 4:14 PM, Edward d'Auvergne wrote:

Hi Seb,

The changes are looking good.  I would suggest coming up with a simple
system test for the inversion recovery with some fake peak lists where
the intensities are from known exponential functions you create
yourself.  Unless you have some real data in the group.  This would be
very useful to be sure that the code is fully operational and bug
free, and remains that way.

Cheers,

Edward



On 17 June 2011 14:40,<sebastien.morin@xxxxxxxxx>  wrote:

Author: semor
Date: Fri Jun 17 14:40:30 2011
New Revision: 13103

URL: http://svn.gna.org/viewcvs/relax?rev=13103&view=rev
Log:

Modified the specific function 'relax_fit.select_model()' to handle two
of the new exponential names.

The 'exp' function now is named 'exp_2param_neg' and the 'inv' function,
'exp_3param_inv_neg'.


Modified:
   branches/inversion-recovery/specific_fns/relax_fit.py

Modified: branches/inversion-recovery/specific_fns/relax_fit.py
URL:
http://svn.gna.org/viewcvs/relax/branches/inversion-recovery/specific_fns/relax_fit.py?rev=13103&r1=13102&r2=13103&view=diff

==============================================================================
--- branches/inversion-recovery/specific_fns/relax_fit.py (original)
+++ branches/inversion-recovery/specific_fns/relax_fit.py Fri Jun 17
14:40:30 2011
@@ -1,6 +1,7 @@

 
###############################################################################
 #
      #
 # Copyright (C) 2004-2009 Edward d'Auvergne
      #
+# Copyright (C) 2011 Sebastien Morin
     #
 #
      #
 # This file is part of the program relax.
      #
 #
      #
@@ -461,10 +462,12 @@
        cdp.relax_times[spectrum_id] = time


-    def _select_model(self, model='exp'):
+    def _select_model(self, model='exp_2param_neg'):
        """Function for selecting the model of the exponential curve.

-        @keyword model: The exponential curve type.  Can be one of 
'exp'
or 'inv'.
+        @keyword model: The exponential curve type.  Can be one of 8
functions: 'exp_2param',
+                        'exp_2param_neg', 'exp_2param_inv_neg',
'exp_3param', 'exp_3param_neg',
+                        'exp_3param_inv', or 'exp_3param_inv_neg'.
        @type model:    str
        """

@@ -480,13 +483,13 @@
        if not exists_mol_res_spin_data():
            raise RelaxNoSequenceError

-        # Two parameter exponential fit.
-        if model == 'exp':
-            print("Two parameter exponential fit.")
+        # Two parameter exponential decay fit.
+        if model == 'exp_2param_neg':
+            print("Two parameter exponential decay fit.")
            params = ['Rx', 'I0']

        # Three parameter inversion recovery fit.
-        elif model == 'inv':
+        elif model == 'exp_3param_inv_neg':
            print("Three parameter inversion recovery fit.")
            params = ['Rx', 'I0', 'Iinf']



_______________________________________________
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

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

This is the relax-devel mailing list
relax-devel@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-devel

--
Sébastien Morin, Ph.D.
Postdoctoral Fellow, S. Grzesiek NMR Laboratory
Department of Structural Biology
Biozentrum, Universität Basel
Klingelbergstrasse 70
4056 Basel
Switzerland







Related Messages


Powered by MHonArc, Updated Fri Jun 17 17:40:20 2011