Re: [Numpy-discussion] subclassing array in c

2012-03-07 Thread Christoph Gohle
Dear Val, I agree that more detail is needed. Sorry for that it was late yesterday. I am running Python 2.6.1, numpy development branch (numpy-2.0.0.dev_20101104-py2.6-macosx-10.6-universal.egg). maybe I should switch to release? I compile with your setup.py using 'python setup.py build_ext -

Re: [Numpy-discussion] use for missing (ignored) data?

2012-03-07 Thread Benjamin Root
On Wednesday, March 7, 2012, Nathaniel Smith wrote: > On Wed, Mar 7, 2012 at 8:05 PM, Neal Becker wrote: >> I'm wondering what is the use for the ignored data feature? >> >> I can use: >> >> A[valid_A_indexes] = whatever >> >> to process only the 'non-ignored' portions of A. So at least some sim

Re: [Numpy-discussion] subclassing array in c

2012-03-07 Thread Christoph Gohlke
FWIW, this crashes on Windows with numpy 1.6.1 but not numpy 1.7-git debug build. Christoph Gohlke On 3/7/2012 5:36 PM, Val Kalatsky wrote: > > Tried it on my Ubuntu 10.10 box, no problem: > > 1) Saved as spampub.c > 2) Compiled with (setup.py attached): python setup.py build_ext -i > 3) Tested

Re: [Numpy-discussion] subclassing array in c

2012-03-07 Thread Val Kalatsky
Tried it on my Ubuntu 10.10 box, no problem: 1) Saved as spampub.c 2) Compiled with (setup.py attached): python setup.py build_ext -i 3) Tested from ipython: In [1]: import spampub In [2]: ua=spampub.UnitArray([0,1,2,3.0],'liter') In [3]: ua Out[3]: UnitArray([ 0., 1., 2., 3.]) In [4]: ua.unit

Re: [Numpy-discussion] subclassing array in c

2012-03-07 Thread Val Kalatsky
Seeing the backtrace would be helpful. Can you do whatever leads to the segfault from python run from gdb? Val On Wed, Mar 7, 2012 at 7:04 PM, Christoph Gohle wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Hi, > > I have been struggeling for quite some time now. Desperate as I am, n

[Numpy-discussion] subclassing array in c

2012-03-07 Thread Christoph Gohle
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, I have been struggeling for quite some time now. Desperate as I am, now I need help. I was trying to subclass ndarrays in a c extension (see code below) and do constantly get segfaults. I have been checking my INCREF and DECREF stuff up and

[Numpy-discussion] Casting rules changed in trunk?

2012-03-07 Thread Matthew Brett
Hi, I noticed a casting change running the test suite on our image reader, nibabel: https://github.com/nipy/nibabel/blob/master/nibabel/tests/test_casting.py For this script: import numpy as np Adata = np.zeros((2,), dtype=np.uint8) Bdata = np.zeros((2,), dtype=np.int16) Bzero = np.int16(0) B

Re: [Numpy-discussion] use for missing (ignored) data?

2012-03-07 Thread Nathaniel Smith
On Wed, Mar 7, 2012 at 8:05 PM, Neal Becker wrote: > I'm wondering what is the use for the ignored data feature? > > I can use: > > A[valid_A_indexes] = whatever > > to process only the 'non-ignored' portions of A.  So at least some simple > cases > of ignored data are already supported without i

Re: [Numpy-discussion] Missing data again

2012-03-07 Thread Nathaniel Smith
On Wed, Mar 7, 2012 at 7:39 PM, Benjamin Root wrote: > On Wed, Mar 7, 2012 at 1:26 PM, Nathaniel Smith wrote: >> When it comes to "missing data", bitpatterns can do everything that >> masks can do, are no more complicated to implement, and have better >> performance characteristics. >> > > Not tr

Re: [Numpy-discussion] Missing data again

