
Switching to scipy (0.8.0) + numpy (1.5.1) from scipy (0.7.2) + numpy (1.4.1) reveals regression: *(Pdb) print legendre(1)(N.array([-0.999999999999 , -0.6, -0.2, 0.2, 0.6, 1. ])) [-1. -0.6 -0.2 0.2 0.6 1. ] *(Pdb) print legendre(1)(N.array([-1 , -0.6, -0.2, 0.2, 0.6, 1. ])) [ inf -0.6 -0.2 0.2 0.6 1. ] while before it was giving correct boundary value (-1). Could anyone please check if it is still present in current HEAD? imho worth a bugreport (haven't ran into similar one upon query but decided to check -- may be it was resolved already). -- =------------------------------------------------------------------= Keep in touch www.onerussian.com Yaroslav Halchenko www.ohloh.net/accounts/yarikoptic

more fun (and pardon our elderly import numpy as N) ;-) *(Pdb) legendre(1)(N.array([-1.])) array([ inf]) (Pdb) legendre(1)([-1.]) array([-1.]) On Mon, 31 Jan 2011, Yaroslav Halchenko wrote:
Switching to scipy (0.8.0) + numpy (1.5.1) from scipy (0.7.2) + numpy (1.4.1) reveals regression:
*(Pdb) print legendre(1)(N.array([-0.999999999999 , -0.6, -0.2, 0.2, 0.6, 1. ])) [-1. -0.6 -0.2 0.2 0.6 1. ]
*(Pdb) print legendre(1)(N.array([-1 , -0.6, -0.2, 0.2, 0.6, 1. ])) [ inf -0.6 -0.2 0.2 0.6 1. ]
while before it was giving correct boundary value (-1).
Could anyone please check if it is still present in current HEAD? imho worth a bugreport (haven't ran into similar one upon query but decided to check -- may be it was resolved already). -- =------------------------------------------------------------------= Keep in touch www.onerussian.com Yaroslav Halchenko www.ohloh.net/accounts/yarikoptic

On Mon, Jan 31, 2011 at 1:28 PM, Yaroslav Halchenko <lists@onerussian.com> wrote:
more fun (and pardon our elderly import numpy as N) ;-)
*(Pdb) legendre(1)(N.array([-1.])) array([ inf]) (Pdb) legendre(1)([-1.]) array([-1.])
On Mon, 31 Jan 2011, Yaroslav Halchenko wrote:
Switching to scipy (0.8.0) + numpy (1.5.1) from scipy (0.7.2) + numpy (1.4.1) reveals regression:
*(Pdb) print legendre(1)(N.array([-0.999999999999 , -0.6, -0.2, 0.2, 0.6, 1. ])) [-1. -0.6 -0.2 0.2 0.6 1. ]
*(Pdb) print legendre(1)(N.array([-1 , -0.6, -0.2, 0.2, 0.6, 1. ])) [ inf -0.6 -0.2 0.2 0.6 1. ]
while before it was giving correct boundary value (-1).
Could anyone please check if it is still present in current HEAD? imho worth a bugreport (haven't ran into similar one upon query but decided to check -- may be it was resolved already).
mine looks ok,
special.legendre(1)(np.array([-0.999999999999 , -0.6, -0.2, 0.2, 0.6, 1. ])) array([-1. , -0.6, -0.2, 0.2, 0.6, 1. ]) special.legendre(1)(np.array([-1 , -0.6, -0.2, 0.2, 0.6, 1. ])) array([-1. , -0.6, -0.2, 0.2, 0.6, 1. ]) special.legendre(1)(np.array([-1,])) array([-1.]) special.legendre(1)(1.) 1.0 special.legendre(1)(-1.) -1.0
special.legendre(1)([-1.]) array([-1.])
import scipy scipy.__version__ '0.10.0.dev7027'
numpy 1.5.1 Josef
-- =------------------------------------------------------------------= Keep in touch www.onerussian.com Yaroslav Halchenko www.ohloh.net/accounts/yarikoptic _______________________________________________ SciPy-Dev mailing list SciPy-Dev@scipy.org http://mail.scipy.org/mailman/listinfo/scipy-dev

On Mon, Jan 31, 2011 at 12:25 PM, Yaroslav Halchenko <lists@onerussian.com>wrote:
Switching to scipy (0.8.0) + numpy (1.5.1) from scipy (0.7.2) + numpy (1.4.1) reveals regression:
*(Pdb) print legendre(1)(N.array([-0.999999999999 , -0.6, -0.2, 0.2, 0.6, 1. ])) [-1. -0.6 -0.2 0.2 0.6 1. ]
*(Pdb) print legendre(1)(N.array([-1 , -0.6, -0.2, 0.2, 0.6, 1. ])) [ inf -0.6 -0.2 0.2 0.6 1. ]
while before it was giving correct boundary value (-1).
Could anyone please check if it is still present in current HEAD? imho worth a bugreport (haven't ran into similar one upon query but decided to check -- may be it was resolved already).
This has been fixed; see ticket #1298: http://projects.scipy.org/scipy/ticket/1298 Warren
-- =------------------------------------------------------------------= Keep in touch www.onerussian.com Yaroslav Halchenko www.ohloh.net/accounts/yarikoptic _______________________________________________ SciPy-Dev mailing list SciPy-Dev@scipy.org http://mail.scipy.org/mailman/listinfo/scipy-dev

On Mon, Jan 31, 2011 at 11:25 AM, Yaroslav Halchenko <lists@onerussian.com>wrote:
Switching to scipy (0.8.0) + numpy (1.5.1) from scipy (0.7.2) + numpy (1.4.1) reveals regression:
*(Pdb) print legendre(1)(N.array([-0.999999999999 , -0.6, -0.2, 0.2, 0.6, 1. ])) [-1. -0.6 -0.2 0.2 0.6 1. ]
*(Pdb) print legendre(1)(N.array([-1 , -0.6, -0.2, 0.2, 0.6, 1. ])) [ inf -0.6 -0.2 0.2 0.6 1. ]
while before it was giving correct boundary value (-1).
Could anyone please check if it is still present in current HEAD? imho worth a bugreport (haven't ran into similar one upon query but decided to check -- may be it was resolved already).
You might also be interested in the Legendre polynomial series in Numpy. In [1]: from numpy.polynomial import Legendre as L In [2]: p = L([0,1]) In [3]: p([-1 , -0.6, -0.2, 0.2, 0.6, 1. ]) Out[3]: array([-1. , -0.6, -0.2, 0.2, 0.6, 1. ]) Chuck

Thanks everyone! didn't know about numpy's "copy" of the functionality... I guess bloody fresh: In [1]: from numpy.polynomial import Legendre as L --------------------------------------------------------------------------- ImportError Traceback (most recent call last) /home/yoh/proj/pymvpa/pymvpa/<ipython console> in <module>() ImportError: cannot import name Legendre In [2]: import numpy In [3]: numpy.__version__ Out[3]: '1.5.1' meanwhile worked out temporary workaround by offsetting 'inf' locations On Mon, 31 Jan 2011, Charles R Harris wrote:
You might also be interested in the Legendre polynomial series in Numpy. In [1]: from numpy.polynomial import Legendre as L In [2]: p = L([0,1]) In [3]: p([-1 , -0.6, -0.2, 0.2, 0.6, 1. ]) Out[3]: array([-1. , -0.6, -0.2, 0.2, 0.6, 1. ]) Chuck
References
1. mailto:lists@onerussian.com
_______________________________________________ SciPy-Dev mailing list SciPy-Dev@scipy.org http://mail.scipy.org/mailman/listinfo/scipy-dev
-- =------------------------------------------------------------------= Keep in touch www.onerussian.com Yaroslav Halchenko www.ohloh.net/accounts/yarikoptic

On Mon, Jan 31, 2011 at 11:50 AM, Yaroslav Halchenko <lists@onerussian.com>wrote:
Thanks everyone! didn't know about numpy's "copy" of the functionality... I guess bloody fresh:
In [1]: from numpy.polynomial import Legendre as L --------------------------------------------------------------------------- ImportError Traceback (most recent call last)
/home/yoh/proj/pymvpa/pymvpa/<ipython console> in <module>()
ImportError: cannot import name Legendre
In [2]: import numpy
In [3]: numpy.__version__ Out[3]: '1.5.1'
Ah, I forgot when it went in. It has more functionality than you get with the scipy special versions, for instance, multiplication/division of series. In [1]: from numpy.polynomial import Legendre as L In [2]: p1 = L([0,0,1]) In [3]: p2 = L([0,0,0,1]) In [4]: p2*p1 Out[4]: Legendre([ 0. , 0.25714286, 0. , 0.26666667, 0. , 0.47619048], [-1., 1.]) In [5]: quo, rem = divmod(p2,p1) In [6]: p1*quo + rem Out[6]: Legendre([ 0., 0., 0., 1.], [-1., 1.]) It's a standalone python/numpy module, you can just copy the folder from trunk and get the current functionality. Chuck
participants (4)
-
Charles R Harris
-
josef.pktd@gmail.com
-
Warren Weckesser
-
Yaroslav Halchenko