Re: [Numpy-discussion] ANN: PyCPX 0.01, a numpy/cython wrapper for CPlex.

2011-09-18 Thread Davide
Thanks for your good work! Cheers, Davide On 09/19/2011 02:15 AM, Hoyt Koepke wrote: > Hello, > > I'm pleased to announce the first release of a wrapper I wrote for > IBM's CPlex Optimizer Suite. It focuses on ease of use and seamless > integration with numpy, and allows one to naturally specify

Re: [Numpy-discussion] datetime64 y2k38 bug

2011-09-18 Thread josef . pktd
On Sun, Sep 18, 2011 at 11:13 PM, Charles R Harris wrote: > > > On Sun, Sep 18, 2011 at 9:08 PM, Charles R Harris > wrote: >> >> >> On Sun, Sep 18, 2011 at 6:32 PM, Benjamin Root wrote: >>> >>> I was working on adding some test cases in numpy for the argmin/max >>> functions with some datetime64

Re: [Numpy-discussion] datetime64 y2k38 bug

2011-09-18 Thread Benjamin Root
On Sunday, September 18, 2011, Charles R Harris wrote: > > > On Sun, Sep 18, 2011 at 6:32 PM, Benjamin Root wrote: >> >> I was working on adding some test cases in numpy for the argmin/max functions with some datetime64s. I found that on my 32-bit machine, it fails to parse a date past the Y2.03

Re: [Numpy-discussion] datetime64 y2k38 bug

2011-09-18 Thread Charles R Harris
On Sun, Sep 18, 2011 at 9:08 PM, Charles R Harris wrote: > > > On Sun, Sep 18, 2011 at 6:32 PM, Benjamin Root wrote: > >> I was working on adding some test cases in numpy for the argmin/max >> functions with some datetime64s. I found that on my 32-bit machine, it >> fails to parse a date past t

Re: [Numpy-discussion] datetime64 y2k38 bug

2011-09-18 Thread Charles R Harris
On Sun, Sep 18, 2011 at 6:32 PM, Benjamin Root wrote: > I was working on adding some test cases in numpy for the argmin/max > functions with some datetime64s. I found that on my 32-bit machine, it > fails to parse a date past the Y2.038k date. I find this odd because the > datetime is supposed

[Numpy-discussion] datetime64 y2k38 bug

2011-09-18 Thread Benjamin Root
I was working on adding some test cases in numpy for the argmin/max functions with some datetime64s. I found that on my 32-bit machine, it fails to parse a date past the Y2.038k date. I find this odd because the datetime is supposed to be 64-bits, but I guess there is some arch-dependent code som

[Numpy-discussion] ANN: PyCPX 0.01, a numpy/cython wrapper for CPlex.

2011-09-18 Thread Hoyt Koepke
Hello, I'm pleased to announce the first release of a wrapper I wrote for IBM's CPlex Optimizer Suite. It focuses on ease of use and seamless integration with numpy, and allows one to naturally specify constrained linear and quadratic optimization problems over real, boolean, and integer variables

Re: [Numpy-discussion] Preventing an ndarray subclass from returning new subclass instances for std(), etc

2011-09-18 Thread Wes McKinney
On Sun, Sep 18, 2011 at 4:25 PM, Pierre GM wrote: > > On Sep 18, 2011, at 21:25 , Stéfan van der Walt wrote: > >> On Sun, Sep 18, 2011 at 9:48 AM, Keith Hughitt >> wrote: >>> Interesting. It works as expected when called as a method: >>> >>> In [10]: x = np.ma.array([[1,2,3]]) >>> In [11]: x.std

Re: [Numpy-discussion] Preventing an ndarray subclass from returning new subclass instances for std(), etc

2011-09-18 Thread Pierre GM
On Sep 18, 2011, at 21:25 , Stéfan van der Walt wrote: > On Sun, Sep 18, 2011 at 9:48 AM, Keith Hughitt > wrote: >> Interesting. It works as expected when called as a method: >> >> In [10]: x = np.ma.array([[1,2,3]]) >> In [11]: x.std() >> Out[11]: 0.81649658092772603 > > I'm guessing that np

Re: [Numpy-discussion] Preventing an ndarray subclass from returning new subclass instances for std(), etc

2011-09-18 Thread Stéfan van der Walt
On Sun, Sep 18, 2011 at 9:48 AM, Keith Hughitt wrote: > Interesting. It works as expected when called as a method: > > In [10]: x = np.ma.array([[1,2,3]]) > In [11]: x.std() > Out[11]: 0.81649658092772603 I'm guessing that np.ma.array implements its own std function, but I haven't checked. Stéfa

Re: [Numpy-discussion] Preventing an ndarray subclass from returning new subclass instances for std(), etc

2011-09-18 Thread josef . pktd
On Sun, Sep 18, 2011 at 12:48 PM, Keith Hughitt wrote: > Interesting. It works as expected when called as a method: > > In [10]: x = np.ma.array([[1,2,3]]) > In [11]: x.std() > Out[11]: 0.81649658092772603 That's only the treatment of scalars in std >>> x = np.ma.array(np.random.randn(4,5)) >>>

Re: [Numpy-discussion] Preventing an ndarray subclass from returning new subclass instances for std(), etc

2011-09-18 Thread Keith Hughitt
Interesting. It works as expected when called as a method: In [10]: x = np.ma.array([[1,2,3]]) In [11]: x.std() Out[11]: 0.81649658092772603 but not for my class: In [14]: aia.std() Out[14]: AIAMap(292.4342470467856) In [15]: np.std(aia) Out[15]: AIAMap(292.4342470467856) In [16]: np.array(ai

Re: [Numpy-discussion] Preventing an ndarray subclass from returning new subclass instances for std(), etc

2011-09-18 Thread Stéfan van der Walt
On Sun, Sep 18, 2011 at 9:09 AM, Keith Hughitt wrote: > I'm sure it is simply a coding error on my part, but so far I havne't been > able to track it down. I don't think it's something you've done wrong. See e.g.: In [9]: x = np.ma.array([[1,2,3]]) In [10]: np.std(x, axis=0) Out[10]: masked_ar

[Numpy-discussion] Preventing an ndarray subclass from returning new subclass instances for std(), etc

2011-09-18 Thread Keith Hughitt
Hi all, For a ndarray-subclass I'm working on I extended the array_wrap and array_finalize functions so that operations like __sub__() would return a new instance of the subclass, instead of an ndarray (although I still hav