Re: [Numpy-discussion] numpy.load raising IOError but EOFError expected

2010-06-28 Thread Friedrich Romstedt
2010/6/28 Keith Goodman : > How about using h5py? It's not part of numpy but it gives you a > dictionary-like interface to your archive: Yeaa, or PyTables (is that equivalent)? It's also a hdf (or whatever, I don't recall precisely) interface. There were [ANN]s on the list about PyTables. Fried

Re: [Numpy-discussion] numpy.load raising IOError but EOFError expected

2010-06-28 Thread Keith Goodman
On Wed, Jun 23, 2010 at 3:46 AM, Ruben Salvador wrote: > Hi there, > > I have a .npy file built by succesively adding results from different test > runs of an algorithm. Each time it's run, I save a numpy.array using > numpy.save as follows: > > fn = 'file.npy' > f = open(fn, 'a+b') > np.save(f, a

Re: [Numpy-discussion] numpy.load raising IOError but EOFError expected

2010-06-28 Thread Pauli Virtanen
ma, 2010-06-28 kello 15:48 -0400, Anne Archibald kirjoitti: [clip] > That said, good exception hygiene argues that np.load should throw > EOFErrors rather than the more generic IOErrors, but I don't know how > difficult this would be to achieve. np.load is in any case unhygienic, since it tries to

Re: [Numpy-discussion] numpy.load raising IOError but EOFError expected

2010-06-28 Thread Anne Archibald
On 28 June 2010 10:52, Ruben Salvador wrote: > Sorry I had no access during these days. > > Thanks for the answer Friedrich, I had already checked numpy.savez, but > unfortunately I cannot make use of it. I don't have all the data needed to > be saved at the same time...it is produced each time I

Re: [Numpy-discussion] numpy.load raising IOError but EOFError expected

2010-06-28 Thread Friedrich Romstedt
2010/6/28 Ruben Salvador : > Thanks for the answer Friedrich, I had already checked numpy.savez, but > unfortunately I cannot make use of it. I don't have all the data needed to > be saved at the same time...it is produced each time I run a test. Yes, I thought of something like: all_data = numpy

Re: [Numpy-discussion] Decorator to access intermediate results in a function/algorithm

2010-06-28 Thread Pietro Berkes
Dear Mike, Thanks for the feedback. On Mon, Jun 28, 2010 at 12:51 PM, Michael Droettboom wrote: > What are the implications of this with respect to memory usage?  When > working with large arrays, if the intermediate values of a number of > functions are kept around (whether we want to access the

Re: [Numpy-discussion] Decorator to access intermediate results in a function/algorithm

2010-06-28 Thread Michael Droettboom
What are the implications of this with respect to memory usage? When working with large arrays, if the intermediate values of a number of functions are kept around (whether we want to access them or not) could this not lead to excessive memory usage? Maybe this behavior should only apply when

[Numpy-discussion] Decorator to access intermediate results in a function/algorithm

2010-06-28 Thread Pietro Berkes
Dear everybody, This message belongs only marginally to a numpy-related mailing list, but I thought it might be of interest here since it addresses what I believe is a common pattern in scientific development. My apologies if that is not the case... The code can be found at http://github.com/pber

Re: [Numpy-discussion] Is numpy ignoring CFLAGS?

2010-06-28 Thread Dr. David Kirkby
On 06/28/10 02:54 PM, David Cournapeau wrote: > On Mon, Jun 28, 2010 at 9:28 PM, Dr. David Kirkby > wrote: >> On 06/28/10 11:28 AM, David Cournapeau wrote: >>> On Mon, Jun 28, 2010 at 6:56 PM, Dr. David Kirkby >> Many other parts of Sage seem to inherit the flags ok from Python, but not >>>

Re: [Numpy-discussion] numpy.load raising IOError but EOFError expected

2010-06-28 Thread Pauli Virtanen
ke, 2010-06-23 kello 12:46 +0200, Ruben Salvador kirjoitti: [clip] > how can I detect the EOF to stop reading r = f.read(1) if not r: break # EOF else: f.seek(-1, 1) -- Pauli Virtanen ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.or

Re: [Numpy-discussion] numpy.load raising IOError but EOFError expected

2010-06-28 Thread Ruben Salvador
Sorry I had no access during these days. Thanks for the answer Friedrich, I had already checked numpy.savez, but unfortunately I cannot make use of it. I don't have all the data needed to be saved at the same time...it is produced each time I run a test. Thanks anyway! Any other idea why this is

Re: [Numpy-discussion] Is numpy ignoring CFLAGS?

2010-06-28 Thread David Cournapeau
On Mon, Jun 28, 2010 at 9:28 PM, Dr. David Kirkby wrote: > On 06/28/10 11:28 AM, David Cournapeau wrote: >> On Mon, Jun 28, 2010 at 6:56 PM, Dr. David Kirkby > >>> Many other parts of Sage seem to inherit the flags ok from Python, but not >>> numpy. >> >> Are you saying that OPT is not taken into

Re: [Numpy-discussion] numscons and Python 2.7 problems

2010-06-28 Thread Vincent Davis
On Fri, Jun 25, 2010 at 12:05 PM, Christoph Gohlke wrote:> > > On 6/7/2010 1:58 PM, Charles R Harris wrote: >> >> >> On Mon, Jun 7, 2010 at 2:07 PM, Christoph Gohlke > > wrote: >> >>     Dear NumPy developers, >> >>     I was trying to build numpy 2.0.dev and scipy 0.9.dev

Re: [Numpy-discussion] Is numpy ignoring CFLAGS?

2010-06-28 Thread Dr. David Kirkby
On 06/28/10 11:28 AM, David Cournapeau wrote: > On Mon, Jun 28, 2010 at 6:56 PM, Dr. David Kirkby >> Many other parts of Sage seem to inherit the flags ok from Python, but not >> numpy. > > Are you saying that OPT is not taken into account ? It seems to work > for me, e.g. > > OPT="-m64" python s

Re: [Numpy-discussion] Is numpy ignoring CFLAGS?

2010-06-28 Thread David Cournapeau
On Mon, Jun 28, 2010 at 6:56 PM, Dr. David Kirkby wrote: > On 06/28/10 09:38 AM, Dag Sverre Seljebotn wrote: >> Dr. David Kirkby wrote: >>> On some 64-bit platforms, which include, but is not limited to: >>> >>>    * Some version of OS X (I don't know what versions or processors) >>>    * Solaris

Re: [Numpy-discussion] Is numpy ignoring CFLAGS?

2010-06-28 Thread Dr. David Kirkby
On 06/28/10 09:38 AM, Dag Sverre Seljebotn wrote: > Dr. David Kirkby wrote: >> On some 64-bit platforms, which include, but is not limited to: >> >>* Some version of OS X (I don't know what versions or processors) >>* Solaris on SPARC processors. >>* Solaris on x86 processors. >>* O

Re: [Numpy-discussion] Possible to use numexpr with user made ufuncs/scipy ufuncs?

2010-06-28 Thread Francesc Alted
A Monday 28 June 2010 10:22:31 Pauli Virtanen escrigué: > ma, 2010-06-28 kello 09:48 +0200, Francesc Alted kirjoitti: > [clip] > > > But again, the nice thing would be to implement such a special functions > > in terms of numexpr expressions so that the evaluation itself can be > > faster. Admitte

Re: [Numpy-discussion] Is numpy ignoring CFLAGS?

2010-06-28 Thread Dag Sverre Seljebotn
Dr. David Kirkby wrote: > On some 64-bit platforms, which include, but is not limited to: > > * Some version of OS X (I don't know what versions or processors) > * Solaris on SPARC processors. > * Solaris on x86 processors. > * OpenSolaris on SPARC processors. > * OpenSolaris on x86 proce

Re: [Numpy-discussion] Possible to use numexpr with user made ufuncs/scipy ufuncs?

2010-06-28 Thread Pauli Virtanen
ma, 2010-06-28 kello 09:48 +0200, Francesc Alted kirjoitti: [clip] > But again, the nice thing would be to implement such a special functions in > terms of numexpr expressions so that the evaluation itself can be faster. > Admittedly, that would take a bit more time. Quite often, you need to ev

Re: [Numpy-discussion] Possible to use numexpr with us er made ufuncs/scipy ufuncs?

2010-06-28 Thread Francesc Alted
A Saturday 26 June 2010 19:17:43 Pauli Virtanen escrigué: > But what if such an expression does not exist? For example, there is no > finite closed form expression for the Bessel functions in terms of > elementary functions. An accurate implementation is rather complicated, > and usually piecewise