mailr19942 - in /branches/relax_disp: ./ pipe_control/value.py


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

Header


Content

Posted by edward on June 07, 2013 - 13:46:
Author: bugman
Date: Fri Jun  7 13:46:13 2013
New Revision: 19942

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

........
  r19940 | bugman | 2013-06-07 13:45:04 +0200 (Fri, 07 Jun 2013) | 6 lines
  
  Bug fix for the value.write user function for list or dictionary type data.
  
  This is for the case where the variable of one spin is set to None rather 
than a list or dictionary
  type.
........

Modified:
    branches/relax_disp/   (props changed)
    branches/relax_disp/pipe_control/value.py

Propchange: branches/relax_disp/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Jun  7 13:46:13 2013
@@ -1,1 +1,1 @@
-/trunk:1-19934
+/trunk:1-19941

Modified: branches/relax_disp/pipe_control/value.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/pipe_control/value.py?rev=19942&r1=19941&r2=19942&view=diff
==============================================================================
--- branches/relax_disp/pipe_control/value.py (original)
+++ branches/relax_disp/pipe_control/value.py Fri Jun  7 13:46:13 2013
@@ -584,6 +584,10 @@
                 data_names.append('value_%s' % i)
                 error_names.append('error_%s' % i)
 
+        # None.
+        elif value == None:
+            pass
+
         # Simple values.
         else:
             # Sanity check.
@@ -612,11 +616,11 @@
             # Loop over the keys.
             for key in data_names:
                 # Append the scaled values and errors.
-                if key not in value:
+                if value == None or key not in value:
                     values[-1].append(None)
                 else:
                     values[-1].append(scale(value[key], scaling))
-                if key not in error:
+                if error == None or key not in error:
                     errors[-1].append(None)
                 else:
                     errors[-1].append(scale(error[key], scaling))
@@ -630,8 +634,25 @@
             # Loop over the data.
             for i in range(len(data_names)):
                 # Append the scaled values and errors.
-                values[-1].append(scale(value[i], scaling))
-                errors[-1].append(scale(error[i], scaling))
+                if value == None:
+                    values[-1].append(None)
+                else:
+                    values[-1].append(scale(value[i], scaling))
+                if error == None:
+                    errors[-1].append(None)
+                else:
+                    errors[-1].append(scale(error[i], scaling))
+
+        # None.
+        elif value == None:
+            # Initialise the lists.
+            values.append([])
+            errors.append([])
+
+            # Loop over the data.
+            for i in range(len(data_names)):
+                values[-1].append(None)
+                errors[-1].append(None)
 
         # Simple values.
         else:




Related Messages


Powered by MHonArc, Updated Fri Jun 07 14:00:02 2013