mailr10816 - /1.3/auto_analyses/stereochem_analysis.py


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

Header


Content

Posted by edward on February 22, 2010 - 14:31:
Author: bugman
Date: Mon Feb 22 14:31:21 2010
New Revision: 10816

URL: http://svn.gna.org/viewcvs/relax?rev=10816&view=rev
Log:
The number of ensembles string is now more nicely formatted in the subtitle.

This is in Stereochem_analysis.grace_plots().


Modified:
    1.3/auto_analyses/stereochem_analysis.py

Modified: 1.3/auto_analyses/stereochem_analysis.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/auto_analyses/stereochem_analysis.py?rev=10816&r1=10815&r2=10816&view=diff
==============================================================================
--- 1.3/auto_analyses/stereochem_analysis.py (original)
+++ 1.3/auto_analyses/stereochem_analysis.py Mon Feb 22 14:31:21 2010
@@ -200,8 +200,34 @@
             else:
                 colours.append(0)
 
+        # The ensemble number text.
+        ens_text = ''
+        dividers = [1e15, 1e12, 1e9, 1e6, 1e3, 1]
+        num_ens = self.num_ens
+        for i in range(len(dividers)):
+            # The number.
+            num = int(num_ens / dividers[i])
+
+            # The text.
+            if num:
+                text = repr(num)
+            elif not num and ens_text:
+                text = '000'
+            else:
+                continue
+
+            # Update the text.
+            ens_text = ens_text + text
+
+            # A comma.
+            if i < len(dividers)-1:
+                ens_text = ens_text + ','
+
+            # Remove the front part of the number.
+            num_ens = num_ens - dividers[i]*num
+
         # Subtitle for all graphs.
-        subtitle = '%s ensembles of %s' % (self.num_ens, self.num_models)
+        subtitle = '%s ensembles of %s' % (ens_text, self.num_models)
 
         # NOE violations.
         if access(self.results_dir+sep+"NOE_viol_" + self.configs[0] + 
"_sorted", F_OK):




Related Messages


Powered by MHonArc, Updated Mon Feb 22 15:20:07 2010