Re: [Numpy-discussion] How to handle a busted API?

2008-07-12 Thread Robert Kern
On Sun, Jul 13, 2008 at 01:49, Charles R Harris <[EMAIL PROTECTED]> wrote: > > On Sun, Jul 13, 2008 at 12:02 AM, Robert Kern <[EMAIL PROTECTED]> wrote: >> Compile-time warnings will be ignored if they aren't errors that stop >> the build. Run-time DeprecationWarnings are feasible: >> >> http://do

Re: [Numpy-discussion] How to handle a busted API?

2008-07-12 Thread Charles R Harris
On Sun, Jul 13, 2008 at 12:02 AM, Robert Kern <[EMAIL PROTECTED]> wrote: > On Sun, Jul 13, 2008 at 00:44, Charles R Harris > <[EMAIL PROTECTED]> wrote: > > Hi All, > > > > This is apropos ticket #805. The reporter wants to change the signature > of > > the functions PyArray_FromDims and PyArray_Fr

[Numpy-discussion] Doctests for extensions/cython code

2008-07-12 Thread Fernando Perez
Hi all (esp. Alan McIntyre), I'm attaching two little tarballs with a set of tools that may come in handy for testing numpy: - plugin.tgz contains a Nose plugin that works around various issues in the python stdlib, in nose and in cython, to enable the testing of doctests embedded in extension mo

Re: [Numpy-discussion] How to handle a busted API?

2008-07-12 Thread Robert Kern
On Sun, Jul 13, 2008 at 00:44, Charles R Harris <[EMAIL PROTECTED]> wrote: > Hi All, > > This is apropos ticket #805. The reporter wants to change the signature of > the functions PyArray_FromDims and PyArray_FromDimsAndDataAndDesc, which we > really can't do at this point because they are part of

Re: [Numpy-discussion] A correction to numpy trapz function

2008-07-12 Thread Charles R Harris
On Sat, Jul 12, 2008 at 10:30 PM, Nadav Horesh <[EMAIL PROTECTED]> wrote: > I am aware that the error is related to the broadcasting, and that it can > be solved by matching the shape of x to that of y --- this is how I solved > it in the first place. I was thinking that the function "promises" to

[Numpy-discussion] How to handle a busted API?

2008-07-12 Thread Charles R Harris
Hi All, This is apropos ticket #805 . The reporter wants to change the signature of the functions PyArray_FromDims and PyArray_FromDimsAndDataAndDesc, which we really can't do at this point because they are part of the Numpy API. The problem can be seen in

Re: [Numpy-discussion] A correction to numpy trapz function

2008-07-12 Thread Nadav Horesh
I am aware that the error is related to the broadcasting, and that it can be solved by matching the shape of x to that of y --- this is how I solved it in the first place. I was thinking that the function "promises" to integrate over an array given a x vector and the axis, so let obscure the bro

Re: [Numpy-discussion] huge array calculation speed

2008-07-12 Thread Charles R Harris
On Fri, Jul 11, 2008 at 11:04 AM, Lou Pecora <[EMAIL PROTECTED]> wrote: > If your positions are static (I'm not clear on that from your message), > then you might want to check the technique of "slice searching". It only > requires one sort of the data for each dimension initially, then uses a >

Re: [Numpy-discussion] snprintf vs PyOS_snprintf

2008-07-12 Thread Robert Kern
On Sat, Jul 12, 2008 at 13:11, Charles R Harris <[EMAIL PROTECTED]> wrote: > Numpy uses a mix of snprintf and PyOS_snprintf. The Python version is there > because snprintf wasn't part of the standard until C99. So either we should > stick to the python version or make the decision that we only supp

Re: [Numpy-discussion] A correction to numpy trapz function

2008-07-12 Thread Ryan May
Nadav Horesh wrote: > Here is what I get with the orriginal trapz function: > > IDLE 1.2.2 import numpy as np np.__version__ > '1.1.0' y = np.arange(24).reshape(6,4) x = np.arange(6) np.trapz(y, x, axis=0) > > Traceback (most recent call last): > File "", line 1,

Re: [Numpy-discussion] A correction to numpy trapz function

2008-07-12 Thread Nadav Horesh
Here is what I get with the orriginal trapz function: IDLE 1.2.2 >>> import numpy as np >>> np.__version__ '1.1.0' >>> y = np.arange(24).reshape(6,4) >>> x = np.arange(6) >>> np.trapz(y, x, axis=0) Traceback (most recent call last): File "", line 1, in np.trapz(y, x, axis=0) File "

[Numpy-discussion] snprintf vs PyOS_snprintf

2008-07-12 Thread Charles R Harris
Numpy uses a mix of snprintf and PyOS_snprintf. The Python version is there because snprintf wasn't part of the standard until C99. So either we should stick to the python version or make the decision that we only support compilers with a working snprintf. Which way should we go? Chuck ___

Re: [Numpy-discussion] Missing NULL return checks?

2008-07-12 Thread Charles R Harris
On Sat, Jul 12, 2008 at 10:13 AM, Charles R Harris < [EMAIL PROTECTED]> wrote: > > > On Sat, Jul 12, 2008 at 8:42 AM, Michael Abbott <[EMAIL PROTECTED]> > wrote: > >> > PyArray_DescrFromType can return NULL >> Yah, you noticed ;) >> >> > Yet it is unchecked in several places: >> Pity about that.

