Re: [Numpy-discussion] loadtxt raises an exception on empty file

2010-05-24 Thread Nadav Horesh
You can just catch the exception and decide what to do with it: try: data = np.loadtxt('foo.txt') except IOError: data = 0 # Or something similar Nadav -Original Message- From: numpy-discussion-boun...@scipy.org on behalf of Maria Liukis Sent: Tue 25-May-10 01:14 To: numpy-discu

Re: [Numpy-discussion] Extending documentation to c code

2010-05-24 Thread David Goldsmith
On Mon, May 24, 2010 at 8:06 PM, David Cournapeau wrote: > On Tue, May 25, 2010 at 3:01 AM, Charles R Harris > wrote: > > Hi All, > > > > I'm wondering if we could extend the current documentation format to the > c > > source code. The string blocks would be implemented something like > > > > /**

Re: [Numpy-discussion] loadtxt raises an exception on empty file

2010-05-24 Thread Vincent Davis
On Mon, May 24, 2010 at 4:14 PM, Maria Liukis wrote: > Hello everybody, > > I'm using numpy V1.3.0 and ran into a case when numpy.loadtxt('foo.txt') > raised an exception: > > >>>import numpy as np > >>>np.loadtxt('foo.txt') > Traceback (most recent call last): > File "", line 1, in > File > "

Re: [Numpy-discussion] Extending documentation to c code

2010-05-24 Thread David Cournapeau
On Tue, May 25, 2010 at 3:01 AM, Charles R Harris wrote: > Hi All, > > I'm wondering if we could extend the current documentation format to the c > source code. The string blocks would be implemented something like > > /**NpyDoc > """The Answer. > > Answer the Ultimate Question of Life, the Univer

Re: [Numpy-discussion] Extending documentation to c code

2010-05-24 Thread Charles R Harris
On Mon, May 24, 2010 at 6:17 PM, David Goldsmith wrote: > On Mon, May 24, 2010 at 4:59 PM, Charles R Harris < > charlesr.har...@gmail.com> wrote: > >> >> >> On Mon, May 24, 2010 at 2:11 PM, David Goldsmith > > wrote: >> >>> On Mon, May 24, 2010 at 11:01 AM, Charles R Harris < >>> charlesr.har...@g

Re: [Numpy-discussion] Tickets for review involving build problems, attn Ralf Gommers

2010-05-24 Thread Ralf Gommers
On Tue, May 25, 2010 at 12:25 AM, Charles R Harris < charlesr.har...@gmail.com> wrote: > Hi Ralf, > > As one of the official build gurus in training, could you look over the > tickets for review that fix build problems on various platforms? > > Sure, will do that in the next few weeks. Of course I

Re: [Numpy-discussion] Extending documentation to c code

2010-05-24 Thread David Goldsmith
On Mon, May 24, 2010 at 4:59 PM, Charles R Harris wrote: > > > On Mon, May 24, 2010 at 2:11 PM, David Goldsmith > wrote: > >> On Mon, May 24, 2010 at 11:01 AM, Charles R Harris < >> charlesr.har...@gmail.com> wrote: >> >>> Hi All, >>> >>> I'm wondering if we could extend the current documentatio

Re: [Numpy-discussion] Extending documentation to c code

2010-05-24 Thread Charles R Harris
On Mon, May 24, 2010 at 2:11 PM, David Goldsmith wrote: > On Mon, May 24, 2010 at 11:01 AM, Charles R Harris < > charlesr.har...@gmail.com> wrote: > >> Hi All, >> >> I'm wondering if we could extend the current documentation format to the c >> source code. The string blocks would be implemented so

Re: [Numpy-discussion] [Patch] Fix memmap pickling

2010-05-24 Thread Gael Varoquaux
On Mon, May 24, 2010 at 03:33:09PM -0700, Brent Pedersen wrote: > On Mon, May 24, 2010 at 3:25 PM, Gael Varoquaux > wrote: > > Memmapped arrays don't pickle right. I know that to get them to > > really pickle and restore identically, we would need some effort. > > However, in the current status, p

Re: [Numpy-discussion] [Patch] Fix memmap pickling

