Re: [Numpy-discussion] "expected a single-segment buffer object"

2008-07-09 Thread Robert Kern
On Wed, Jul 9, 2008 at 21:29, Anne Archibald <[EMAIL PROTECTED]> wrote: > 2008/7/9 Robert Kern <[EMAIL PROTECTED]>: > >> Yes, the buffer interface, at least the subset that ndarray() >> consumes, requires that all of the data be contiguous in memory. >> array_as_buffer() checks for that using PyArr

Re: [Numpy-discussion] "expected a single-segment buffer object"

2008-07-09 Thread Anne Archibald
2008/7/9 Robert Kern <[EMAIL PROTECTED]>: > Yes, the buffer interface, at least the subset that ndarray() > consumes, requires that all of the data be contiguous in memory. > array_as_buffer() checks for that using PyArray_ISONE_SEGMENT(), which > looks like this: > > #define PyArray_ISONESEGMENT(

Re: [Numpy-discussion] "expected a single-segment buffer object"

2008-07-09 Thread Robert Kern
On Wed, Jul 9, 2008 at 18:55, Anne Archibald <[EMAIL PROTECTED]> wrote: > Hi, > > When trying to construct an ndarray, I sometimes run into the > more-or-less mystifying error "expected a single-segment buffer > object": > > Out[54]: (0, 16, 8) > In [55]: A=np.zeros(2); A=A[np.newaxis,...]; > np.nd

[Numpy-discussion] "expected a single-segment buffer object"

2008-07-09 Thread Anne Archibald
Hi, When trying to construct an ndarray, I sometimes run into the more-or-less mystifying error "expected a single-segment buffer object": Out[54]: (0, 16, 8) In [55]: A=np.zeros(2); A=A[np.newaxis,...]; np.ndarray(strides=A.strides,shape=A.shape,buffer=A,dtype=A.dtype) --

Re: [Numpy-discussion] Multiplying every 3 elements by a vector?

2008-07-09 Thread Charles R Harris
On Wed, Jul 9, 2008 at 3:26 PM, Anne Archibald <[EMAIL PROTECTED]> wrote: > 2008/7/9 Charles R Harris <[EMAIL PROTECTED]>: > > > > On Wed, Jul 9, 2008 at 2:34 PM, Marlin Rowley <[EMAIL PROTECTED] > > > > wrote: > >> > >> Thanks Chuck, but I wasn't quit clear with my question. > >> > >> You answere

Re: [Numpy-discussion] Multiplying every 3 elements by a vector?

2008-07-09 Thread Anne Archibald
2008/7/9 Charles R Harris <[EMAIL PROTECTED]>: > > On Wed, Jul 9, 2008 at 2:34 PM, Marlin Rowley <[EMAIL PROTECTED]> > wrote: >> >> Thanks Chuck, but I wasn't quit clear with my question. >> >> You answered exactly according to what I asked, but I failed to mention >> needing the dot product instea

Re: [Numpy-discussion] Multiplying every 3 elements by a vector?

2008-07-09 Thread Charles R Harris
On Wed, Jul 9, 2008 at 2:34 PM, Marlin Rowley <[EMAIL PROTECTED]> wrote: > Thanks Chuck, but I wasn't quit clear with my question. > > You answered exactly according to what I asked, but I failed to mention > needing the dot product instead of just the product. > > So, > > v dot A = v' > > v'[0] =

[Numpy-discussion] chararray constructor change

2008-07-09 Thread Alan McIntyre
I'd like to make the following change to the chararray constructor. This is motivated by some of chararray's methods constructing new chararrays with NumPy integer arguments to itemsize, and it just seemed easier to fix this in the constructor. Index: numpy/numpy/core/defchararray.py =

Re: [Numpy-discussion] Multiplying every 3 elements by a vector?

2008-07-09 Thread Marlin Rowley
Thanks Chuck, but I wasn't quit clear with my question. You answered exactly according to what I asked, but I failed to mention needing the dot product instead of just the product. So, v dot A = v' v'[0] = v[0]*A[0] + v[1]*A[1] + v[2]*A[2] v'[1] = v[0]*A[3] + v[1]*A[4] + v[2]*A[5] v'[2] =

Re: [Numpy-discussion] Unused matrix method

