I have to stop somewhere.... :-) I will only change, if I can use the out argument.
That is good practice, and I will never forget. :-) Best Troels 2014-06-11 15:10 GMT+02:00 Edward d'Auvergne <[email protected]>: > What about the numpy.subtract() ufunc? I'm guessing that will not be faster. > > Regards, > > Edward > > > > On 11 June 2014 15:09, <[email protected]> wrote: >> Author: tlinnet >> Date: Wed Jun 11 15:09:01 2014 >> New Revision: 23838 >> >> URL: http://svn.gna.org/viewcvs/relax?rev=23838&view=rev >> Log: >> Removed the slow allclose() function to test if R20A and R20B is equal. >> >> It is MUCH faster to just subtract and check sum is not 0.0. >> >> Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion >> models for Clustered analysis. >> >> Modified: >> branches/disp_spin_speed/lib/dispersion/cr72.py >> >> Modified: branches/disp_spin_speed/lib/dispersion/cr72.py >> URL: >> http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/cr72.py?rev=23838&r1=23837&r2=23838&view=diff >> ============================================================================== >> --- branches/disp_spin_speed/lib/dispersion/cr72.py (original) >> +++ branches/disp_spin_speed/lib/dispersion/cr72.py Wed Jun 11 15:09:01 >> 2014 >> @@ -92,7 +92,7 @@ >> """ >> >> # Python module imports. >> -from numpy import allclose, arccosh, array, cos, cosh, isfinite, isnan, >> fabs, min, max, ndarray, ones, sqrt, sum, zeros >> +from numpy import arccosh, array, cos, cosh, isfinite, fabs, min, max, >> sqrt, sum >> from numpy.ma import fix_invalid, masked_greater_equal, masked_less, >> masked_where >> >> # Repetitive calculations (to speed up calculations). >> @@ -147,7 +147,7 @@ >> k_AB = pB * kex >> >> # The Psi and zeta values. >> - if not allclose(r20a, r20b): >> + if sum(r20a - r20b) != 0.0: >> fact = r20a - r20b - k_BA + k_AB >> Psi = fact**2 - dw2 + 4.0*pA*pB*kex**2 >> zeta = 2.0*dw * fact >> >> >> _______________________________________________ >> 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 _______________________________________________ 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

