Re: [Numpy-discussion] Adding a version system to the deprecation functions in numpy/lib/utils ?

2008-06-19 Thread Robert Kern
On Fri, Jun 20, 2008 at 01:29, David Cournapeau <[EMAIL PROTECTED]> wrote: > Hi, > >I was thinking about adding a versioning into the deprecation > related functions. E.g., you could say that one function is deprecated > in version 1.2, but adding a in_version in deprecate. Does anyone have > s

[Numpy-discussion] Adding a version system to the deprecation functions in numpy/lib/utils ?

2008-06-19 Thread David Cournapeau
Hi, I was thinking about adding a versioning into the deprecation related functions. E.g., you could say that one function is deprecated in version 1.2, but adding a in_version in deprecate. Does anyone have strong feeling against it ? It should be a transparant change. I would also like t

Re: [Numpy-discussion] Updating cython directory to pxd usage: objections?

2008-06-19 Thread Fernando Perez
On Thu, Jun 19, 2008 at 5:29 PM, Robert Kern <[EMAIL PROTECTED]> wrote: >> I just tested the changes and there seem to be no ill effects. Should >> I go ahead and commit it? I'll do it in a single commit with no other >> changes so it's easy to revert should it prove to be a bad idea. > > Sure.

Re: [Numpy-discussion] Detecting phase windings

