mailr27805 - in /trunk: lib/plotting/ test_suite/system_tests/


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

Header


Content

Posted by edward on March 10, 2015 - 18:58:
Author: bugman
Date: Tue Mar 10 18:58:41 2015
New Revision: 27805

URL: http://svn.gna.org/viewcvs/relax?rev=27805&view=rev
Log:
Modified the internal formatting of the data section of the Grace 2D graph 
files.

This affects the lib.plotting.grace.write_xy_data() function.  The formatting 
is now more
consistent, with the X value now set to a fixed number of decimal places, and 
hence will no longer
change between Python 2 and 3.  The data is now all right justified as well, 
for easier reading.

All affected system tests have been updated for the new format.


Modified:
    trunk/lib/plotting/grace.py
    trunk/test_suite/system_tests/noe.py
    trunk/test_suite/system_tests/pcs.py
    trunk/test_suite/system_tests/rdc.py
    trunk/test_suite/system_tests/relax_fit.py

Modified: trunk/lib/plotting/grace.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/lib/plotting/grace.py?rev=27805&r1=27804&r2=27805&view=diff
==============================================================================
--- trunk/lib/plotting/grace.py (original)
+++ trunk/lib/plotting/grace.py Tue Mar 10 18:58:41 2015
@@ -184,7 +184,7 @@
                     continue
 
                 # X and Y data.
-                file.write("%-30s %-30.15f" % (point[0], point[1]/norm_fact))
+                file.write("%30.15f %30.15f" % (point[0], 
point[1]/norm_fact))
 
                 # The dx and dy errors.
                 if graph_type in ['xydx', 'xydy', 'xydxdy']:
@@ -198,7 +198,7 @@
                         error = 0.0
 
                     # Write the error.
-                    file.write(" %-30.15f" % (error/norm_fact))
+                    file.write(" %30.15f" % (error/norm_fact))
 
                 # The dy errors of xydxdy.
                 if graph_type == 'xydxdy':
@@ -208,11 +208,11 @@
                         error = 0.0
 
                     # Write the error.
-                    file.write(" %-30.15f" % (error/norm_fact))
+                    file.write(" %30.15f" % (error/norm_fact))
 
                 # The comment if given.
                 try:
-                    file.write("%30s \"# %s\"" % ('', point[comment_col]))
+                    file.write("    \"%s\"" % point[comment_col])
                 except IndexError:
                     pass
 

Modified: trunk/test_suite/system_tests/noe.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/test_suite/system_tests/noe.py?rev=27805&r1=27804&r2=27805&view=diff
==============================================================================
--- trunk/test_suite/system_tests/noe.py        (original)
+++ trunk/test_suite/system_tests/noe.py        Tue Mar 10 18:58:41 2015
@@ -1,6 +1,6 @@
 
###############################################################################
 #                                                                            
 #
-# Copyright (C) 2006-2014 Edward d'Auvergne                                  
 #
+# Copyright (C) 2006-2015 Edward d'Auvergne                                  
 #
 #                                                                            
 #
 # This file is part of the program relax (http://www.nmr-relax.com).         
 #
 #                                                                            
 #
@@ -210,21 +210,21 @@
             '@    s1 legend "sat_ave"\n',
             '@target G0.S0\n',
             '@type xydy\n',
-            '4                              148614.000000000000000         
3600.000000000000000          \n',
-            '5                              166842.000000000000000         
122000.000000000000000        \n',
-            '6                              128690.000000000000000         
3600.000000000000000          \n',
-            '40                             99566.000000000000000          
3600.000000000000000          \n',
-            '40                             270047.000000000000000         
3600.000000000000000          \n',
-            '55                             130959.000000000000000         
3600.000000000000000          \n',
+            '             4.000000000000000         148614.000000000000000   
        3600.000000000000000\n',
+            '             5.000000000000000         166842.000000000000000   
      122000.000000000000000\n',
+            '             6.000000000000000         128690.000000000000000   
        3600.000000000000000\n',
+            '            40.000000000000000          99566.000000000000000   
        3600.000000000000000\n',
+            '            40.000000000000000         270047.000000000000000   
        3600.000000000000000\n',
+            '            55.000000000000000         130959.000000000000000   
        3600.000000000000000\n',
             '&\n',
             '@target G0.S1\n',
             '@type xydy\n',
-            '4                              5050.000000000000000           
3000.000000000000000          \n',
-            '5                              51643.000000000000000          
8500.000000000000000          \n',
-            '6                              53663.000000000000000          
3000.000000000000000          \n',
-            '40                             -65111.000000000000000         
3000.000000000000000          \n',
-            '40                             -181131.000000000000000        
3000.000000000000000          \n',
-            '55                             -105322.000000000000000        
3000.000000000000000          \n',
+            '             4.000000000000000           5050.000000000000000   
        3000.000000000000000\n',
+            '             5.000000000000000          51643.000000000000000   
        8500.000000000000000\n',
+            '             6.000000000000000          53663.000000000000000   
        3000.000000000000000\n',
+            '            40.000000000000000         -65111.000000000000000   
        3000.000000000000000\n',
