mailRe: r11345 - /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 July 27, 2010 - 09:25:
Hi Michael,

I have a few more recommendations:

- Again the 'view_plots' boolean argument should be at the end.

- The 'filename' argument is confusing and must be changed.  If I am
scripting and I ask for my output file to be called 'super_rates.txt',
I will end up with 'super_rates.txt.out'.  This will break my
scripting - I must get what I ask for!  However in this function it is
now being used as a file root for the output file, the Grace file, and
the save state.  There are two options.  The first is to rename it to
'file_root' and then specifically document that file_root+'.out',
grace_dir+file_root+'.agr', and  file_root+'.save' will be created.
The second is to not add '.out' to the file and to not use this for
the grace file (as it will be in the user specific grace output dir)
or the save file.  We can have different arguments for the save state
file and the grace files if needed.  For me the second option is more
flexible for the future.

Cheers,

Edward



On 27 July 2010 03:40,  <michael.bieri@xxxxxxxxxxxxx> wrote:
Author: michaelbieri
Date: Tue Jul 27 03:40:04 2010
New Revision: 11345

URL: http://svn.gna.org/viewcvs/relax?rev=11345&view=rev
Log:
Filename for save files can be specified.

Default filename is 'rx'. Changes affect the output files rx.out, rx.agr, 
rx.save.

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=11345&r1=11344&r2=11345&view=diff
==============================================================================
--- branches/bieri_gui/auto_analyses/relax_fit.py (original)
+++ branches/bieri_gui/auto_analyses/relax_fit.py Tue Jul 27 03:40:04 2010
@@ -29,9 +29,11 @@


 class Relax_fit:
-    def __init__(self, pipe_name='rx', seq_args=None, file_names=None, 
relax_times=None, , view_plots=True, int_method='height', mc_num=500):
+    def __init__(self, filename='rx', pipe_name='rx', seq_args=None, 
file_names=None, relax_times=None, , view_plots=True, int_method='height', 
mc_num=500):
        """Perform relaxation curve fitting.

+        @keyword filename:      Name of the output file.
+        @type filename:         str
        @keyword pipe_name:     The name of the data pipe to create.
        @type pipe_name:        str
        @keyword seq_args:      The sequence data (file name, dir, 
mol_name_col, res_num_col, res_name_col, spin_num_col, spin_name_col, sep). 
 These are the arguments to the  sequence.read() user function, for more 
information please see the documentation for that function.
@@ -49,6 +51,7 @@
        """

        # Store the args.
+        self.filename = filename
        self.pipe_name = pipe_name
        self.seq_args = seq_args
        self.file_names = file_names
@@ -116,7 +119,7 @@
        self.interpreter.monte_carlo.error_analysis()

        # Save the relaxation rates.
-        self.interpreter.value.write(param='rx', file='rx.out', force=True)
+        self.interpreter.value.write(param='rx', 
file=self.filename+'.out', force=True)

        # Save the results.
        self.interpreter.results.write(file='results', force=True)
@@ -124,7 +127,7 @@
        # Create Grace plots of the data.
        self.interpreter.grace.write(y_data_type='chi2', file='chi2.agr', 
force=True)    # Minimised chi-squared value.
        self.interpreter.grace.write(y_data_type='i0', file='i0.agr', 
force=True)    # Initial peak intensity.
-        self.interpreter.grace.write(y_data_type='rx', file='rx.agr', 
force=True)    # Relaxation rate.
+        self.interpreter.grace.write(y_data_type='rx', 
file=self.filename+'.agr', force=True)    # Relaxation rate.
        self.interpreter.grace.write(x_data_type='relax_times', 
y_data_type='int', file='intensities.agr', force=True)    # Average peak 
intensities.
        self.interpreter.grace.write(x_data_type='relax_times', 
y_data_type='int', norm=True, file='intensities_norm.agr', force=True)    # 
Average peak intensities (normalised).

@@ -137,7 +140,7 @@
            self.interpreter.grace.view(file='intensities_norm.agr')

        # Save the program state.
-        self.interpreter.state.save('rx.save', force=True)
+        self.interpreter.state.save(self.filename+'.save', force=True)


    def check_vars(self):


_______________________________________________
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 Tue Jul 27 09:40:23 2010