Author: bugman Date: Tue Jul 8 22:25:44 2008 New Revision: 6853 URL: http://svn.gna.org/viewcvs/relax?rev=6853&view=rev Log: Fixes for the read() function to allow the error column to be missing. Modified: branches/rdc_analysis/generic_fns/rdc.py Modified: branches/rdc_analysis/generic_fns/rdc.py URL: http://svn.gna.org/viewcvs/relax/branches/rdc_analysis/generic_fns/rdc.py?rev=6853&r1=6852&r2=6853&view=diff ============================================================================== --- branches/rdc_analysis/generic_fns/rdc.py (original) +++ branches/rdc_analysis/generic_fns/rdc.py Tue Jul 8 22:25:44 2008 @@ -601,7 +601,9 @@ # Skip missing data. if len(file_data[i]) <= min_col_num: continue - elif file_data[i][data_col] == 'None' or file_data[i][error_col] == 'None': + elif file_data[i][data_col] == 'None': + continue + elif error_col and file_data[i][error_col] == 'None': continue # Test that the data are numbers. @@ -611,7 +613,8 @@ if spin_num_col != None: int(file_data[i][spin_num_col]) float(file_data[i][data_col]) - float(file_data[i][error_col]) + if error_col: + float(file_data[i][error_col]) except ValueError: raise RelaxError, "The RDC data in the line " + `file_data[i]` + " is invalid." @@ -645,7 +648,7 @@ error = eval(file_data[i][error_col]) # Skip all rows where the value or error is None. - if value == None or error == None: + if value == None or (error_col and error == None): continue # Get the corresponding spin container.