2012-03-07 Thread Nathaniel Smith
On Wed, Mar 7, 2012 at 7:37 PM, Charles R Harris wrote: > > > On Wed, Mar 7, 2012 at 12:26 PM, Nathaniel Smith wrote: >> When it comes to "missing data", bitpatterns can do everything that >> masks can do, are no more complicated to implement, and have better >> performance characteristics. >> >

Re: [Numpy-discussion] Github key audit.

2012-03-07 Thread josef . pktd
On Wed, Mar 7, 2012 at 1:54 PM, Charles R Harris wrote: > Hi All, > > Many here have probably received the message from github about push/pull > access being blocked until you have auditied your ssh keys. To generate a > key fingerprint on fedora, I did the following: > > $charris@f16 ~$ ssh-keyge

Re: [Numpy-discussion] addition, multiplication of a polynomial and np.{float, int}

2012-03-07 Thread Pierre Haessig
Hi Charles, Le 07/03/2012 18:00, Charles R Harris a écrit : > > That's a good idea, I'll take care of it. Note the caveat about the > coefficients going in the opposite direction. Great ! In the mean time I changed a bit the root polynomials reference to emphasize the new Polynomial class. http://

Re: [Numpy-discussion] use for missing (ignored) data?

2012-03-07 Thread Benjamin Root
On Wednesday, March 7, 2012, Neal Becker wrote: > Charles R Harris wrote: > >> On Wed, Mar 7, 2012 at 1:05 PM, Neal Becker wrote: >> >>> I'm wondering what is the use for the ignored data feature? >>> >>> I can use: >>> >>> A[valid_A_indexes] = whatever >>> >>> to process only the 'non-ignored' p

Re: [Numpy-discussion] Missing data again