2008-07-09 Thread Alan McIntyre
On Wed, Jul 9, 2008 at 4:23 PM, Robert Kern <[EMAIL PROTECTED]> wrote: > On Wed, Jul 9, 2008 at 15:16, Alan McIntyre <[EMAIL PROTECTED]> wrote: >> There's a _get_truendim method on matrix that isn't referenced >> anywhere in NumPy, SciPy, or matplotlib. Should this get deprecated >> or removed in

Re: [Numpy-discussion] Unused matrix method

2008-07-09 Thread Robert Kern
On Wed, Jul 9, 2008 at 15:16, Alan McIntyre <[EMAIL PROTECTED]> wrote: > There's a _get_truendim method on matrix that isn't referenced > anywhere in NumPy, SciPy, or matplotlib. Should this get deprecated > or removed in 1.2? We could remove it. It's a private method. -- Robert Kern "I have c

[Numpy-discussion] Unused matrix method

2008-07-09 Thread Alan McIntyre
There's a _get_truendim method on matrix that isn't referenced anywhere in NumPy, SciPy, or matplotlib. Should this get deprecated or removed in 1.2? ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/

Re: [Numpy-discussion] alterdot and restoredot

2008-07-09 Thread Robert Kern
On Wed, Jul 9, 2008 at 06:36, Anne Archibald <[EMAIL PROTECTED]> wrote: > 2008/7/9 Robert Kern <[EMAIL PROTECTED]>: > >>> - Which operations do the functions exactly affect? >>> It seems that alterdot sets the "dot" function slot to a BLAS >>> version, but what operations does this affect? >> >>

Re: [Numpy-discussion] A couple of testing issues

2008-07-09 Thread Robert Kern
On Wed, Jul 9, 2008 at 14:35, Alan McIntyre <[EMAIL PROTECTED]> wrote: > On Wed, Jul 9, 2008 at 3:26 PM, Robert Kern <[EMAIL PROTECTED]> wrote: >> I don't think it's worth automating on every run. People can see for >> themselves if they have any such check_methods() and make the >> conversion once

Re: [Numpy-discussion] Numpy-discussion Digest, Vol 22, Issue 33

2008-07-09 Thread Keith Goodman
On Wed, Jul 9, 2008 at 12:43 PM, Catherine Moroney <[EMAIL PROTECTED]> wrote: >> >> > 2008/7/9 Catherine Moroney <[EMAIL PROTECTED]>: >> > >> >> I have a question about performing element-wise logical operations >> >> on numpy arrays. >> >> >> >> If "a", "b" and "c" are numpy arrays of the same siz

Re: [Numpy-discussion] Numpy-discussion Digest, Vol 22, Issue 33

