mailr19326 - /trunk/pipe_control/selection.py


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

Header


Content

Posted by edward on April 03, 2013 - 14:37:
Author: bugman
Date: Wed Apr  3 14:37:50 2013
New Revision: 19326

URL: http://svn.gna.org/viewcvs/relax?rev=19326&view=rev
Log:
Added printouts for the select.read and deselect.read user functions to 
identify the spins affected.


Modified:
    trunk/pipe_control/selection.py

Modified: trunk/pipe_control/selection.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/pipe_control/selection.py?rev=19326&r1=19325&r2=19326&view=diff
==============================================================================
--- trunk/pipe_control/selection.py (original)
+++ trunk/pipe_control/selection.py Wed Apr  3 14:37:50 2013
@@ -233,6 +233,7 @@
             spin.select = True
 
     # Then deselect the spins in the file.
+    ids = []
     for mol_name, res_num, res_name, spin_num, spin_name in 
read_spin_data(file=file, dir=dir, file_data=file_data, 
spin_id_col=spin_id_col, mol_name_col=mol_name_col, res_num_col=res_num_col, 
res_name_col=res_name_col, spin_num_col=spin_num_col, 
spin_name_col=spin_name_col, sep=sep, spin_id=spin_id):
         # Get the corresponding spin container.
         id = generate_spin_id_unique(mol_name=mol_name, res_num=res_num, 
res_name=res_name, spin_num=spin_num, spin_name=spin_name)
@@ -250,6 +251,18 @@
         # Boolean selections.
         else:
             spin.select = boolean_deselect(current=spin.select, 
boolean=boolean)
+
+        # Store the spin ID for printouts.
+        if not spin.select:
+            ids.append(id)
+
+    # Printout.
+    if not len(ids):
+        print("No spins deselected.")
+    else:
+        print("The following spins were deselected:")
+        for id in ids:
+            print(id)
 
 
 def desel_spin(spin_id=None, boolean='AND', change_all=False):
@@ -533,6 +546,7 @@
             spin.select = False
 
     # Then deselect the spins in the file.
+    ids = []
     for id in read_spin_data(file=file, dir=dir, file_data=file_data, 
spin_id_col=spin_id_col, mol_name_col=mol_name_col, res_num_col=res_num_col, 
res_name_col=res_name_col, spin_num_col=spin_num_col, 
spin_name_col=spin_name_col, sep=sep, spin_id=spin_id):
         # Get the corresponding spin container.
         spin = return_spin(id)
@@ -549,6 +563,18 @@
         # Boolean selections.
         else:
             spin.select = boolean_select(current=spin.select, 
boolean=boolean)
+
+        # Store the spin ID for printouts.
+        if spin.select:
+            ids.append(id)
+
+    # Printout.
+    if not len(ids):
+        print("No spins selected.")
+    else:
+        print("The following spins were selected:")
+        for id in ids:
+            print(id)
 
 
 def sel_spin(spin_id=None, boolean='OR', change_all=False):




Related Messages


Powered by MHonArc, Updated Wed Apr 03 14:40:02 2013