mailr16965 - /branches/interatomic/generic_fns/dipole_pair.py


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

Header


Content

Posted by edward on June 19, 2012 - 18:40:
Author: bugman
Date: Tue Jun 19 18:40:20 2012
New Revision: 16965

URL: http://svn.gna.org/viewcvs/relax?rev=16965&view=rev
Log:
Added a verbose flag to the generic_fns.dipole_pair.define() function.


Modified:
    branches/interatomic/generic_fns/dipole_pair.py

Modified: branches/interatomic/generic_fns/dipole_pair.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/interatomic/generic_fns/dipole_pair.py?rev=16965&r1=16964&r2=16965&view=diff
==============================================================================
--- branches/interatomic/generic_fns/dipole_pair.py (original)
+++ branches/interatomic/generic_fns/dipole_pair.py Tue Jun 19 18:40:20 2012
@@ -40,7 +40,7 @@
 
 
 
-def define(spin_id1=None, spin_id2=None, direct_bond=False):
+def define(spin_id1=None, spin_id2=None, direct_bond=False, verbose=True):
     """Set up the magnetic dipole-dipole interaction.
 
     @keyword spin_id1:      The spin identifier string of the first spin of 
the pair.
@@ -49,6 +49,8 @@
     @type spin_id2:         str
     @keyword direct_bond:   A flag specifying if the two spins are directly 
bonded.
     @type direct_bond:      bool
+    @keyword verbose:       A flag which if True will result in print outs 
of the created interatomoic data containers.
+    @type verbose:          bool
     """
 
     # Loop over both spin selections.
@@ -77,7 +79,8 @@
             ids.append([repr(id1), repr(id2)])
 
     # Print out.
-    write_data(out=sys.stdout, headings=["Spin_ID_1", "Spin_ID_2"], data=ids)
+    if verbose and len(ids):
+        write_data(out=sys.stdout, headings=["Spin_ID_1", "Spin_ID_2"], 
data=ids)
 
 
 def read_dist(file=None, dir=None, spin_id1_col=None, spin_id2_col=None, 
data_col=None, sep=None):




Related Messages


Powered by MHonArc, Updated Tue Jun 19 19:00:01 2012