Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-03 Thread Charles R Harris
On Thu, Feb 4, 2010 at 12:37 AM, Travis Oliphant wrote: > > On Feb 4, 2010, at 12:59 AM, Charles R Harris wrote: > > > > On Wed, Feb 3, 2010 at 11:48 PM, Travis Oliphant > wrote: > >> >> On Feb 2, 2010, at 11:59 PM, David Cournapeau wrote: >> >> Travis Oliphant wrote: >> >> >> On Feb 2, 2010, at

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-03 Thread Travis Oliphant
On Feb 4, 2010, at 12:59 AM, Charles R Harris wrote: On Wed, Feb 3, 2010 at 11:48 PM, Travis Oliphant > wrote: On Feb 2, 2010, at 11:59 PM, David Cournapeau wrote: Travis Oliphant wrote: On Feb 2, 2010, at 11:46 PM, David Cournapeau wrote: On Wed, Feb 3, 2010 at 12:23 PM, David Courna

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-03 Thread Charles R Harris
On Thu, Feb 4, 2010 at 12:11 AM, Travis Oliphant wrote: > > On Feb 3, 2010, at 11:58 AM, Robert Kern wrote: > > > On Tue, Feb 2, 2010 at 23:45, Travis Oliphant > > wrote: > > > >> I consider ABI a very significant think. We should be very accurate > >> about when a re-compile is required.I j

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-03 Thread Travis Oliphant
On Feb 3, 2010, at 11:58 AM, Robert Kern wrote: > On Tue, Feb 2, 2010 at 23:45, Travis Oliphant > wrote: > >> I consider ABI a very significant think. We should be very accurate >> about when a re-compile is required.I just don't believe that we >> should be promising ABI compatibility at

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-03 Thread Charles R Harris
On Wed, Feb 3, 2010 at 11:48 PM, Travis Oliphant wrote: > > On Feb 2, 2010, at 11:59 PM, David Cournapeau wrote: > > Travis Oliphant wrote: > > > On Feb 2, 2010, at 11:46 PM, David Cournapeau wrote: > > > On Wed, Feb 3, 2010 at 12:23 PM, David Cournapeau > > mailto:da...@silveregg.co.jp>> > wrote:

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-03 Thread Charles R Harris
On Wed, Feb 3, 2010 at 11:46 PM, Travis Oliphant wrote: > > > > > A more important scenario is as follows: let's assume we do allow > breaking the ABI every 1.X release, meaning that an ABI incompatible > change happens every ~ 6 months at the current pace (using the last 2-3 > years as history).

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-03 Thread Travis Oliphant
On Feb 2, 2010, at 11:59 PM, David Cournapeau wrote: Travis Oliphant wrote: On Feb 2, 2010, at 11:46 PM, David Cournapeau wrote: On Wed, Feb 3, 2010 at 12:23 PM, David Cournapeau mailto:da...@silveregg.co.jp>> wrote: Sorry, my question was badly worded: besides the metadata pointer, is

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-03 Thread Travis Oliphant
A more important scenario is as follows: let's assume we do allow breaking the ABI every 1.X release, meaning that an ABI incompatible change happens every ~ 6 months at the current pace (using the last 2-3 years as history). If the issue is having too many releases that are .X releases,

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-03 Thread David Cournapeau
On Thu, Feb 4, 2010 at 2:16 AM, Christopher Barker wrote: > David Cournapeau wrote: >> Just so that there is no confusion: it is only about removing it for >> 1.4.x, not about removing datetime altogether. It seems that datetime in >> 1.4.x has few users, > > Of course it has few users -- it's bra

Re: [Numpy-discussion] multiply a lign matrix with a column matrix should return a scalar( matlab yes, numpy no)!!!

2010-02-03 Thread laurent . feron
Thanks all for your replies... yes i start with numpy. i translate a dtw algorithm for voice recogniton from matlab to python Rgds, Laurent - Mail Original - De: "Alan G Isaac" À: "Discussion of Numerical Python" Envoyé: Mercredi 3 Février 2010 15h36:07 GMT +01:00 Amsterdam / Berlin / Ber