+            '            40.000000000000000        -181131.000000000000000   
        3000.000000000000000\n',
+            '            55.000000000000000        -105322.000000000000000   
        3000.000000000000000\n',
             '&\n',
             '@with g0\n',
             '@autoscale\n'
@@ -267,15 +267,15 @@
             '@    s1 legend "NE1 spins"\n',
             '@target G0.S0\n',
             '@type xydy\n',
-            '4                              0.033980647852827              
0.020203299032766             \n',
-            '5                              0.309532371944714              
0.232002467165734             \n',
-            '6                              0.416994327453571              
0.026067523940085             \n',
-            '40                             -0.653948134905490             
0.038300618865379             \n',
-            '55                             -0.804236440412648             
0.031836147771836             \n',
+            '             4.000000000000000              0.033980647852827   
           0.020203299032766\n',
+            '             5.000000000000000              0.309532371944714   
           0.232002467165734\n',
+            '             6.000000000000000              0.416994327453571   
           0.026067523940085\n',
+            '            40.000000000000000             -0.653948134905490   
           0.038300618865379\n',
+            '            55.000000000000000             -0.804236440412648   
           0.031836147771836\n',
             '&\n',
             '@target G0.S1\n',
             '@type xydy\n',
-            '40                             -0.670738797320466             
0.014260663438353             \n',
+            '            40.000000000000000             -0.670738797320466   
           0.014260663438353\n',
             '&\n',
             '@with g0\n',
             '@autoscale\n'

Modified: trunk/test_suite/system_tests/pcs.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/test_suite/system_tests/pcs.py?rev=27805&r1=27804&r2=27805&view=diff
==============================================================================
--- trunk/test_suite/system_tests/pcs.py        (original)
+++ trunk/test_suite/system_tests/pcs.py        Tue Mar 10 18:58:41 2015
@@ -117,35 +117,35 @@
             "@    s1 legend \"tb (None)\"",
             "@target G0.S0",
             "@type xy",
-            "-100                           -100.000000000000000             
                            \"# 0\"",
-            "100                            100.000000000000000              
                            \"# 0\"",
+            "          -100.000000000000000           -100.000000000000000   
 \"0\"",
+            "           100.000000000000000            100.000000000000000   
 \"0\"",
             "&",
             "@target G0.S1",
             "@type xy",
-            "1.004                          0.004000000000000                
                            \"# @C1\"",
-            "1.008                          0.008000000000000                
                            \"# @C2\"",
-            "1.021                          0.021000000000000                
                            \"# @C3\"",
-            "1.029                          0.029000000000000                
                            \"# @C4\"",
-            "1.016                          0.016000000000000                
                            \"# @C5\"",
-            "1.01                           0.010000000000000                
                            \"# @C6\"",
-            "1.008                          0.008000000000000                
                            \"# @H1\"",
-            "1.003                          0.003000000000000                
                            \"# @H2\"",
-            "1.006                          0.006000000000000                
                            \"# @H3\"",
-            "1.003                          0.003000000000000                
                            \"# @H4\"",
-            "1.007                          0.007000000000000                
                            \"# @H5\"",
-            "1.005                          0.005000000000000                
                            \"# @H6\"",
-            "1.001                          0.001000000000000                
                            \"# @H7\"",
-            "1.07                           0.070000000000000                
                            \"# @C7\"",
-            "1.025                          0.025000000000000                
                            \"# @C9\"",
-            "1.098                          0.098000000000000                
                            \"# @C10\"",
-            "1.054                          0.054000000000000                
                            \"# @C11\"",
-            "1.075                          0.075000000000000                
                            \"# @C12\"",
-            "1.065                          0.065000000000000                
                            \"# @H12\"",
-            "1.07                           0.070000000000000                
                            \"# @H14\"",
-            "1.015                          0.015000000000000                
                            \"# @H15\"",
-            "1.098                          0.098000000000000                
                            \"# @H16\"",
-            "1.06                           0.060000000000000                
                            \"# @H17\"",
-            "1.12                           0.120000000000000                
                            \"# @H18\"",
+            "             1.004000000000000              0.004000000000000   
 \"@C1\"",
+            "             1.008000000000000              0.008000000000000   
 \"@C2\"",
+            "             1.021000000000000              0.021000000000000   
 \"@C3\"",
+            "             1.029000000000000              0.029000000000000   
 \"@C4\"",
+            "             1.016000000000000              0.016000000000000   
 \"@C5\"",
+            "             1.010000000000000              0.010000000000000   
 \"@C6\"",
+            "             1.008000000000000              0.008000000000000   
 \"@H1\"",
+            "             1.003000000000000              0.003000000000000   
 \"@H2\"",
+            "             1.006000000000000              0.006000000000000   
 \"@H3\"",
+            "             1.003000000000000              0.003000000000000   
 \"@H4\"",
+            "             1.007000000000000              0.007000000000000   
 \"@H5\"",
+            "             1.005000000000000              0.005000000000000   
 \"@H6\"",
+            "             1.001000000000000              0.001000000000000   
 \"@H7\"",