2012-03-07 Thread Eric Firing
On 03/07/2012 11:15 AM, Pierre Haessig wrote: > Hi, > Le 07/03/2012 20:57, Eric Firing a écrit : >> In other words, good low-level support for numpy.ma functionality? > Coming back to *existing* ma support, I was just wondering whether it > was now possible to "np.save" a masked array. > (I'm using

Re: [Numpy-discussion] Missing data again

2012-03-07 Thread Pierre Haessig
Hi, Le 07/03/2012 20:57, Eric Firing a écrit : > In other words, good low-level support for numpy.ma functionality? Coming back to *existing* ma support, I was just wondering whether it was now possible to "np.save" a masked array. (I'm using numpy 1.5) In the end, this is the most annoying problem

Re: [Numpy-discussion] use for missing (ignored) data?

2012-03-07 Thread Neal Becker
Charles R Harris wrote: > On Wed, Mar 7, 2012 at 1:05 PM, Neal Becker wrote: > >> I'm wondering what is the use for the ignored data feature? >> >> I can use: >> >> A[valid_A_indexes] = whatever >> >> to process only the 'non-ignored' portions of A. So at least some simple >> cases >> of ignore

Re: [Numpy-discussion] use for missing (ignored) data?

2012-03-07 Thread Charles R Harris
On Wed, Mar 7, 2012 at 1:05 PM, Neal Becker wrote: > I'm wondering what is the use for the ignored data feature? > > I can use: > > A[valid_A_indexes] = whatever > > to process only the 'non-ignored' portions of A. So at least some simple > cases > of ignored data are already supported without i

[Numpy-discussion] use for missing (ignored) data?

2012-03-07 Thread Neal Becker
I'm wondering what is the use for the ignored data feature? I can use: A[valid_A_indexes] = whatever to process only the 'non-ignored' portions of A. So at least some simple cases of ignored data are already supported without introducing a new type. OTOH: w = A[valid_A_indexes] will copy A'

Re: [Numpy-discussion] (2012) Accessing LAPACK and BLAS from the numpy C API

2012-03-07 Thread V. Armando Solé
On 06/03/2012 20:57, Sturla Molden wrote: On 05.03.2012 14:26, "V. Armando Solé" wrote: In 2009 there was a thread in this mailing list concerning the access to BLAS from C extension modules. If I have properly understood the thread: http://mail.scipy.org/pipermail/numpy-discussion/2009-Novem

Re: [Numpy-discussion] Missing data again

2012-03-07 Thread Eric Firing
On 03/07/2012 09:26 AM, Nathaniel Smith wrote: > On Wed, Mar 7, 2012 at 5:17 PM, Charles R Harris > wrote: >> On Wed, Mar 7, 2012 at 9:35 AM, Pierre Haessig >>> Coming back to Travis proposition "bit-pattern approaches to missing >>> data (*at least* for float64 and int32) need to be implemented.

Re: [Numpy-discussion] Missing data again

2012-03-07 Thread Matthew Brett
Hi, On Wed, Mar 7, 2012 at 11:37 AM, Charles R Harris wrote: > > > On Wed, Mar 7, 2012 at 12:26 PM, Nathaniel Smith wrote: >> >> On Wed, Mar 7, 2012 at 5:17 PM, Charles R Harris >> wrote: >> > On Wed, Mar 7, 2012 at 9:35 AM, Pierre Haessig >> > >> >> Coming back to Travis proposition "bit-patt

Re: [Numpy-discussion] Missing data again

2012-03-07 Thread Benjamin Root
On Wed, Mar 7, 2012 at 1:26 PM, Nathaniel Smith wrote: > On Wed, Mar 7, 2012 at 5:17 PM, Charles R Harris > wrote: > > On Wed, Mar 7, 2012 at 9:35 AM, Pierre Haessig > > >> Coming back to Travis proposition "bit-pattern approaches to missing > >> data (*at least* for float64 and int32) need to

Re: [Numpy-discussion] Missing data again

2012-03-07 Thread Charles R Harris
On Wed, Mar 7, 2012 at 12:26 PM, Nathaniel Smith wrote: > On Wed, Mar 7, 2012 at 5:17 PM, Charles R Harris > wrote: > > On Wed, Mar 7, 2012 at 9:35 AM, Pierre Haessig > > >> Coming back to Travis proposition "bit-pattern approaches to missing > >> data (*at least* for float64 and int32) need to

Re: [Numpy-discussion] Missing data again

2012-03-07 Thread Nathaniel Smith
On Wed, Mar 7, 2012 at 5:17 PM, Charles R Harris wrote: > On Wed, Mar 7, 2012 at 9:35 AM, Pierre Haessig >> Coming back to Travis proposition "bit-pattern approaches to missing >> data (*at least* for float64 and int32) need to be implemented.", I >> wonder what is the amount of extra work to go

Re: [Numpy-discussion] checking for c compiler during build

2012-03-07 Thread Skipper Seabold
On Wed, Mar 7, 2012 at 12:35 PM, Skipper Seabold wrote: > Is there a way to use numpy.distuils to programmatically check for a C > compiler at build time in a platform independent way? Wading through the numpy/distutils code some more. Would something as simple as this work all the time? Seems to

[Numpy-discussion] Github key audit.

2012-03-07 Thread Charles R Harris
Hi All, Many here have probably received the message from github about push/pull access being blocked until you have auditied your ssh keys. To generate a key fingerprint on fedora, I did the following: $charris@f16 ~$ ssh-keygen -l -f .ssh/id_dsa.pub I don't how this looks for those of you usin

Re: [Numpy-discussion] Missing data again

2012-03-07 Thread Charles R Harris
On Wed, Mar 7, 2012 at 11:21 AM, Lluís wrote: > Charles R Harris writes: > [...] > > One inconvenience I have run into with the current API is that is should > be > > easier to clear the mask from an "ignored" value without taking a new > view or > > assigning known data. > > AFAIR, the inability

[Numpy-discussion] [enhancement] sum_angle() and sum_polar()

2012-03-07 Thread Robert Jördens
Hi everyone, I am proposing to add the the two following functions to numpy/lib/twodim_base.py: sum_angle() computes the sum of a 2-d array along an angled axis sum_polar() computes the sum of a 2-d array along radial lines or along azimuthal circles https://github.com/numpy/numpy/pull/230 Comme

Re: [Numpy-discussion] Missing data again

2012-03-07 Thread Lluís
Charles R Harris writes: [...] > One inconvenience I have run into with the current API is that is should be > easier to clear the mask from an "ignored" value without taking a new view or > assigning known data. AFAIR, the inability to directly access a "mask" attribute was intentional to make bi

[Numpy-discussion] checking for c compiler during build

2012-03-07 Thread Skipper Seabold
Is there a way to use numpy.distuils to programmatically check for a C compiler at build time in a platform independent way? ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Missing data again

2012-03-07 Thread Charles R Harris
On Wed, Mar 7, 2012 at 9:35 AM, Pierre Haessig wrote: > Hi, > > Thanks you very much for your lights ! > > Le 06/03/2012 21:59, Nathaniel Smith a écrit : > > Right -- R has a very impoverished type system as compared to numpy. > > There's basically four types: "numeric" (meaning double precision >

Re: [Numpy-discussion] Missing data again

2012-03-07 Thread Nathaniel Smith
On Wed, Mar 7, 2012 at 4:35 PM, Pierre Haessig wrote: > Hi, > > Thanks you very much for your lights ! > > Le 06/03/2012 21:59, Nathaniel Smith a écrit : >> Right -- R has a very impoverished type system as compared to numpy. >> There's basically four types: "numeric" (meaning double precision >>

Re: [Numpy-discussion] addition, multiplication of a polynomial and np.{float, int}

2012-03-07 Thread Charles R Harris
On Wed, Mar 7, 2012 at 9:45 AM, Pierre Haessig wrote: > Hi, > Le 06/03/2012 22:19, Charles R Harris a écrit : > > Use polynomial.Polynomial and you won't have this problem. > I was not familiar with the "poly1d vs. Polynomial" choice. > > Now, I found in the doc some more or less explicit guidelin

Re: [Numpy-discussion] Fixing PyArray_Descr flags member size, ABI vs pickling issue

2012-03-07 Thread David Cournapeau
On Tue, Mar 6, 2012 at 1:44 PM, Robert Kern wrote: > On Tue, Mar 6, 2012 at 18:25, Travis Oliphant wrote: > > Why do we want to return a single string char instead of an int? > > I suspect just to ensure that any provided value fits in the range > 0..255. But that's easily done explicitly. > Th

Re: [Numpy-discussion] addition, multiplication of a polynomial and np.{float, int}

2012-03-07 Thread Pierre Haessig
Hi, Le 06/03/2012 22:19, Charles R Harris a écrit : > Use polynomial.Polynomial and you won't have this problem. I was not familiar with the "poly1d vs. Polynomial" choice. Now, I found in the doc some more or less explicit guidelines in: http://docs.scipy.org/doc/numpy/reference/routines.polynomi

Re: [Numpy-discussion] Missing data again

2012-03-07 Thread Pierre Haessig
Hi, Thanks you very much for your lights ! Le 06/03/2012 21:59, Nathaniel Smith a écrit : > Right -- R has a very impoverished type system as compared to numpy. > There's basically four types: "numeric" (meaning double precision > float), "integer", "logical" (boolean), and "character" (string).

Re: [Numpy-discussion] Possible roadmap addendum: building better text file readers

2012-03-07 Thread Warren Weckesser
On Tue, Mar 6, 2012 at 4:45 PM, Chris Barker wrote: > On Thu, Mar 1, 2012 at 10:58 PM, Jay Bourque wrote: > > > 1. Loading text files using loadtxt/genfromtxt need a significant > > performance boost (I think at least an order of magnitude increase in > > performance is very doable based on what