[Numpy-discussion] Dynamic module not initialized properly

2007-03-30 Thread Mark Janikas
Hello all, I am having an issue importing numpy on subsequent (I.e. not on first load) attempts in our software. The majority of the code is written in C, C++ and I am a python developer and do not have direct access to a lot of it. This is a bit of a difficult question to ask all of you beca

Re: [Numpy-discussion] Best way to run python parallel

2007-03-30 Thread Lisandro Dalcin
On 3/29/07, Brad Malone <[EMAIL PROTECTED]> wrote: > Hi, I use python for some fairly heavy scientific computations (at least to > be running on a single processor) and would like to use it in parallel. > I've seen some stuff online about Parallel Python and mpiPy, but I don't > know much about the

Re: [Numpy-discussion] converting scalar to array with dimension 1

2007-03-30 Thread Pierre GM
On Friday 30 March 2007 17:43:42 Bill Baxter wrote: > Actually I > didn't realize that it had a loop in it, so thanks for pointing that > out. I thought it was just and alias for array with some args. I just realized that myself, going directly in the sources: that's how I found that the ndmin

Re: [Numpy-discussion] converting scalar to array with dimension 1

2007-03-30 Thread Bill Baxter
On 3/31/07, Pierre GM <[EMAIL PROTECTED]> wrote: > > > I think you'll want to add the copy=False arg if you go that route, or > > else you'll end up with something that's much slower than atleast_1d > > for any array that gets passed in. :-) > > Yep indeed. We can also add the subok=True flag. > >

Re: [Numpy-discussion] converting scalar to array with dimension 1

2007-03-30 Thread Pierre GM
On Friday 30 March 2007 16:26:26 Robert Kern wrote: > True, not every > two-liner should be in the core, but very-frequently-used two-liners that > state the authors intent clearer can have a good case made for them. Fair enough, I'll keep that in mind. Thanks again! __

Re: [Numpy-discussion] converting scalar to array with dimension 1

2007-03-30 Thread Robert Kern
Pierre GM wrote: >Bill Baxter wrote: >> a = array(a, copy=0,ndmin=1) >> >> Anyway, sounds like premature optimization to me. > > Ah, prematurity depends on the context, doesn't it ? Isn't there some famous > quote about two-liners ? Here, we have a function that does little more but > calling

Re: [Numpy-discussion] converting scalar to array with dimension 1

2007-03-30 Thread Pierre GM
> I think you'll want to add the copy=False arg if you go that route, or > else you'll end up with something that's much slower than atleast_1d > for any array that gets passed in. :-) Yep indeed. We can also add the subok=True flag. > a = array(a, copy=0,ndmin=1) > > Anyway, sounds like prem

Re: [Numpy-discussion] converting scalar to array with dimension 1

2007-03-30 Thread Bill Baxter
On 3/31/07, P GM <[EMAIL PROTECTED]> wrote: > Actually, there's even faster than that: > > a = 3 > a = array(a, ndmin=1) > > > atleast_1d is nothing but a wrapper function, that works best when used with > several inputs. When using only one array as inputs, the trick above should > be more appropr

Re: [Numpy-discussion] converting scalar to array with dimension 1

2007-03-30 Thread P GM
Actually, there's even faster than that: a = 3 a = array(a, ndmin=1) atleast_1d is nothing but a wrapper function, that works best when used with several inputs. When using only one array as inputs, the trick above should be more appropriate. On 3/30/07, Bill Baxter <[EMAIL PROTECTED]> wrote

[Numpy-discussion] organizational question

2007-03-30 Thread Alan G Isaac
Is either NumPy or SciPy substantially supported by an identifiable and actual non-profit organization? I ask because I think both fit under http://www.mellon.org/grant_programs/programs/copy_of_research item 4. Here is the announcement: http://matc.mellon.org/ Note that universities are among

Re: [Numpy-discussion] I've just commited a fast-clip function

2007-03-30 Thread Travis Oliphant
Stefan van der Walt wrote: >On Thu, Mar 29, 2007 at 11:21:07PM -0600, Travis Oliphant wrote: > > > >Record arrays also cause problems, i.e. > > I think I've fixed these errors (reference counting problems), now. If we can get the tests added, then we can just run numpy.test() Thanks for you

Re: [Numpy-discussion] converting scalar to array with dimension 1

2007-03-30 Thread Bill Baxter
atleast_1d will do the trick In [11]: a = 3 In [12]: a = atleast_1d(a) In [13]: shape(a) Out[13]: (1,) In [14]: a.shape # also works ;-) Out[14]: (1,) In [15]: a[0] Out[15]: 3 --bb On 3/30/07, Mark Bakker <[EMAIL PROTECTED]> wrote: > Hello list - > > I have a function that normally accepts an

Re: [Numpy-discussion] I've just commited a fast-clip function

2007-03-30 Thread Travis Oliphant
David Cournapeau wrote: >Travis Oliphant wrote: > > >>Hey folks, >> >>I've just committed a revision of ticket #425 to speed up clipping in >>the scalar case. I also altered the PyArray_Conjugate function (called >>by the conjugate method) to use the ufunc for complex data. >> >>These were s

Re: [Numpy-discussion] isarray in numpy?

2007-03-30 Thread Eric Firing
Travis Oliphant wrote: > mark wrote: > >> Is there a way to check whether something is an array? >> It seems that >> >> > isinstance(a, numpy.ndarray) > > This will return True if a is an array or a sub-class. Watch out if you use numpy.ma; or use Pierre G-M's maskedarray instead (assuming y