2010-05-24 Thread Brent Pedersen
On Mon, May 24, 2010 at 3:25 PM, Gael Varoquaux wrote: > Memmapped arrays don't pickle right. I know that to get them to > really pickle and restore identically, we would need some effort. > However, in the current status, pickling and restoring a memmapped array > leads to tracebacks that seem li

[Numpy-discussion] [Patch] Fix memmap pickling

2010-05-24 Thread Gael Varoquaux
Memmapped arrays don't pickle right. I know that to get them to really pickle and restore identically, we would need some effort. However, in the current status, pickling and restoring a memmapped array leads to tracebacks that seem like they could be avoided. I am attaching a patch with a test th

[Numpy-discussion] loadtxt raises an exception on empty file

2010-05-24 Thread Maria Liukis
Hello everybody, I'm using numpy V1.3.0 and ran into a case when numpy.loadtxt('foo.txt') raised an exception: >>>import numpy as np >>>np.loadtxt('foo.txt') Traceback (most recent call last): File "", line 1, in File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-pa

Re: [Numpy-discussion] Extending documentation to c code

2010-05-24 Thread David Goldsmith
On Mon, May 24, 2010 at 11:01 AM, Charles R Harris < charlesr.har...@gmail.com> wrote: > Hi All, > > I'm wondering if we could extend the current documentation format to the c > source code. The string blocks would be implemented something like > > /**NpyDoc > """The Answer. > > Answer the Ultimat

Re: [Numpy-discussion] calling C function from Python via f2py

2010-05-24 Thread Nadav Horesh
Sorry, can not figure it out, if you don't gen an answer on this list maybe you should address it on swig list. Personally I use cython for this purpose. Nadav -Original Message- From: numpy-discussion-boun...@scipy.org on behalf of Matt Fearon Sent: Mon 24-May-10 15:43 To: Discussio

[Numpy-discussion] Extending documentation to c code

2010-05-24 Thread Charles R Harris
Hi All, I'm wondering if we could extend the current documentation format to the c source code. The string blocks would be implemented something like /**NpyDoc """The Answer. Answer the Ultimate Question of Life, the Universe, and Everything. Parameters -- We don't need no stinkin' para

[Numpy-discussion] Tickets for review involving build problems, attn Ralf Gommers

2010-05-24 Thread Charles R Harris
Hi Ralf, As one of the official build gurus in training, could you look over the tickets for review that fix build problems on various platforms? TIA, Chuck ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/list

Re: [Numpy-discussion] building numpy against Cray xt-libsci

2010-05-24 Thread Charles R Harris
On Mon, May 24, 2010 at 1:57 AM, Amir wrote: > I am trying to build numpy against Cray's xt-libsci library on a Cray XT5. > I am getting an error I am hoping for hints on how to resolve: > > In [1]: import numpy > > 20 isfinite, size > 21 from numpy.lib import triu > ---> 22 fr

Re: [Numpy-discussion] calling C function from Python via f2py

2010-05-24 Thread Matt Fearon
Nadav, Thank you. I believe it is working now, as the pos(2) error is gone. However, though the error is gone, my return variable from the C function is not being updated as if the C code is not executing? Syntax to the call the C function from Python is the following: FFMCcalc.FFMCcalc(T,H,W,ro,

Re: [Numpy-discussion] Can not compile numpy with python2.7 onllinux

2010-05-24 Thread Nadav Horesh
That it, you just have to add the missing #endif after m = Py_InitModule . Thank you, Nadav. -Original Message- From: numpy-discussion-boun...@scipy.org on behalf of Charles R Harris Sent: Sun 23-May-10 20:48 To: Discussion of Numerical Python Subject: Re: [Numpy-discussion]

[Numpy-discussion] building numpy against Cray xt-libsci

2010-05-24 Thread Amir
I am trying to build numpy against Cray's xt-libsci library on a Cray XT5. I am getting an error I am hoping for hints on how to resolve: In [1]: import numpy 20 isfinite, size 21 from numpy.lib import triu ---> 22 from numpy.linalg import lapack_lite 23 from numpy.matrixli