Hi,

This is change is not required as leastsq() has been part of Scipy
since 2003.  The scipy_module variable already present is all you
need.

Regards,

Edward


On 25 August 2014 12:06,  <[email protected]> wrote:
> Author: tlinnet
> Date: Mon Aug 25 12:06:29 2014
> New Revision: 25240
>
> URL: http://svn.gna.org/viewcvs/relax?rev=25240&view=rev
> Log:
> Add dependency check for scipy.optimize.leastsq.
>
> task #7822(https://gna.org/task/index.php?7822): Implement user function to 
> estimate R2eff and associated errors for exponential curve fitting.
>
> Modified:
>     trunk/dep_check.py
>     trunk/specific_analyses/relax_disp/optimisation.py
>     trunk/test_suite/system_tests/relax_disp.py
>
> Modified: trunk/dep_check.py
> URL: 
> http://svn.gna.org/viewcvs/relax/trunk/dep_check.py?rev=25240&r1=25239&r2=25240&view=diff
> ==============================================================================
> --- trunk/dep_check.py  (original)
> +++ trunk/dep_check.py  Mon Aug 25 12:06:29 2014
> @@ -158,6 +158,13 @@
>      scipy_module = True
>  except:
>      scipy_module = False
> +
> +# scipy.optimize.leastsq import.
> +try:
> +    from scipy.optimize import leastsq
> +    scipy_leastsq = True
> +except:
> +    scipy_leastsq = False
>
>  # VMD module imports.
>  try:
>
> Modified: trunk/specific_analyses/relax_disp/optimisation.py
> URL: 
> http://svn.gna.org/viewcvs/relax/trunk/specific_analyses/relax_disp/optimisation.py?rev=25240&r1=25239&r2=25240&view=diff
> ==============================================================================
> --- trunk/specific_analyses/relax_disp/optimisation.py  (original)
> +++ trunk/specific_analyses/relax_disp/optimisation.py  Mon Aug 25 12:06:29 
> 2014
> @@ -34,7 +34,7 @@
>  from warnings import warn
>
>  # relax module imports.
> -from dep_check import C_module_exp_fn
> +from dep_check import C_module_exp_fn, scipy_leastsq
>  from lib.dispersion.two_point import calc_two_point_r2eff, 
> calc_two_point_r2eff_err
>  from lib.errors import RelaxError
>  from lib.text.sectioning import section
> @@ -322,6 +322,10 @@
>      @keyword verbosity:         The amount of information to print.  The 
> higher the value, the greater the verbosity.
>      @type verbosity:            int
>      """
> +
> +    # Check that scipy.optimize.leastsq is available.
> +    if not scipy_leastsq:
> +        raise RelaxError("scipy.optimize.leastsq module is not available.")
>
>      # Perform checks.
>      check_model_type(model=MODEL_R2EFF)
>
> Modified: trunk/test_suite/system_tests/relax_disp.py
> URL: 
> http://svn.gna.org/viewcvs/relax/trunk/test_suite/system_tests/relax_disp.py?rev=25240&r1=25239&r2=25240&view=diff
> ==============================================================================
> --- trunk/test_suite/system_tests/relax_disp.py (original)
> +++ trunk/test_suite/system_tests/relax_disp.py Mon Aug 25 12:06:29 2014
> @@ -72,6 +72,18 @@
>              # Store in the status object.
>              if methodName in to_skip:
>                  status.skipped_tests.append([methodName, 'Relax 
> curve-fitting C module', self._skip_type])
> +
> +        # If not scipy.optimize.leastsq.
> +        if not dep_check.scipy_leastsq:
> +            # The list of tests to skip.
> +            to_skip = [
> +                "test_estimate_r2eff",
> +                "test_estimate_r2eff_error"
> +            ]
> +
> +            # Store in the status object.
> +            if methodName in to_skip:
> +                status.skipped_tests.append([methodName, 
> 'scipy.optimize.leastsq module', self._skip_type])
>
>
>      def setUp(self):
>
>
> _______________________________________________
> relax (http://www.nmr-relax.com)
>
> This is the relax-commits mailing list
> [email protected]
>
> To unsubscribe from this list, get a password
> reminder, or change your subscription options,
> visit the list information page at
> https://mail.gna.org/listinfo/relax-commits

_______________________________________________
relax (http://www.nmr-relax.com)

This is the relax-devel mailing list
[email protected]

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-devel

Reply via email to