mailr25087 - /trunk/pipe_control/value.py


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

Header


Content

Posted by tlinnet on August 19, 2014 - 18:43:
Author: tlinnet
Date: Tue Aug 19 18:43:07 2014
New Revision: 25087

URL: http://svn.gna.org/viewcvs/relax?rev=25087&view=rev
Log:
Fix for earlier bug fix destroyed functionality.

Altering the data-keys to early, meant that data was not fetched correctly.

This is related to:
https://gna.org/support/index.php?3121
sr #3121: Support request for replacing space in header files for the 
value.write functions

Modified:
    trunk/pipe_control/value.py

Modified: trunk/pipe_control/value.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/pipe_control/value.py?rev=25087&r1=25086&r2=25087&view=diff
==============================================================================
--- trunk/pipe_control/value.py (original)
+++ trunk/pipe_control/value.py Tue Aug 19 18:43:07 2014
@@ -554,10 +554,8 @@
             for key in keys:
                 # Add the data and error names if new.
                 if key not in data_names:
-                    # Replace all spaces " " with "_".
-                    key_str = key.replace(" ", "_")
-                    data_names.append(key_str)
-                    error_names.append('sd(%s)' % key_str)
+                    data_names.append(key)
+                    error_names.append('sd(%s)' % key)
 
         # List type data.
         elif isinstance(value, list):
@@ -646,6 +644,20 @@
             values.append(scale(value, scaling))
             errors.append(scale(error, scaling))
 
+    # Replace all spaces " " with "_" in data_names list.
+    if isinstance(data_names, list):
+        for i, data_name in enumerate(data_names):
+            data_str = data_name.replace(" ", "_")
+            # Replace string.
+            data_names[i] = data_str
+
+    # Replace all spaces " " with "_" in error_names list.
+    if isinstance(error_names, list):
+        for i, error_name in enumerate(error_names):
+            error_str = error_name.replace(" ", "_")
+            # Replace string.
+            error_names[i] = error_str
+
     # Write the data.
     write_spin_data(file, mol_names=mol_names, res_nums=res_nums, 
res_names=res_names, spin_nums=spin_nums, spin_names=spin_names, data=values, 
data_name=data_names, error=errors, error_name=error_names)
 




Related Messages


Powered by MHonArc, Updated Wed Aug 20 14:00:03 2014