+            "             1.070000000000000              0.070000000000000   
 \"@C7\"",
+            "             1.025000000000000              0.025000000000000   
 \"@C9\"",
+            "             1.098000000000000              0.098000000000000   
 \"@C10\"",
+            "             1.054000000000000              0.054000000000000   
 \"@C11\"",
+            "             1.075000000000000              0.075000000000000   
 \"@C12\"",
+            "             1.065000000000000              0.065000000000000   
 \"@H12\"",
+            "             1.070000000000000              0.070000000000000   
 \"@H14\"",
+            "             1.015000000000000              0.015000000000000   
 \"@H15\"",
+            "             1.098000000000000              0.098000000000000   
 \"@H16\"",
+            "             1.060000000000000              0.060000000000000   
 \"@H17\"",
+            "             1.120000000000000              0.120000000000000   
 \"@H18\"",
             "&"
         ]
 

Modified: trunk/test_suite/system_tests/rdc.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/test_suite/system_tests/rdc.py?rev=27805&r1=27804&r2=27805&view=diff
==============================================================================
--- trunk/test_suite/system_tests/rdc.py        (original)
+++ trunk/test_suite/system_tests/rdc.py        Tue Mar 10 18:58:41 2015
@@ -145,19 +145,19 @@
             "@    s1 legend \"tb\"",
             "@target G0.S0",
             "@type xydy",
-            "-100                           -100.000000000000000           
0.000000000000000             ",
-            "100                            100.000000000000000            
0.000000000000000             ",
+            "          -100.000000000000000           -100.000000000000000   
           0.000000000000000",
+            "           100.000000000000000            100.000000000000000   
           0.000000000000000",
             "&",
             "@target G0.S1",
             "@type xydy",
-            "-25.2501958629                 -26.250195862900000            
1.000000000000000                                            \"# 
#CaM:5@N-#CaM:5@H\"",
-            "10.9308176694                  9.930817669420000              
1.000000000000000                                            \"# 
#CaM:6@N-#CaM:6@H\"",
-            "8.26317614156                  7.263176141560000              
1.000000000000000                                            \"# 
#CaM:7@N-#CaM:7@H\"",
-            "-0.24840526981                 -1.248405269810000             
0.000000000000000                                            \"# 
#CaM:8@N-#CaM:8@H\"",
-            "6.31803314334                  5.318033143340000              
1.000000000000000                                            \"# 
#CaM:9@N-#CaM:9@H\"",
-            "15.0362909456                  14.036290945599999             
1.000000000000000                                            \"# 
#CaM:10@N-#CaM:10@H\"",
-            "2.33652530397                  1.336525303970000              
0.000000000000000                                            \"# 
#CaM:11@N-#CaM:11@H\"",
-            "-0.6021670281                  -1.602167028100000             
0.000000000000000                                            \"# 
#CaM:12@N-#CaM:12@H\"",
+            "           -25.250195862900000            -26.250195862900000   
           1.000000000000000    \"#CaM:5@N-#CaM:5@H\"",
+            "            10.930817669420000              9.930817669420000   
           1.000000000000000    \"#CaM:6@N-#CaM:6@H\"",
+            "             8.263176141559999              7.263176141560000   
           1.000000000000000    \"#CaM:7@N-#CaM:7@H\"",
+            "            -0.248405269810000             -1.248405269810000   
           0.000000000000000    \"#CaM:8@N-#CaM:8@H\"",
+            "             6.318033143340000              5.318033143340000   
           1.000000000000000    \"#CaM:9@N-#CaM:9@H\"",
+            "            15.036290945599999             14.036290945599999   
           1.000000000000000    \"#CaM:10@N-#CaM:10@H\"",
+            "             2.336525303970000              1.336525303970000   
           0.000000000000000    \"#CaM:11@N-#CaM:11@H\"",
+            "            -0.602167028100000             -1.602167028100000   
           0.000000000000000    \"#CaM:12@N-#CaM:12@H\"",
             "&",
         ]
 
@@ -166,6 +166,8 @@
         file = open(ds.tmpfile)
         lines = file.readlines()
         file.close()
+        print(real_contents)
+        print(lines)
         self.assertEqual(len(real_contents), len(lines))
         for i in range(len(lines)):
             print(lines[i][:-1])

Modified: trunk/test_suite/system_tests/relax_fit.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/test_suite/system_tests/relax_fit.py?rev=27805&r1=27804&r2=27805&view=diff
==============================================================================
--- trunk/test_suite/system_tests/relax_fit.py  (original)
+++ trunk/test_suite/system_tests/relax_fit.py  Tue Mar 10 18:58:41 2015
@@ -161,7 +161,7 @@
 
         # Check some of the Grace data.
         self.assertEqual(len(lines[index]), 3)
-        self.assertEqual(lines[index][0], '0.004')
+        self.assertEqual(lines[index][0], '0.004000000000000')
         self.assertEqual(lines[index][1], '487178.000000000000000')
         self.assertEqual(lines[index][2], '20570.000000000000000')
 




Related Messages


Powered by MHonArc, Updated Thu Mar 12 16:20:03 2015