mailRe: r25685 - /trunk/pipe_control/mol_res_spin.py


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

Header


Content

Posted by Edward d'Auvergne on September 10, 2014 - 10:08:
Hi Troels,

The best way to fix this one might be to revert the commit, then
introduce the spin_id_col argument into the already existing
select.display user function.  This must be optional so that the
default behaviour matches all of the other *.write user functions
(e.g. http://www.nmr-relax.com/manual/value_write.html) where the
mol_name, res_num, res_name, spin_num, spin_name, (data, error) are
output by default.  For the general relax design, the behaviour of all
*.write user functions should be kept consistent.  Also for the
matching *.display user functions.  And the matching *.read user
functions:

$ grep "add_uf('.*\.display'\|add_uf('.*\.read'\|add_uf('.*\.write'"
user_functions/*

If one change is made in one, it must be made in all!  This is simply
to keep everything consistent throughout the UI to avoid user
confusion.  If the spin_id_col argument is optional, defaults to
False, and inserts the column between the last spin info column and
the data column, then I can slowly migrate all these functions
one-by-one to match.  If the spin_id_col argument is introduced in
select.display it will, without question, be added to all *.display
and *.write user functions in relax!

The idea for the select user function class is that we will have a
select.write user function in the future, for outputting the
selections to a text file.  This would pair with the select.read (and
deselect.read) to read them back in, though these user functions might
need to change a little.  The select.write and select.display would
essentially be identical except that one outputs to sys.stdout and the
other to a file.  This would then match the other *.display, *.read,
and *.write user function combinations.

Cheers,

Edward

On 8 September 2014 19:33, Edward d'Auvergne <edward@xxxxxxxxxxxxx> wrote:
Hi Troels,

The spin ID is ok, though it should be an optional flag as this change
will cause problems for users and all other elements are optional.
But the selection should not be printed.  The reason is because you
are duplicating the exact functionality of the select.display user
function (http://www.nmr-relax.com/manual/select_display.html).  If
you want the spin ID for that user function, introduce it as an
argument.

Regards,

Edward

On 8 September 2014 18:49,  <tlinnet@xxxxxxxxxxxxx> wrote:
Author: tlinnet
Date: Mon Sep  8 18:49:34 2014
New Revision: 25685

URL: http://svn.gna.org/viewcvs/relax?rev=25685&view=rev
Log:
For the user function, spin.display(), added the print out of spin id, and 
status for selection.

This is to help with showing the spin id string for selection, and the 
current status of selection.

task #7826(https://gna.org/task/index.php?7826): Write an python class for 
the repeated analysis of dispersion data.

Modified:
    trunk/pipe_control/mol_res_spin.py

Modified: trunk/pipe_control/mol_res_spin.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/pipe_control/mol_res_spin.py?rev=25685&r1=25684&r2=25685&view=diff
==============================================================================
--- trunk/pipe_control/mol_res_spin.py  (original)
+++ trunk/pipe_control/mol_res_spin.py  Mon Sep  8 18:49:34 2014
@@ -1141,12 +1141,12 @@
     """

     # Print a header.
-    print("\n\n%-15s %-15s %-15s %-15s %-15s" % ("Molecule", "Res 
number", "Res name", "Spin number", "Spin name"))
+    print("\n\n%-15s %-15s %-15s %-15s %-15s %-15s %-15s" % ("Molecule", 
"Res number", "Res name", "Spin number", "Spin name", "Spin id", 
"Selected"))

     # Spin loop.
-    for spin, mol_name, res_num, res_name in spin_loop(spin_id, 
full_info=True):
+    for spin, mol_name, res_num, res_name, spin_id in spin_loop(spin_id, 
full_info=True, return_id=True, skip_desel=False):
         # Print the residue data.
-        print("%-15s %-15s %-15s %-15s %-15s" % (mol_name, repr(res_num), 
res_name, repr(spin.num), spin.name))
+        print("%-15s %-15s %-15s %-15s %-15s %-15s %-15s" % (mol_name, 
repr(res_num), res_name, repr(spin.num), spin.name, spin_id, spin.select))


 def exists_mol_res_spin_data(pipe=None):


_______________________________________________
relax (http://www.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 Wed Sep 10 19:40:14 2014