2008-06-19 Thread Anne Archibald
2008/6/16 [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > I have a speed problem with the approach I'm using to detect phase wrappings > in a 3D data set. In my application, phaseField is a 3D array containing the > phase values of a field. In order to detect the vortices/phase windings at > each point

Re: [Numpy-discussion] CFLAGS= causes bad build

2008-06-19 Thread David Cournapeau
Charles R Harris wrote: > The compile flags are missing -fno-strict-aliasing. I don't know if > this is a problem with the python distutils or what, but it would be > nice if it didn't occur. Yes. That's one of the reasons why I started numscons. The current behavior in numpy.distutils is for t

Re: [Numpy-discussion] Find groups of true values or sequence of values

2008-06-19 Thread Anne Archibald
2008/6/18 bevan <[EMAIL PROTECTED]>: > Hello, > > I am looking for some pointers that will hopefully get me a round an issue I > have hit. > > I have a timeseries of river flow and would like to carry out some analysis on > the recession periods. That is anytime the values are decreasing. I would

Re: [Numpy-discussion] Updating cython directory to pxd usage: objections?

2008-06-19 Thread Matthew Brett
Hi, >> As long as it doesn't cause problems, then I'd vote for doing it. >> This only happens at module import time, so even if several modules >> using cython call it, it's only when they get imported. I think the >> API simplification is worth it (minor, but still nice). >> >> I just tested the

Re: [Numpy-discussion] ma's maximum_fill_value function in 1.1.0

2008-06-19 Thread Robert Kern
On Thu, Jun 19, 2008 at 19:38, Pierre GM <[EMAIL PROTECTED]> wrote: > On Thursday 19 June 2008 20:28:46 Robert Kern wrote: >> On Thu, Jun 19, 2008 at 19:15, Pierre GM <[EMAIL PROTECTED]> wrote: >> > Your question raises a good point: is there any consensus on using >> > __all__ instead of the modul

Re: [Numpy-discussion] ma's maximum_fill_value function in 1.1.0

2008-06-19 Thread Pierre GM
On Thursday 19 June 2008 20:28:46 Robert Kern wrote: > On Thu, Jun 19, 2008 at 19:15, Pierre GM <[EMAIL PROTECTED]> wrote: > > Your question raises a good point: is there any consensus on using > > __all__ instead of the module namespace ? > > I'm not sure what you mean. Can you clarify? __all__

Re: [Numpy-discussion] Updating cython directory to pxd usage: objections?

2008-06-19 Thread Robert Kern
On Thu, Jun 19, 2008 at 19:18, Fernando Perez <[EMAIL PROTECTED]> wrote: > On Thu, Jun 19, 2008 at 5:06 PM, Robert Kern <[EMAIL PROTECTED]> wrote: >> On Thu, Jun 19, 2008 at 19:02, Stéfan van der Walt <[EMAIL PROTECTED]> wrote: >>> 2008/6/19 Fernando Perez <[EMAIL PROTECTED]>: > - import_array(

Re: [Numpy-discussion] ma's maximum_fill_value function in 1.1.0

2008-06-19 Thread Robert Kern
On Thu, Jun 19, 2008 at 19:15, Pierre GM <[EMAIL PROTECTED]> wrote: > Your question raises a good point: is there any consensus on using __all__ > instead of the module namespace ? I'm not sure what you mean. Can you clarify? -- Robert Kern "I have come to believe that the whole world is an en

[Numpy-discussion] Nose, doctests and extension modules

2008-06-19 Thread Fernando Perez
Hi all, as we transition over to nose in full (which I'm very happy to see), we'll want to have a good solution to finding doctests in extension modules. My initial efforts haven't been very fruitful on this front, and if any of you has any insights, I'd appreciate to hear them. I started the co

Re: [Numpy-discussion] Updating cython directory to pxd usage: objections?

2008-06-19 Thread Fernando Perez
On Thu, Jun 19, 2008 at 5:06 PM, Robert Kern <[EMAIL PROTECTED]> wrote: > On Thu, Jun 19, 2008 at 19:02, Stéfan van der Walt <[EMAIL PROTECTED]> wrote: >> 2008/6/19 Fernando Perez <[EMAIL PROTECTED]>: - import_array(). Can we put it at the bottom of c_numpy.pxd, so that users don't have

Re: [Numpy-discussion] ma's maximum_fill_value function in 1.1.0

2008-06-19 Thread Pierre GM
Reggie, Good to hear from you. There are no particular reason why maximum/minimum/default_fill_value functions should stay in limbo, I'll put them in __all__. I'll also try to implement the accumulate/reduceat functions for maximum/minimum, using the work you've done on _extrema_functions. You

Re: [Numpy-discussion] Updating cython directory to pxd usage: objections?

2008-06-19 Thread Robert Kern
On Thu, Jun 19, 2008 at 19:02, Stéfan van der Walt <[EMAIL PROTECTED]> wrote: > 2008/6/19 Fernando Perez <[EMAIL PROTECTED]>: >>> - import_array(). Can we put it at the bottom of c_numpy.pxd, so that >>> users don't have to import it every time? >> >> Sounds fine to me, but I don't know if there c

Re: [Numpy-discussion] Updating cython directory to pxd usage: objections?

2008-06-19 Thread Stéfan van der Walt
2008/6/19 Fernando Perez <[EMAIL PROTECTED]>: >> - import_array(). Can we put it at the bottom of c_numpy.pxd, so that >> users don't have to import it every time? > > Sounds fine to me, but I don't know if there could be a subtle problem > with pxds used by multiple pyx files. I'm not comfortabl

Re: [Numpy-discussion] Is there a function to calculate ecnomic beta coefficient in numpy given two time series data.

2008-06-19 Thread Robert Kern
On Thu, Jun 19, 2008 at 18:18, Vineet Jain (gmail) <[EMAIL PROTECTED]> wrote: > Thanks. > > With your changes, I'm getting a beta of 0.23 which I think is still wrong. > I would have expected a value closer to 2. To get the beta of AAPL versus the index , you need to swap aapl_ret and _ret

Re: [Numpy-discussion] Is there a function to calculate ecnomic beta coefficient in numpy given two time series data.

2008-06-19 Thread Vineet Jain (gmail)
Thanks. With your changes, I'm getting a beta of 0.23 which I think is still wrong. I would have expected a value closer to 2. Vineet -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Robert Kern Sent: Thursday, June 19, 2008 7:08 PM To: Discussion of N

Re: [Numpy-discussion] Cython headers in numpy include

2008-06-19 Thread Matthew Brett
Hi, > Cython looks in the include_dirs for .pxd files, right? Then yes, I > would support putting them alongside arrayobject.h. Yes, right - Fernando just pointed me to the reference - quoting him: "As indicated here: http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/version/Doc/Manual/s

Re: [Numpy-discussion] Cython headers in numpy include

2008-06-19 Thread Robert Kern
On Thu, Jun 19, 2008 at 18:02, Matthew Brett <[EMAIL PROTECTED]> wrote: >>> Following on from Fernando's post about his Cython example, I would >>> like to suggest adding his .pxd files to the standard numpy include >>> directory, fetched with np.get_include() >> >> I am a bit hesitant to add them

Re: [Numpy-discussion] Is there a function to calculate ecnomic beta coefficient in numpy given two time series data.

2008-06-19 Thread Robert Kern
On Thu, Jun 19, 2008 at 17:48, Vineet Jain (gmail) <[EMAIL PROTECTED]> wrote: > I took the following code and applied it to aapl and time series (see > attached file): > > import numpy as np > lstsq = np.linalg.lstsq > from numpy import float64, extract > > aapl_array = np.array([row[0] for ro

Re: [Numpy-discussion] Cython headers in numpy include

2008-06-19 Thread Matthew Brett
>> Following on from Fernando's post about his Cython example, I would >> like to suggest adding his .pxd files to the standard numpy include >> directory, fetched with np.get_include() > > I am a bit hesitant to add them to a standard "public" path until they > are close to complete. As usual, fa

Re: [Numpy-discussion] Cython headers in numpy include

2008-06-19 Thread Robert Kern
On Thu, Jun 19, 2008 at 17:46, Matthew Brett <[EMAIL PROTECTED]> wrote: > Hi, > > Following on from Fernando's post about his Cython example, I would > like to suggest adding his .pxd files to the standard numpy include > directory, fetched with np.get_include() I am a bit hesitant to add them to

[Numpy-discussion] ma's maximum_fill_value function in 1.1.0

2008-06-19 Thread Reggie Dugard
This is just a minor question/problem with the new numpy.ma in version 1.1.0. Because maximum and minimum in ma lack an accumulate attribute, I've duplicated the functionality using the maximum_fill_value/minimum_fill_value functions and doing something like: np.ma.masked_array(np.maximum.accumul

Re: [Numpy-discussion] Is there a function to calculate ecnomic beta coefficient in numpy given two time series data.

2008-06-19 Thread Vineet Jain (gmail)
I took the following code and applied it to aapl and time series (see attached file): import numpy as np lstsq = np.linalg.lstsq from numpy import float64, extract aapl_array = np.array([row[0] for row in stock_and_market_values]) _array = np.array([row[1] for row in stock_and_market_val

[Numpy-discussion] Cython headers in numpy include

2008-06-19 Thread Matthew Brett
Hi, Following on from Fernando's post about his Cython example, I would like to suggest adding his .pxd files to the standard numpy include directory, fetched with np.get_include() Why: Because anyone writing a Cython extension for numpy will need these files. At the moment, this means that ever

Re: [Numpy-discussion] embedded arrays - continued

2008-06-19 Thread Thomas Hrabe
Hi, I am still tracking down the memory bug in my C module and I have found a odd inconsistency. I call import_array in the init function of the module and I want to check in the later code if numpy has been initialised before by checking the PyArray_API value if it is NULL. I have found out

Re: [Numpy-discussion] Updating cython directory to pxd usage: objections?

2008-06-19 Thread Stéfan van der Walt
2008/6/19 Matthew Brett <[EMAIL PROTECTED]>: >>> - There's a bug in the latest Cython annotation, preventing the >>> example from compiling. Workaround: replace "cython -a" with >>> "cython". >> >> Mmh, I have 0.9.8 (their last release) and it works for me... > > I've got the same version, works f

Re: [Numpy-discussion] Updating cython directory to pxd usage: objections?

2008-06-19 Thread Matthew Brett
Hi, >> - There's a bug in the latest Cython annotation, preventing the >> example from compiling. Workaround: replace "cython -a" with >> "cython". > > Mmh, I have 0.9.8 (their last release) and it works for me... I've got the same version, works for me too... Matthew __

Re: [Numpy-discussion] Updating cython directory to pxd usage: objections?

2008-06-19 Thread Fernando Perez
On Thu, Jun 19, 2008 at 2:31 AM, Stéfan van der Walt <[EMAIL PROTECTED]> wrote: > You weren't the only one confused. In fact, reading the FAQ didn't help me: > > http://wiki.cython.org/FAQ#head-a3d09805a03c014080feff45fe8e22024d473d62 > > The NumPy definitions are all external, so why shouldn't t

Re: [Numpy-discussion] nose changes checked in

2008-06-19 Thread Robert Kern
On Thu, Jun 19, 2008 at 11:59, Alan McIntyre <[EMAIL PROTECTED]> wrote: > On Wed, Jun 18, 2008 at 5:24 PM, Robert Kern <[EMAIL PROTECTED]> wrote: >>> - The signature of numpy.test in 1.2 will be backward compatible with >>> 1.1, and it will at least return some indication of failure (if not >>> the

[Numpy-discussion] Fancy index assign ignores extra assignees

2008-06-19 Thread Andreas Klöckner
Hi all, Is this supposed to be like that, i.e. is the fancy __setitem__ supposed to not complain about unused assignees? >>> v = zeros((10,)) >>> z = [1,2,5] >>> v[z] = [1,2,4,5] >>> v array([ 0., 1., 2., 0., 0., 4., 0., 0., 0., 0.]) Contrast with: >>> v[1:3] = [1,2,3,4] Traceback (mo

[Numpy-discussion] CFLAGS= causes bad build

2008-06-19 Thread Charles R Harris
Having an empty CFLAGS environment variable and running $ python setup.py build emits tons of these messages: numpy/core/src/scalartypes.inc.src: In function 'scalar_value': numpy/core/src/scalartypes.inc.src:77: warning: dereferencing type-punned pointer will break strict-aliasing rules The co

Re: [Numpy-discussion] nose changes checked in

2008-06-19 Thread Alan McIntyre
On Wed, Jun 18, 2008 at 5:24 PM, Robert Kern <[EMAIL PROTECTED]> wrote: >> - The signature of numpy.test in 1.2 will be backward compatible with >> 1.1, and it will at least return some indication of failure (if not >> the same object as in 1.1). This will, by the way, make it different >> from th

Re: [Numpy-discussion] Strange behavior for argsort() and take()

2008-06-19 Thread Anne Archibald
2008/6/18 Charles R Harris <[EMAIL PROTECTED]>: > > > On Wed, Jun 18, 2008 at 11:48 AM, Anne Archibald <[EMAIL PROTECTED]> > wrote: >> >> 2008/6/18 Stéfan van der Walt <[EMAIL PROTECTED]>: >> > 2008/6/18 Anne Archibald <[EMAIL PROTECTED]>: >> >> In [7]: x.take(x.argsort()) >> >> Out[7]: array([ 0.

Re: [Numpy-discussion] Updating cython directory to pxd usage: objections?

2008-06-19 Thread Stéfan van der Walt
2008/6/19 Fernando Perez <[EMAIL PROTECTED]>: > after I updated the pyrex code to use cython, a bit of confusion led > me to using .pxi includes instead of .pxd files and cimport. That > turned out to be mistaken, as later clarified by the Cython team: > > http://codespeak.net/pipermail/cython-dev