Author: bugman Date: Sun Jun 8 00:42:40 2008 New Revision: 6325 URL: http://svn.gna.org/viewcvs/relax?rev=6325&view=rev Log: Shifted the relaxation curve fitting C module import check into the dep_check module. Modified: 1.3/dep_check.py 1.3/specific_fns/relax_fit.py Modified: 1.3/dep_check.py URL: http://svn.gna.org/viewcvs/relax/1.3/dep_check.py?rev=6325&r1=6324&r2=6325&view=diff ============================================================================== --- 1.3/dep_check.py (original) +++ 1.3/dep_check.py Sun Jun 8 00:42:40 2008 @@ -26,10 +26,12 @@ If essential dependencies are missing, then an error message is printed and the program terminated. """ +# Python modules. +import sys + # Python packages. ################## - # numpy. try: @@ -54,3 +56,17 @@ except ImportError: sys.stderr.write("The dependency 'minfx' has not been installed (see https://gna.org/projects/minfx/).\n") sys.exit() + + +# Compiled C modules. +##################### + +# Relaxation curve fitting. +try: + from maths_fns.relax_fit import setup + del setup +except ImportError: + sys.stderr.write("\nImportError: relaxation curve fitting is unavailable, try compiling the C modules.\n") + C_module_exp_fn = 0 +else: + C_module_exp_fn = 1 Modified: 1.3/specific_fns/relax_fit.py URL: http://svn.gna.org/viewcvs/relax/1.3/specific_fns/relax_fit.py?rev=6325&r1=6324&r2=6325&view=diff ============================================================================== --- 1.3/specific_fns/relax_fit.py (original) +++ 1.3/specific_fns/relax_fit.py Sun Jun 8 00:42:40 2008 @@ -32,6 +32,7 @@ # relax module imports. from data import Relax_data_store; ds = Relax_data_store() +from dep_check import C_module_exp_fn from base_class import Common_functions from generic_fns import intensity from generic_fns.mol_res_spin import count_spins, exists_mol_res_spin_data, generate_spin_id, return_spin_from_index, spin_loop @@ -39,14 +40,8 @@ from relax_errors import RelaxError, RelaxFuncSetupError, RelaxLenError, RelaxNoModelError, RelaxNoPipeError, RelaxNoSequenceError # C modules. -try: +if C_module_exp_fn: from maths_fns.relax_fit import setup, func, dfunc, d2func, back_calc_I -except ImportError: - sys.stderr.write("\nImportError: relaxation curve fitting is unavailable, try compiling the C modules.\n") - C_module_exp_fn = 0 -else: - C_module_exp_fn = 1 - class Relax_fit(Common_functions):