[Numpy-discussion] Possible bug: uint64 + int gives float64

2010-06-13 Thread Pearu Peterson
Hi, I just noticed some weird behavior in operations with uint64 and int, heres an example: numpy.uint64(3)+1 4.0 type(numpy.uint64(3)+1) type 'numpy.float64' Pearu ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org

Re: [Numpy-discussion] NumPy re-factoring project

2010-06-13 Thread Pauli Virtanen
Sun, 13 Jun 2010 06:54:29 +0200, Sturla Molden wrote: [clip: memory management only in the interface] You forgot views: if memory management is done in the interface layer, it must also make sure that the memory pointed to by a view is never moved around, and not freed before all the views are

[Numpy-discussion] Numpy, swig and docstring

2010-06-13 Thread Fabrice Silva
Hi folks, I am trying to wrap a library with swig, distutils and numpy, and am facing troubles. In fact, swig documentation mention that it is possible to mention a module docsstring in the %module directive : %module(docstring=This is the example module's docstring) example where example is

Re: [Numpy-discussion] PyArray_Scalar() and Unicode

2010-06-13 Thread Pauli Virtanen
Sat, 12 Jun 2010 17:33:13 -0700, Dan Roberts wrote: [clip: refactoring PyArray_Scalar] There are a few problems with this. The biggest problem for me is that it appears PyUCS2Buffer_FromUCS4() doesn't produce UCS2 at all, but rather UTF-16 since it produces surrogate pairs for code points

Re: [Numpy-discussion] Possible bug: uint64 + int gives float64

2010-06-13 Thread Nadav Horesh
int can be larger than numpy.int64 therefore it should be coerced to float64 (or float96/float128) Nadav -Original Message- From: numpy-discussion-boun...@scipy.org on behalf of Pearu Peterson Sent: Sun 13-Jun-10 12:08 To: Discussion of Numerical Python Subject: [Numpy-discussion]

Re: [Numpy-discussion] Possible bug: uint64 + int gives float64

2010-06-13 Thread Pearu Peterson
On Sun, Jun 13, 2010 at 4:45 PM, Nadav Horesh nad...@visionsense.com wrote: int can be larger than numpy.int64 therefore it should be coerced to float64 (or float96/float128) Ok, I see. The results type is defined by the types of operands, not by their values. I guess this has been discussed

Re: [Numpy-discussion] Possible bug: uint64 + int gives float64

2010-06-13 Thread Charles R Harris
On Sun, Jun 13, 2010 at 9:20 AM, Pearu Peterson pearu.peter...@gmail.comwrote: On Sun, Jun 13, 2010 at 4:45 PM, Nadav Horesh nad...@visionsense.com wrote: int can be larger than numpy.int64 therefore it should be coerced to float64 (or float96/float128) Ok, I see. The results type is

Re: [Numpy-discussion] Possible bug: uint64 + int gives float64

2010-06-13 Thread Sturla Molden
Den 13.06.2010 18:19, skrev Charles R Harris: It's the combination of unsigned with signed that causes the promotion. The int64 type can't hold the largest values in uint64. Strictly speaking, doubles can't hold either of the 64 bit integer types without loss of precision but at least the

Re: [Numpy-discussion] Tensor contraction

2010-06-13 Thread Friedrich Romstedt
2010/6/13 Pauli Virtanen p...@iki.fi: def tensor_contraction_single(tensor, dimensions):    Perform a single tensor contraction over the dimensions given    swap = [x for x in range(tensor.ndim)            if x not in dimensions] + list(dimensions)    x = tensor.transpose(swap)    for k in

Re: [Numpy-discussion] Tensor contraction

2010-06-13 Thread Alan Bromborsky
Friedrich Romstedt wrote: 2010/6/13 Pauli Virtanen p...@iki.fi: def tensor_contraction_single(tensor, dimensions): Perform a single tensor contraction over the dimensions given swap = [x for x in range(tensor.ndim) if x not in dimensions] + list(dimensions) x =

Re: [Numpy-discussion] Tensor contraction

2010-06-13 Thread Friedrich Romstedt
2010/6/13 Alan Bromborsky abro...@verizon.net: I am writing symbolic tensor package for general relativity.  In making symbolic tensors concrete I generate numpy arrays stuffed with sympy functions and symbols. That sound's interesting. The operations are tensor product

Re: [Numpy-discussion] Tensor contraction

2010-06-13 Thread David Goldsmith
Is this not what core.numeric.tensordothttp://docs.scipy.org/numpy/docs/numpy.core.numeric.tensordot/does? DG On Sun, Jun 13, 2010 at 12:37 PM, Friedrich Romstedt friedrichromst...@gmail.com wrote: 2010/6/13 Alan Bromborsky abro...@verizon.net: I am writing symbolic tensor package for

Re: [Numpy-discussion] Installing numpy on py 3.1.2 , osx

2010-06-13 Thread Vincent Davis
As an update. I was able to get py 3.2.1 current source to build/install. After that I was able to build and install the current numpy. Everything seems ok. I did try to run the tests but get an error. It looks like nose has a problem. np.test() Running unit tests for numpy Traceback (most

Re: [Numpy-discussion] Tensor contraction

2010-06-13 Thread Alan Bromborsky
Friedrich Romstedt wrote: 2010/6/13 Alan Bromborsky abro...@verizon.net: I am writing symbolic tensor package for general relativity. In making symbolic tensors concrete I generate numpy arrays stuffed with sympy functions and symbols. That sound's interesting. The

Re: [Numpy-discussion] Installing numpy on py 3.1.2 , osx

2010-06-13 Thread David Cournapeau
On Mon, Jun 14, 2010 at 5:17 AM, Vincent Davis vinc...@vincentdavis.netwrote: As an update. I was able to get py 3.2.1 current source to build/install. After that I was able to build and install the current numpy. Everything seems ok. I did try to run the tests but get an error. It looks like

Re: [Numpy-discussion] Installing numpy on py 3.1.2 , osx

2010-06-13 Thread Vincent Davis
On Sun, Jun 13, 2010 at 5:06 PM, David Cournapeau courn...@gmail.com wrote: On Mon, Jun 14, 2010 at 5:17 AM, Vincent Davis vinc...@vincentdavis.net wrote: As an update. I was able to get py 3.2.1 current source to build/install. After that I was able to build and install the current numpy.

[Numpy-discussion] Serializing numpy record array

2010-06-13 Thread Vishal Rana
I created a record array (from strings and floats) with no dtype defined as: ra = np.core.records.fromrecords(sq_list, names=(a, b, c)) ra.a is found to be of type numpy.float64, when I serialize it using pyamf under Mac OS X it works great but under ubuntu 10.04 it fails. Looks like

Re: [Numpy-discussion] Installing numpy on py 3.1.2 , osx

2010-06-13 Thread David
On 06/14/2010 08:10 AM, Vincent Davis wrote: I kinda get that, I posted on the nose list ask what source/version to install. I installed the most recent. They have a special branch for py3k support, I think you have to use that, cheers, David ___

Re: [Numpy-discussion] Serializing numpy record array

2010-06-13 Thread Robert Kern
On Sun, Jun 13, 2010 at 19:52, Vishal Rana ranavis...@gmail.com wrote: I created a record array (from strings and floats) with no dtype defined as: ra = np.core.records.fromrecords(sq_list, names=(a, b, c)) ra.a is found to be of type numpy.float64, when I serialize it using pyamf under Mac OS

Re: [Numpy-discussion] Serializing numpy record array

2010-06-13 Thread Vishal Rana
Robert, There is no error on python side but on flex client which is *Channel*.* Call*.*Failed* faultDetail=NetConnection.Call.Failed: *HTTP*: Status 503 Here is the documentation for type mapping flex vs python: http://pyamf.org/architecture/typemap.html, pyamf takes python data types so I am

Re: [Numpy-discussion] Serializing numpy record array

2010-06-13 Thread Robert Kern
On Sun, Jun 13, 2010 at 20:10, Vishal Rana ranavis...@gmail.com wrote: Robert, There is no error on python side but on flex client which is Channel.Call.Failed faultDetail=NetConnection.Call.Failed: HTTP: Status 503 Here is the documentation for type mapping flex vs python: 

Re: [Numpy-discussion] numpy for jython

2010-06-13 Thread David
On 06/14/2010 10:23 AM, Jarl Haggerty wrote: Does anyone have any interest in a port of numpy to jython? I am insterested, and I think interest is growing thanks to the cloud computing fad, since a lot of this instrastructure is based on java (hadoop, hbase, cassandra to name a few). Being

Re: [Numpy-discussion] numpy for jython

2010-06-13 Thread Robert Kern
On Sun, Jun 13, 2010 at 20:58, David da...@silveregg.co.jp wrote: On 06/14/2010 10:23 AM, Jarl Haggerty wrote: Does anyone have any interest in a port of numpy to jython? I am insterested, and I think interest is growing thanks to the cloud computing fad, since a lot of this instrastructure

Re: [Numpy-discussion] Serializing numpy record array

2010-06-13 Thread Vishal Rana
Thanks Robert, it worked. On Sun, Jun 13, 2010 at 6:23 PM, Robert Kern robert.k...@gmail.com wrote: On Sun, Jun 13, 2010 at 20:10, Vishal Rana ranavis...@gmail.com wrote: Robert, There is no error on python side but on flex client which is Channel.Call.Failed