Package specific_analyses :: Package relax_fit :: Module checks
[hide private]
[frames] | no frames]

Source Code for Module specific_analyses.relax_fit.checks

 1  ############################################################################### 
 2  #                                                                             # 
 3  # Copyright (C) 2014 Edward d'Auvergne                                        # 
 4  #                                                                             # 
 5  # This file is part of the program relax (http://www.nmr-relax.com).          # 
 6  #                                                                             # 
 7  # This program is free software: you can redistribute it and/or modify        # 
 8  # it under the terms of the GNU General Public License as published by        # 
 9  # the Free Software Foundation, either version 3 of the License, or           # 
10  # (at your option) any later version.                                         # 
11  #                                                                             # 
12  # This program is distributed in the hope that it will be useful,             # 
13  # but WITHOUT ANY WARRANTY; without even the implied warranty of              # 
14  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               # 
15  # GNU General Public License for more details.                                # 
16  #                                                                             # 
17  # You should have received a copy of the GNU General Public License           # 
18  # along with this program.  If not, see <http://www.gnu.org/licenses/>.       # 
19  #                                                                             # 
20  ############################################################################### 
21   
22  # Module docstring. 
23  """Module of functions for checking different aspects of the relaxation curve-fitting setup.""" 
24   
25  # relax module imports. 
26  from lib.checks import Check 
27  from lib.errors import RelaxError 
28  from pipe_control.mol_res_spin import spin_loop 
29   
30   
31 -def check_model_setup_func():
32 """Check that the model has been correctly set up. 33 34 @return: The initialised RelaxError object or nothing. 35 @rtype: None or RelaxError instance 36 """ 37 38 # Test if the model has been set. 39 for spin in spin_loop(): 40 # Skip deselected spins. 41 if not spin.select: 42 continue 43 44 # No model set. 45 if not hasattr(spin, 'model'): 46 return RelaxError("The exponential curve model has not been set, please use the relax_fit.select_model user function.")
47 48 # Create the checking object. 49 check_model_setup = Check(check_model_setup_func) 50