2008-07-09 Thread Catherine Moroney
> > > 2008/7/9 Catherine Moroney <[EMAIL PROTECTED]>: > > > >> I have a question about performing element-wise logical operations > >> on numpy arrays. > >> > >> If "a", "b" and "c" are numpy arrays of the same size, does the > >> following syntax work? > >> > >> mask = (a > 1.0) & ((b > 3.0) | (c

Re: [Numpy-discussion] A couple of testing issues

2008-07-09 Thread Alan McIntyre
On Wed, Jul 9, 2008 at 3:26 PM, Robert Kern <[EMAIL PROTECTED]> wrote: > I don't think it's worth automating on every run. People can see for > themselves if they have any such check_methods() and make the > conversion once: Does this fall into the "how in the world should I have known to do that"

Re: [Numpy-discussion] A couple of testing issues

2008-07-09 Thread Robert Kern
On Wed, Jul 9, 2008 at 14:26, Robert Kern <[EMAIL PROTECTED]> wrote: > On Wed, Jul 9, 2008 at 14:19, Alan McIntyre <[EMAIL PROTECTED]> wrote: > >> I can make a pass through all the test_* modules in the source tree >> under test and post a warning if "def check_" is found in them before >> handing

Re: [Numpy-discussion] A couple of testing issues

2008-07-09 Thread Robert Kern
On Wed, Jul 9, 2008 at 14:19, Alan McIntyre <[EMAIL PROTECTED]> wrote: > I can make a pass through all the test_* modules in the source tree > under test and post a warning if "def check_" is found in them before > handing things over to nose.Anyone else have thoughts on this? I don't think i

Re: [Numpy-discussion] Multiplying every 3 elements by a vector?

2008-07-09 Thread Charles R Harris
On Wed, Jul 9, 2008 at 1:16 PM, Marlin Rowley <[EMAIL PROTECTED]> wrote: > All: > > I'm trying to take a constant vector: > > v = (0.122169, 0.61516, 0.262671) > > and multiply those values by every 3 components in an array of length N: > > A = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ] > > So what I w

Re: [Numpy-discussion] A couple of testing issues

2008-07-09 Thread Alan McIntyre
On Wed, Jul 9, 2008 at 9:26 AM, Anne Archibald <[EMAIL PROTECTED]> wrote: >> - Test functions and methods will only be picked up based on name if >> they begin with "test"; "check_*" will no longer be seen as a test >> function. > > Is it possible to induce nose to pick these up and, if not actuall

[Numpy-discussion] Multiplying every 3 elements by a vector?

2008-07-09 Thread Marlin Rowley
All: I'm trying to take a constant vector: v = (0.122169, 0.61516, 0.262671) and multiply those values by every 3 components in an array of length N: A = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ] So what I want is: v[0]*A[0] v[1]*A[1] v[2]*A[2] v[0]*A[3] v[1]*A[4] v[2]*A[5] v[0]*A[6] ...

Re: [Numpy-discussion] Numpy-discussion Digest, Vol 22, Issue 32

2008-07-09 Thread Charles R Harris
On Wed, Jul 9, 2008 at 11:11 AM, Catherine Moroney < [EMAIL PROTECTED]> wrote: > > On Jul 9, 2008, at 10:00 AM, [EMAIL PROTECTED] wrote: > > > Send Numpy-discussion mailing list submissions to > > numpy-discussion@scipy.org > > > > To subscribe or unsubscribe via the World Wide Web, visit >

Re: [Numpy-discussion] Numpy-discussion Digest, Vol 22, Issue 32

2008-07-09 Thread Catherine Moroney
On Jul 9, 2008, at 10:00 AM, [EMAIL PROTECTED] wrote: > Send Numpy-discussion mailing list submissions to > numpy-discussion@scipy.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://projects.scipy.org/mailman/listinfo/numpy-discussion > or, via email, send a me

[Numpy-discussion] REMINDER: SciPy 2008 Early Registration ends in 2 days

2008-07-09 Thread Jarrod Millman
Hello, This is a reminder that early registration for SciPy 2008 ends in two days on Friday, July 11th. To register, please see: http://conference.scipy.org/to_register This year's conference has two days for tutorials, two days of presentations, and ends with a two day coding sprint. If you

Re: [Numpy-discussion] element-wise logical operations on numpy arrays

2008-07-09 Thread Anne Archibald
2008/7/9 Catherine Moroney <[EMAIL PROTECTED]>: > I have a question about performing element-wise logical operations > on numpy arrays. > > If "a", "b" and "c" are numpy arrays of the same size, does the > following > syntax work? > > mask = (a > 1.0) & ((b > 3.0) | (c > 10.0)) > > It seems to be

Re: [Numpy-discussion] element-wise logical operations on numpy arrays

2008-07-09 Thread Charles R Harris
On Wed, Jul 9, 2008 at 10:21 AM, Catherine Moroney < [EMAIL PROTECTED]> wrote: > Hello, > > I have a question about performing element-wise logical operations > on numpy arrays. > > If "a", "b" and "c" are numpy arrays of the same size, does the > following > syntax work? > > mask = (a > 1.0) & ((

[Numpy-discussion] element-wise logical operations on numpy arrays

2008-07-09 Thread Catherine Moroney
Hello, I have a question about performing element-wise logical operations on numpy arrays. If "a", "b" and "c" are numpy arrays of the same size, does the following syntax work? mask = (a > 1.0) & ((b > 3.0) | (c > 10.0)) It seems to be performing correctly, but the documentation that I've

Re: [Numpy-discussion] Another reference count leak: ticket #848

2008-07-09 Thread Charles R Harris
On Wed, Jul 9, 2008 at 2:36 AM, Michael Abbott <[EMAIL PROTECTED]> wrote: > There are three separate patches in this message plus some remarks on > "stealing" reference counts at the bottom. > > > I really don't think that this design of reference count handling in > PyArray_FromAny (and consequ

Re: [Numpy-discussion] A couple of testing issues

2008-07-09 Thread Anne Archibald
2008/7/9 Alan McIntyre <[EMAIL PROTECTED]>: > - Test functions and methods will only be picked up based on name if > they begin with "test"; "check_*" will no longer be seen as a test > function. Is it possible to induce nose to pick these up and, if not actually run them, warn about them? It's n

Re: [Numpy-discussion] alterdot and restoredot

2008-07-09 Thread Anne Archibald
2008/7/9 Robert Kern <[EMAIL PROTECTED]>: >> - Which operations do the functions exactly affect? >> It seems that alterdot sets the "dot" function slot to a BLAS >> version, but what operations does this affect? > > dot(), vdot(), and innerproduct() on C-contiguous arrays which are > Matrix-Matr

Re: [Numpy-discussion] Another reference count leak: ticket #848

2008-07-09 Thread David Cournapeau
> I really don't think that this design of reference count handling in > PyArray_FromAny (and consequently PyArray_CheckFromAny) is a good idea. > Unfortunately these seem to be part of the published API, so presumably > it's too late to change this? (Otherwise I might see how the > corresponding

Re: [Numpy-discussion] Detecting phase windings

2008-07-09 Thread Gary Ruben
I had a chance to look at Anne's suggestion from this thread and I thought I should post my phase winding finder solution, which is slightly modified from her idea. Thanks Anne. This is a vast improvement over my original slow

Re: [Numpy-discussion] alterdot and restoredot

2008-07-09 Thread Robert Kern
On Wed, Jul 9, 2008 at 02:53, Pauli Virtanen <[EMAIL PROTECTED]> wrote: > > Tue, 08 Jul 2008 23:03:52 -0500, Robert Kern wrote: >> On Tue, Jul 8, 2008 at 14:01, Keith Goodman <[EMAIL PROTECTED]> wrote: >>> I don't know what to write for a doc string for alterdot and >>> restoredot. >> >> Then maybe

Re: [Numpy-discussion] Another reference count leak: ticket #848

2008-07-09 Thread Michael Abbott
On Wed, 9 Jul 2008, Michael Abbott wrote: > Well then, I need to redo my patch. Here's the new patch for > ..._arrtype_new: I'm sorry about this, I posted too early. Here is the final patch (and I'll update the ticket accordingly). commit a1ff570cbd3ca6c28f87c55cebf2675b395c6fa0 Author: Mic

Re: [Numpy-discussion] Documentation: topical docs and reviewing our work

2008-07-09 Thread Robert Kern
On Wed, Jul 9, 2008 at 03:28, Stéfan van der Walt <[EMAIL PROTECTED]> wrote: > Please log in and leave comments on those. Your input would be much > appreciated! Each docstring page could use a "Next" link to move to the next docstring with the same review status (actually, the same review status

Re: [Numpy-discussion] Another reference count leak: ticket #848

2008-07-09 Thread Michael Abbott
There are three separate patches in this message plus some remarks on "stealing" reference counts at the bottom. On Tue, 8 Jul 2008, Travis E. Oliphant wrote: > Michael Abbott wrote: > > On Tue, 8 Jul 2008, Travis E. Oliphant wrote: > >> The first part of this patch is good. The second is not

[Numpy-discussion] Documentation: topical docs and reviewing our work

2008-07-09 Thread Stéfan van der Walt
Hi all, A `numpy.doc` sub-module has been added, which contains documentation for topics such as indexing, broadcasting, array operations etc. These can be edited from the documentation wiki: http://sd-2116.dedibox.fr/pydocweb/doc/numpy.doc/ If you'd like to document a topic that is not there, l

Re: [Numpy-discussion] alterdot and restoredot

2008-07-09 Thread Pauli Virtanen
Tue, 08 Jul 2008 23:03:52 -0500, Robert Kern wrote: > On Tue, Jul 8, 2008 at 14:01, Keith Goodman <[EMAIL PROTECTED]> wrote: >> I don't know what to write for a doc string for alterdot and >> restoredot. > > Then maybe you're the best one to figure it out. What details do you > think are missing