Re: [Numpy-discussion] Determine if numpy is installed from anextension

2010-02-03 Thread Peter Notebaert
Just to imform that my approach works: if (_import_array() < 0) { /* Clear the error state since we are handling the error. */ PyErr_Clear(); /* ... set up for the sans-numpy case. */ } else { /* ... set up for the with-numpy case. */ } It is based on Roberts idea to call PyImport_Im

[Numpy-discussion] [ANN] New package for manipulating labeled arrays

2010-02-03 Thread Keith Goodman
I am pleased to announce the first release of the la package, version 0.1. The main class of the la package is a labeled array, larry. A larry consists of a data array and a label list. The data array is stored as a NumPy array and the label list as a list of lists. larry has built-in methods suc

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-03 Thread Robert Kern
On Tue, Feb 2, 2010 at 23:45, Travis Oliphant wrote: > I consider ABI a very significant think.  We should be very accurate > about when a re-compile is required.    I just don't believe that we > should be promising ABI compatibility at .X releases.   I never had > that intention.  I don't remem

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-03 Thread josef . pktd
On Wed, Feb 3, 2010 at 12:16 PM, Christopher Barker wrote: > David Cournapeau wrote: >> Just so that there is no confusion: it is only about removing it for >> 1.4.x, not about removing datetime altogether. It seems that datetime in >> 1.4.x has few users, > > Of course it has few users -- it's br

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-03 Thread Christopher Barker
David Cournapeau wrote: > Just so that there is no confusion: it is only about removing it for > 1.4.x, not about removing datetime altogether. It seems that datetime in > 1.4.x has few users, Of course it has few users -- it's brand new! > whereas breaking ABI is a nuisance for many more > pe

Re: [Numpy-discussion] numpy.left_shift with negative x2

2010-02-03 Thread Charles R Harris
On Wed, Feb 3, 2010 at 5:43 AM, wrote: > > Hello, > > the following operation seems strange to me > > >>> np.left_shift(2,-1) > 0 > > I would have expected a right_shift by one. > > The result of a shift by a negative number is undefined in the C language; the gcc compiler will issue a warning if

Re: [Numpy-discussion] Determine if numpy is installed from an extension

2010-02-03 Thread Peter Notebaert
Ah, that is maybe the idea: if (_import_array() < 0) { /* Clear the error state since we are handling the error. */ PyErr_Clear(); /* ... set up for the sans-numpy case. */ } else { /* ... set up for the with-numpy case. */ } I did not call PyErr_Clear() when _import_array() < 0 and t

Re: [Numpy-discussion] Determine if numpy is installed from an extension

2010-02-03 Thread Robert Kern
On Wed, Feb 3, 2010 at 03:41, David Cournapeau wrote: > On Wed, Feb 3, 2010 at 5:38 PM, Peter Notebaert wrote: >> >From an extension? How to import numpy from there and then test if that >> succeeded and that without any annoying message if possible... > > One obvious solution would be to simply

Re: [Numpy-discussion] multiply a lign matrix with a column matrix should return a scalar( matlab yes, numpy no)!!!

2010-02-03 Thread Alan G Isaac
On 2/3/2010 3:08 AM, laurent.fe...@free.fr wrote: > if i multiply two matrix, one with a unique line and the second one > with a unique column, i should have a scalar What definition of matrix multiplication is that?? If you really want a scalar product, ask for it:: >>> import numpy a

Re: [Numpy-discussion] Antwort: Re: numpy.left_shift with negative x2

2010-02-03 Thread Ralf Gommers
On Wed, Feb 3, 2010 at 9:33 PM, wrote: > > >> On Wed, Feb 3, 2010 at 8:43 PM, wrote: > >> > >> Hello, > >> > >> the following operation seems strange to me > >> > >> >>> np.left_shift(2,-1) > >> 0 > >> > >> I would have expected a right_shift by one. > > > > I wouldn't expect anything, the behav