Re: [Numpy-discussion] Missing NULL return checks?

2008-07-12 Thread Charles R Harris
On Sat, Jul 12, 2008 at 8:42 AM, Michael Abbott <[EMAIL PROTECTED]> wrote: > > PyArray_DescrFromType can return NULL > Yah, you noticed ;) > > > Yet it is unchecked in several places: > Pity about that. Easy enough to fix though -- just don't lose track of > ref counts. In fact, I've already sub

Re: [Numpy-discussion] RFC: A proposal for implementing s ome date/time types in NumPy

2008-07-12 Thread Matt Knox
Christopher Barker noaa.gov> writes: >> I'm also imaging some extra utility functions/method that would be nice: >> >> aDateTimeArray.hours(dtype=float) >> >> to convert to hours (and days, and seconds, etc). And maybe some that >> would create a DateTimeArray from various time units. The Dat

[Numpy-discussion] SciPy 2008 Registration Deadline Extended

2008-07-12 Thread Travis Vaught
Greetings, The merchant account processor that we use for the SciPy Conference online registration has been experiencing some inexplicable problems authorizing some registrations. Apologies to those who have struggled to register and have not been successful. Because of the problems, we'

Re: [Numpy-discussion] A correction to numpy trapz function

2008-07-12 Thread Ryan May
Nadav Horesh wrote: > The function trapz accepts x axis vector only for axis=-1. Here is my > modification (correction?) to let it accept a vector x for integration along > any axis: > > def trapz(y, x=None, dx=1.0, axis=-1): > """ > Integrate y(x) using samples along the given axis and

[Numpy-discussion] A correction to numpy trapz function

2008-07-12 Thread Nadav Horesh
The function trapz accepts x axis vector only for axis=-1. Here is my modification (correction?) to let it accept a vector x for integration along any axis: def trapz(y, x=None, dx=1.0, axis=-1): """ Integrate y(x) using samples along the given axis and the composite trapezoidal rul

Re: [Numpy-discussion] Missing NULL return checks?

2008-07-12 Thread Michael Abbott
> PyArray_DescrFromType can return NULL Yah, you noticed ;) > Yet it is unchecked in several places: Pity about that. Easy enough to fix though -- just don't lose track of ref counts. In fact, I've already submitted a patch to this function (but not addressing this issue). > static int > PyAr

Re: [Numpy-discussion] Intel Math Kernel Library "FATAL ERROR"

2008-07-12 Thread Jan Tore Korneliussen
Yes, I downgraded from 10.0.3.020 to 10.0.1.014, and then the test worked. Since 10.0.3.020 is the newest version, perhaps it should be reported to Intel to prevent it from appearing in coming versions? (If it is actually a bug in MKL) On Sat, 2008-07-12 at 16:31 +0200, David Cournapeau wrote: >

Re: [Numpy-discussion] loadtxt and usecols

2008-07-12 Thread Lorenzo Bolla
why not using: data = loadtxt('18B180.dat', skiprows = 1, usecols = xrange(1,46)) obviously, you need to know how many columns you have. hth, L. On Sat, Jul 12, 2008 at 10:07:06AM -0400, Bryan Fodness wrote: > i would like to load my data without knowing the length, i have explicitly > stated the

Re: [Numpy-discussion] Intel Math Kernel Library "FATAL ERROR"

2008-07-12 Thread David Cournapeau
On Sat, Jul 12, 2008 at 3:56 PM, Jan Tore Korneliussen <[EMAIL PROTECTED]> wrote: > I found that the NumPy regression test error for MKL that was reported a > while ago happens with MKL 10.0.3.020, but not with MKL 10.0.1.014 > (everything else equal) > It is more likely a bug in the MKL. Please u

[Numpy-discussion] loadtxt and usecols

2008-07-12 Thread Bryan Fodness
i would like to load my data without knowing the length, i have explicitly stated the rows data = loadtxt('18B180.dat', skiprows = 1, usecols = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45)) and would like to use some

Re: [Numpy-discussion] RFC: A proposal for implementing some date/time types in NumPy

2008-07-12 Thread John Hunter
On Fri, Jul 11, 2008 at 1:14 PM, Francesc Alted <[EMAIL PROTECTED]> wrote: > So, it seems that setters/getters for matplotlib datetime could be > supported, maybe at the risk of loosing precision. We should study > this more carefully, but I suppose that if there is interest enough > that could b

[Numpy-discussion] Intel Math Kernel Library "FATAL ERROR"

2008-07-12 Thread Jan Tore Korneliussen
I found that the NumPy regression test error for MKL that was reported a while ago happens with MKL 10.0.3.020, but not with MKL 10.0.1.014 (everything else equal) Here is a dump of the regression test on my machine with 10.0.3.020 >>> import numpy >>> numpy.test() Numpy is installed in /usr/lib