Re: [Numpy-discussion] Should 0-d arrays with fields defined return a 0-d array or a scalar

2007-03-30 Thread Travis Oliphant
mark wrote: >Does this mean, we could do something like this? > >a = 3 >a = array(a) >a[ a<4 ] = 5 > > No. That would be a separate change. -Travis ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listi

Re: [Numpy-discussion] isarray in numpy?

2007-03-30 Thread Travis Oliphant
mark wrote: >Is there a way to check whether something is an array? >It seems that > > isinstance(a, numpy.ndarray) This will return True if a is an array or a sub-class. -Travis ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://p

[Numpy-discussion] isarray in numpy?

2007-03-30 Thread mark
Is there a way to check whether something is an array? It seems that isarray(a) is not there. Thanks and sorry for the newbie question, Mark ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-dis

Re: [Numpy-discussion] Should 0-d arrays with fields defined return a 0-d array or a scalar

2007-03-30 Thread mark
Does this mean, we could do something like this? a = 3 a = array(a) a[ a<4 ] = 5 If so, that would be great! Mark On Mar 29, 9:20 pm, Travis Oliphant <[EMAIL PROTECTED]> wrote: > Hi all, > > Ticket #474 discusses the problem that getting a field from a 0-d array > automatically produces a scala

[Numpy-discussion] converting scalar to array with dimension 1

2007-03-30 Thread Mark Bakker
Hello list - I have a function that normally accepts an array as input, but sometimes a scalar. I figured the easiest way to make sure the input is an array, is to make it an array. But if I make a float an array, it has 0 dimension, and I can still not do array manipulation on it. a = 3 a = ar

Re: [Numpy-discussion] Ticket 418

2007-03-30 Thread Fernando Perez
On 3/30/07, Gary Pajer <[EMAIL PROTECTED]> wrote: > On 3/30/07, Nils Wagner <[EMAIL PROTECTED]> wrote: > > Hi all, > > > > Is someone able to reproduce the segfault described at > > > > http://projects.scipy.org/scipy/numpy/ticket/418 > > > > with a recent svn version ? > > > > I am using > > >>> n

Re: [Numpy-discussion] I've just commited a fast-clip function

2007-03-30 Thread Stefan van der Walt
On Thu, Mar 29, 2007 at 11:21:07PM -0600, Travis Oliphant wrote: > I would appreciate it, if people could test out the new clip function > and conjugate method to make sure they are working well. All tests > pass, but there are some things we are not testing for. I need to still > add the clip

Re: [Numpy-discussion] Should 0-d arrays with fields defined return a 0-d array or a scalar

2007-03-30 Thread Christopher Hanley
Hi Travis, This change should not have any impact on our code. We are not opposed to making the change as part of the 1.0.2 release. Chris Christopher Hanley wrote: > Hi Travis, > > We will need a little time to inspect our code to see if this is going > to be a problem for us. We can't th

Re: [Numpy-discussion] I've just commited a fast-clip function

2007-03-30 Thread Stefan van der Walt
Hi Travis, On Thu, Mar 29, 2007 at 11:21:07PM -0600, Travis Oliphant wrote: > I would appreciate it, if people could test out the new clip function > and conjugate method to make sure they are working well. All tests > pass, but there are some things we are not testing for. I need to still >

Re: [Numpy-discussion] I've just commited a fast-clip function

2007-03-30 Thread Stefan van der Walt
Hi Travis On Thu, Mar 29, 2007 at 11:21:07PM -0600, Travis Oliphant wrote: > I've just committed a revision of ticket #425 to speed up clipping in > the scalar case. I also altered the PyArray_Conjugate function (called > by the conjugate method) to use the ufunc for complex data. > > These w

Re: [Numpy-discussion] Best way to run python parallel

2007-03-30 Thread Mandus
We have also done some work with BSP in the past (actually together with Konrad). It's a great model, and quite comfortable to work with. Also, with Konrads implementations it was very efficient at sending Numeric arrays around. But the main problem with BSP is that it is not very much used in th

Re: [Numpy-discussion] Ticket 418

2007-03-30 Thread Gary Pajer
On 3/30/07, Nils Wagner <[EMAIL PROTECTED]> wrote: > Hi all, > > Is someone able to reproduce the segfault described at > > http://projects.scipy.org/scipy/numpy/ticket/418 > > with a recent svn version ? > > I am using > >>> numpy.__version__ > '1.0.2.dev3616' > >>> scipy.__version__ > '0.5.3.dev2

Re: [Numpy-discussion] matrix indexing question

2007-03-30 Thread Charles R Harris
On 3/29/07, Timothy Hochberg <[EMAIL PROTECTED]> wrote: """matrix.py The discussion about matrix indexing has been interminible and for the most part pretty pointless IMO. However, it does point out one thing: the interaction between the matrix and array classes is still pretty klunky despite a

[Numpy-discussion] Ticket 418

2007-03-30 Thread Nils Wagner
Hi all, Is someone able to reproduce the segfault described at http://projects.scipy.org/scipy/numpy/ticket/418 with a recent svn version ? I am using >>> numpy.__version__ '1.0.2.dev3616' >>> scipy.__version__ '0.5.3.dev2892' Nils ___ Numpy-discus