[Numpy-discussion] Antwort: Re: numpy.left_shift with negative x2

2010-02-03 Thread markus . proeller
>> On Wed, Feb 3, 2010 at 8:43 PM, wrote: >> >> Hello, >> >> the following operation seems strange to me >> >> >>> np.left_shift(2,-1) >> 0 >> >> I would have expected a right_shift by one. > > I wouldn't expect anything, the behavior is simply not defined. But it would prevent a state

Re: [Numpy-discussion] numpy.left_shift with negative x2

2010-02-03 Thread Ralf Gommers
On Wed, Feb 3, 2010 at 8:43 PM, wrote: > > Hello, > > the following operation seems strange to me > > >>> np.left_shift(2,-1) > 0 > > I would have expected a right_shift by one. > I wouldn't expect anything, the behavior is simply not defined. Python returns an error: In [17]: 2 << -1 --

[Numpy-discussion] numpy.left_shift with negative x2

2010-02-03 Thread markus . proeller
Hello, the following operation seems strange to me >>> np.left_shift(2,-1) 0 I would have expected a right_shift by one. The documentation on http://docs.scipy.org/doc/numpy/reference/generated/numpy.left_shift.html#numpy.left_shift also says that the operation is equivalent to multiplying x1 b

Re: [Numpy-discussion] Determine if numpy is installed from an extension

2010-02-03 Thread David Cournapeau
On Wed, Feb 3, 2010 at 5:38 PM, Peter Notebaert wrote: > >From an extension? How to import numpy from there and then test if that > succeeded and that without any annoying message if possible... One obvious solution would be to simply call PyImport_Import, something like: #include PyMODINIT_FU

Re: [Numpy-discussion] Determine if numpy is installed from an extension

2010-02-03 Thread Peter Notebaert
>From an extension? How to import numpy from there and then test if that succeeded and that without any annoying message if possible... Thanks, Peter On Wed, Feb 3, 2010 at 1:34 AM, David Cournapeau wrote: > Peter Notebaert wrote: > > > How can I test if numpy is installed on the system from th

Re: [Numpy-discussion] Removing datetime support for 1.4.x series ?

2010-02-03 Thread Francesc Alted
A Wednesday 03 February 2010 08:42:57 David Cournapeau escrigué: > > Yes, it means distributors of packages that depend on NumPy will have > > to recompile against the new version, and I can see why some might > > want to avoid that. Pushing what is really a distribution problem > > back to the Nu

Re: [Numpy-discussion] multiply a lign matrix with a column matrix should return a scalar( matlab yes, numpy no)!!!

2010-02-03 Thread Nikolas Tezak
Hi Laurent, I'm not sure why this was implemented this way (probably due to numerical precision, because the numpy datatypes offer a greater variety than python), but in any case you can easily convert the result to a float: >>> float(line*col) 10 (You probably knew this, but well... :) ) R

Re: [Numpy-discussion] multiply a lign matrix with a column matrix should return a scalar( matlab yes, numpy no)!!!

2010-02-03 Thread David Cournapeau
laurent.fe...@free.fr wrote: > Hello, > > if i multiply two matrix, one with a unique line and the second one with a > unique column, i should have a scalar: > line > matrix([[1, 3, 1]]) col > matrix([[2], > [2], > [2]]) line*col > matrix([[10]]) > > Matlab give m

[Numpy-discussion] multiply a lign matrix with a column matrix should return a scalar( matlab yes, numpy no)!!!

2010-02-03 Thread laurent . feron
Hello, if i multiply two matrix, one with a unique line and the second one with a unique column, i should have a scalar: >>> line matrix([[1, 3, 1]]) >>> col matrix([[2], [2], [2]]) >>> line*col matrix([[10]]) Matlab give me a scalar, Numpy does not... Do you know why? Regards