Author: bugman Date: Wed Feb 11 15:29:41 2009 New Revision: 8776 URL: http://svn.gna.org/viewcvs/relax?rev=8776&view=rev Log: Added checks for the presence of any extractable data from the file. Modified: 1.3/generic_fns/pcs.py 1.3/generic_fns/rdc.py Modified: 1.3/generic_fns/pcs.py URL: http://svn.gna.org/viewcvs/relax/1.3/generic_fns/pcs.py?rev=8776&r1=8775&r2=8776&view=diff ============================================================================== --- 1.3/generic_fns/pcs.py (original) +++ 1.3/generic_fns/pcs.py Wed Feb 11 15:29:41 2009 @@ -483,6 +483,7 @@ file_data = strip(file_data) # Test the validity of the PCS data. + missing = True for i in xrange(len(file_data)): # Skip missing data. if len(file_data[i]) <= min_col_num: @@ -504,6 +505,13 @@ float(file_data[i][error_col]) except ValueError: raise RelaxError, "The PCS data in the line " + `file_data[i]` + " is invalid." + + # Right, data is ok and exists. + missing = False + + # Hmmm, no data! + if missing: + raise RelaxError, "No corresponding data could be found within the file." # Global (non-spin specific) data. Modified: 1.3/generic_fns/rdc.py URL: http://svn.gna.org/viewcvs/relax/1.3/generic_fns/rdc.py?rev=8776&r1=8775&r2=8776&view=diff ============================================================================== --- 1.3/generic_fns/rdc.py (original) +++ 1.3/generic_fns/rdc.py Wed Feb 11 15:29:41 2009 @@ -439,6 +439,7 @@ file_data = strip(file_data) # Test the validity of the RDC data. + missing = True for i in xrange(len(file_data)): # Skip missing data. if len(file_data[i]) <= min_col_num: @@ -460,6 +461,13 @@ float(file_data[i][error_col]) except ValueError: raise RelaxError, "The RDC data in the line " + `file_data[i]` + " is invalid." + + # Right, data is ok and exists. + missing = False + + # Hmmm, no data! + if missing: + raise RelaxError, "No corresponding data could be found within the file." # Global (non-spin specific) data.