mailr23233 - in /branches/frame_order_cleanup: ./ pipe_control/structure/main.py user_functions/structure.py


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

Header


Content

Posted by edward on May 19, 2014 - 12:16:
Author: bugman
Date: Mon May 19 12:16:12 2014
New Revision: 23233

URL: http://svn.gna.org/viewcvs/relax?rev=23233&view=rev
Log:
Merged revisions 23232 via svnmerge from 
svn+ssh://bugman@xxxxxxxxxxx/svn/relax/trunk

........
  r23232 | bugman | 2014-05-19 12:09:17 +0200 (Mon, 19 May 2014) | 7 lines
  
  Expanded the structure.delete user function to add the 'verbosity' and 
'spin_info' arguments.
  
  The verbosity argument, when set to zero, allows all output to be 
suppressed.  The spin_info flag
  allows the deletion of spin and interatomic data to now be turned off, so 
that only 3D data is
  deleted.
........

Modified:
    branches/frame_order_cleanup/   (props changed)
    branches/frame_order_cleanup/pipe_control/structure/main.py
    branches/frame_order_cleanup/user_functions/structure.py

Propchange: branches/frame_order_cleanup/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon May 19 12:16:12 2014
@@ -1 +1 @@
-/trunk:1-23230
+/trunk:1-23232

Modified: branches/frame_order_cleanup/pipe_control/structure/main.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/pipe_control/structure/main.py?rev=23233&r1=23232&r2=23233&view=diff
==============================================================================
--- branches/frame_order_cleanup/pipe_control/structure/main.py (original)
+++ branches/frame_order_cleanup/pipe_control/structure/main.py Mon May 19 
12:16:12 2014
@@ -293,11 +293,15 @@
     status.observers.result_file.notify()
 
 
-def delete(atom_id=None):
+def delete(atom_id=None, verbosity=1, spin_info=True):
     """Delete structural data.
     
     @keyword atom_id:   The molecule, residue, and atom identifier string.  
This matches the spin ID string format.  If not given, then all structural 
data will be deleted.
     @type atom_id:      str or None
+    @keyword verbosity: The amount of information to print to screen.  Zero 
corresponds to minimal output while higher values increase the amount of 
output.  The default value is 1.
+    @type verbosity:    int
+    @keyword spin_info: A flag which if True will cause all structural 
information in the spin containers and interatomic data containers to be 
deleted as well.  If False, then only the 3D structural data will be deleted.
+    @type spin_info:    bool
     """
 
     # Test if the current data pipe exists.
@@ -305,20 +309,27 @@
 
     # Run the object method.
     if hasattr(cdp, 'structure'):
-        print("Deleting structural data from the current pipe.")
+        if verbosity:
+            print("Deleting structural data from the current pipe.")
         cdp.structure.delete(atom_id=atom_id)
-    else:
+    elif verbosity:
         print("No structures are present.")
 
+    # Skip the rest.
+    if not spin_info:
+        return
+
     # Then remove any spin specific structural info.
-    print("Deleting all spin specific structural info.")
+    if verbosity:
+        print("Deleting all spin specific structural info.")
     for spin in spin_loop(selection=atom_id):
         # Delete positional information.
         if hasattr(spin, 'pos'):
             del spin.pos
 
     # Then remove any interatomic vector structural info.
-    print("Deleting all interatomic vectors.")
+    if verbosity:
+        print("Deleting all interatomic vectors.")
     for interatom in interatomic_loop(selection1=atom_id):
         # Delete bond vectors.
         if hasattr(interatom, 'vector'):

Modified: branches/frame_order_cleanup/user_functions/structure.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/user_functions/structure.py?rev=23233&r1=23232&r2=23233&view=diff
==============================================================================
--- branches/frame_order_cleanup/user_functions/structure.py    (original)
+++ branches/frame_order_cleanup/user_functions/structure.py    Mon May 19 
12:16:12 2014
@@ -426,6 +426,20 @@
     desc_short = "atom ID string",
     desc = "The atom identification string.",
     can_be_none = True
+)
+uf.add_keyarg(
+    name = "verbosity",
+    default = 1,
+    py_type = "int",
+    desc_short = "verbosity level",
+    desc = "The amount of information to print out.  Set to zero to silence 
the user function, or one to see all messages."
+)
+uf.add_keyarg(
+    name = "spin_info",
+    default = True,
+    py_type = "bool",
+    desc_short = "spin information flag",
+    desc = "A flag which if True will cause all structural information in 
the spin containers and interatomic data containers to be deleted as well.  
If False, then only the 3D structural data will be deleted."
 )
 # Description.
 uf.desc.append(Desc_container())




Related Messages


Powered by MHonArc, Updated Mon May 19 12:40:02 2014