Author: bugman Date: Fri Nov 21 10:33:31 2008 New Revision: 8006 URL: http://svn.gna.org/viewcvs/relax?rev=8006&view=rev Log: Added some tests to the NOE calculate() method. Modified: branches/spectral_errors/specific_fns/noe.py Modified: branches/spectral_errors/specific_fns/noe.py URL: http://svn.gna.org/viewcvs/relax/branches/spectral_errors/specific_fns/noe.py?rev=8006&r1=8005&r2=8006&view=diff ============================================================================== --- branches/spectral_errors/specific_fns/noe.py (original) +++ branches/spectral_errors/specific_fns/noe.py Fri Nov 21 10:33:31 2008 @@ -75,6 +75,15 @@ # Test if the current pipe exists. pipes.test() + + # Get the current data pipe. + cdp = pipes.get_pipe() + + # Test if the 2 spectra ids 'ref' and 'sat' exist. + if not 'ref' in cdp.spectrum_ids or not 'sat' in cdp.spectrum_ids: + raise RelaxError, "The reference and saturated NOE spectra have not been loaded." + if len(cdp.spectrum_ids) != 2: + raise RelaxError, "The spectrum ids %s should only consist of the labels 'ref' and 'sat'." % cdp.spectrum_ids # Loop over the spins. for spin in spin_loop():