mailRe: r10928 - /branches/bieri_gui/auto_analyses/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 February 26, 2010 - 09:20:
This is true.  In the end, I would like the auto-analyses to type
check all its arguments.  The dAuvergne_protocol module is the perfect
example of this.  If the wrong thing is sent in, a RelaxError occurs.
But this is not the role of the API to convert arguments.  The
interface is designed so you must send in what is expected.  The
epydoc tags (http://epydoc.sourceforge.net/fields.html#fields) in the
docstring explain the API, which is why I highly recommend that you
start using these in the GUI method docstrings as well (just following
along the lines of what is happening in the core.  It is better that
each UI determines what is happening with its user input data before
sending it in rather than the API trying to guess what may go wrong in
the UI and try to convert arguments accordingly.

Cheers,

Edward


On 26 February 2010 00:21, Michael Bieri <michael.bieri@xxxxxx> wrote:
That's all right, I can convert entries in the list to floats. But I
think it is not bad to have assured at several stages.

Edward d'Auvergne schrieb:
Hi,

This is crossing the boundary of the API.  The class expects that the
calling code (the GUI in this case) sends in a list of floats.
Therefore that is what must be done.  The GUI should convert to float,
and then pass it in in the correct format.

Cheers,

Edward


On 25 February 2010 05:47,  <michael.bieri@xxxxxx> wrote:

Author: michaelbieri
Date: Thu Feb 25 05:47:04 2010
New Revision: 10928

URL: http://svn.gna.org/viewcvs/relax?rev=10928&view=rev
Log:
Relaxation times are converted into float objects (from strings).

Modified:
   branches/bieri_gui/auto_analyses/relax_fit.py

Modified: branches/bieri_gui/auto_analyses/relax_fit.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/bieri_gui/auto_analyses/relax_fit.py?rev=10928&r1=10927&r2=10928&view=diff
==============================================================================
--- branches/bieri_gui/auto_analyses/relax_fit.py (original)
+++ branches/bieri_gui/auto_analyses/relax_fit.py Thu Feb 25 05:47:04 2010
@@ -107,7 +107,7 @@
            
self.interpreter.spectrum.read_intensities(file=self.file_names[i], 
spectrum_id=self.file_names[i], int_method=self.int_method, 
heteronuc='N', proton='H')

            # Set the relaxation times.
-            
self.interpreter.relax_fit.relax_time(time=self.relax_times[i], 
spectrum_id=self.file_names[i])
+            
self.interpreter.relax_fit.relax_time(time=float(self.relax_times[i]), 
spectrum_id=self.file_names[i])

        # Specify the duplicated spectra.
        for i in range(len(self.file_names)):


_______________________________________________
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



_______________________________________________
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




Related Messages


Powered by MHonArc, Updated Fri Feb 26 10:00:19 2010