Author: bugman Date: Fri Jun 7 13:45:04 2013 New Revision: 19940 URL: http://svn.gna.org/viewcvs/relax?rev=19940&view=rev Log: 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: trunk/pipe_control/value.py Modified: trunk/pipe_control/value.py URL: http://svn.gna.org/viewcvs/relax/trunk/pipe_control/value.py?rev=19940&r1=19939&r2=19940&view=diff ============================================================================== --- trunk/pipe_control/value.py (original) +++ trunk/pipe_control/value.py Fri Jun 7 13:45:04 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: