Re: [Numpy-discussion] Assign NaN, get zero

2006-11-11 Thread Lisandro Dalcin
On 11/11/06, Stefan van der Walt <[EMAIL PROTECTED]> wrote: > NaN (or inf) is a floating point number, so seeing a zero in integer > representation seems correct: > > In [2]: int(N.nan) > Out[2]: 0L > Just to learn myself: Why int(N.nan) should be 0? Is it C behavior? -- Lisandro Dalcín

Re: [Numpy-discussion] [PyOpenGL-Devel] Need more comments from scientific community on python-dev

2006-11-04 Thread Lisandro Dalcin
On 11/4/06, Mike C. Fletcher <[EMAIL PROTECTED]> wrote: > We wouldn't be able to get rid > of the abstraction mechanism entirely, as we would still have data-types > such as lists-of-lists-of-integers that wouldn't support the protocol. > Perhaps this will sound stupid, but I was thinking about e

Re: [Numpy-discussion] Need more comments from scientific community on python-dev

2006-11-01 Thread Lisandro Dalcin
On 10/31/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: > > I'm recruiting more comments on python-dev regarding my two proposals > for improving Python's native ability to share ndarray-like information. > I believe there are another really important reason to support Travis's proposal. Python s

Re: [Numpy-discussion] Need more comments from scientific community on python-dev

2006-11-01 Thread Lisandro Dalcin
On 10/31/06, Bill Baxter <[EMAIL PROTECTED]> wrote: > One thing I see with PIL and Matplotlib and PyOpenGL is that they're having > to add specific support for Numpy and numeric and numarray and PIL and > ctypes etc. This is a real problem, and a waste of developing time, because we lack a **gener

Re: [Numpy-discussion] Strange and hard to reproduce crash

2006-10-30 Thread Lisandro Dalcin
On 10/30/06, Lisandro Dalcin <[EMAIL PROTECTED]> wrote: > FYI, this is what is defined in Include/object.h > I forgoy to say in Python-2.5 -- Lisandro Dalcín --- Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC) Instituto de Desarrollo Tecnoló

Re: [Numpy-discussion] Strange and hard to reproduce crash

2006-10-30 Thread Lisandro Dalcin
On 10/30/06, Fernando Perez <[EMAIL PROTECTED]> wrote: > On 10/30/06, Charles R Harris <[EMAIL PROTECTED]> wrote: > > > I suspect the real problem is that the refcount keeps going up. Even if it > > was unsigned it would eventually wrap to zero and with a bit of luck get > > garbage collected. So

Re: [Numpy-discussion] Abaqus Python

2006-10-30 Thread Lisandro Dalcin
On 10/30/06, Jonathan Makem <[EMAIL PROTECTED]> wrote: > > Hi, > > I work with Abaqus 6.6.1 finite element software. To access the results > from a simulation, the Abaqus scripting interface is used in Python by > importing OdbAccess modules. These modules can only be accessed using the > versi

Re: [Numpy-discussion] Conversion about getting array interface into Python

2006-10-30 Thread Lisandro Dalcin
On 10/30/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: > > If anybody has a desire to see the array interface into Python, please > help by voicing an opinion on python-dev in the discussion about adding > data-type objects to Python. There are a few prominent people who > don't get why applicat

[Numpy-discussion] LAPACK warning on FC2

2006-10-25 Thread Lisandro Dalcin
FYI, I got the following warning building numpy-1.0 from sources on a FC2 box, using distribution provided blas and lapack rpm's. $ rpm -q blas blas-3.0-24.1 $ rpm -q lapack lapack-3.0-24.1 $ python setup.py build > build.log Running from numpy source directory. /u/dalcinl/Build/Python/numpy-1.0

Re: [Numpy-discussion] Numpy-scalars vs Numpy 0-d arrays: copy or not copy?

2006-10-21 Thread Lisandro Dalcin
On 10/20/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: > > How about this. To get the i,j,k,l element > > a[i:i+1,j:j+1,k:k+1,l:l+1].squeeze() > > -Travis I think all this can be condensed in a method call or similar mehcanism, natively provided by ndarray type. Or should this be seen as a speci

Re: [Numpy-discussion] adding an attribute to an nd-array

2006-10-19 Thread Lisandro Dalcin
On 10/19/06, Robert Kern <[EMAIL PROTECTED]> wrote: > Travis Oliphant wrote: > > I don't think the extra bytes for every ndarray object are worth it, > > given how easy it is to sub-class and create your own ndarray that can > > have attributes attached.What are others opinions. > > I'd say lea

Re: [Numpy-discussion] The NumPy Fortran-ordering quiz

2006-10-17 Thread Lisandro Dalcin
I was surprised by this In [14]: array([[1,2,3],[4,5,6]]).reshape((3,2),order='F') Out[14]: array([[1, 5], [4, 3], [2, 6]]) In [15]: array([1,2,3,4,5,6]).reshape((3,2),order='F') Out[15]: array([[1, 2], [3, 4], [5, 6]]) On 10/17/06, Stefan van der Walt <[EMAIL PROTEC

Re: [Numpy-discussion] Accessing data buffers in numpy scalars

2006-10-17 Thread Lisandro Dalcin
On 10/17/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: > Or you can use the Python C-API > > const char *buffer; > Py_ssize_t buflen; > > PyObject_AsReadBuffer(scalar, (const void **)&buffer, &buflen) > > to retrieve a pointer to the data in buffer and the size of the data in > buflen. > Travis.

Re: [Numpy-discussion] What does Fortran order mean?

2006-10-17 Thread Lisandro Dalcin
On 10/17/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: > The require command can help you get the right kind of > array for that purpose. > BTW, Travis In [1]: numpy.__version__ Out[1]: '1.0rc2' In [2]: print numpy.require.__doc__ None What is this 'requirements' argument? What should user pas

Re: [Numpy-discussion] What does Fortran order mean?

2006-10-16 Thread Lisandro Dalcin
On 10/16/06, Charles R Harris <[EMAIL PROTECTED]> wrote: > Travis, > I note that > >>> a = arange(6).reshape(2,3,order='F') > >>> a > array([[0, 1, 2], >[3, 4, 5]]) > > Shouldn't that be 3x2? Or maybe [[0,2,4],[1,3,5]]? Reshape is making a copy, Are you sure? octave:1> a = 0:5 a = 0 1

[Numpy-discussion] MPI for Python RC1

2006-10-15 Thread Lisandro Dalcin
For all of you interested in mpi4py, I've uploaded a tarball to PyPI http://www.python.org/pypi/mpi4py/0.4.0rc1 Make sure you have mpicc in your path and then - If you have setuptools, an try $ easy_intall mpi4py - Download the tarball and next $ python setup.py install [--home=$HOME] You sh

Re: [Numpy-discussion] [SciPy-dev] NumPy/SciPy + MPI for Python

2006-10-14 Thread Lisandro Dalcin
On 10/14/06, Bill Spotz <[EMAIL PROTECTED]> wrote: > I would like to second the notion of converging on a single MPI > interface. My parallel project encapsulates most of the inter- > processor communication within higher-level objects because the lower- > level communication patterns can usually

Re: [Numpy-discussion] [SciPy-dev] NumPy/SciPy + MPI for Python

2006-10-14 Thread Lisandro Dalcin
On 10/13/06, eric <[EMAIL PROTECTED]> wrote: > Brian Granger wrote: > > keeping mpi4py as a separate project. > > Is there any chance it could be > > hosted at mip4py.scipy.org? > > > Fine from our side... > > eric > Can anybody help setting up mip4py.scipy.org? I really do not have experience wit

Re: [Numpy-discussion] Testing numpy without doing an installation?

2006-10-13 Thread Lisandro Dalcin
On 10/13/06, Francesc Altet <[EMAIL PROTECTED]> wrote: > Is it possible to test a numpy version directly from the source > directory without having to install it? I usually do: $ python setup.py build $ python setup.py install --home=/tmp $ export PYTHONPATH=/tmp/lib/python and then $ python -c

[Numpy-discussion] NumPy/SciPy + MPI for Python

2006-10-13 Thread Lisandro Dalcin
This post is surely OT, but I cannot imagine a better place to contact people about this subject. Please, don't blame me. Any people here interested in NumPy/SciPy + MPI? From some time ago, I've been developing mpi4py (first release at SF) and I am really near to release a new version. This pack

Re: [Numpy-discussion] Providing array interface from SWIG-wrapped C struct

2006-10-12 Thread Lisandro Dalcin
On 10/12/06, Michele Vallisneri <[EMAIL PROTECTED]> wrote: > Does anybody here have experience about offering the array interface > from a SWIG-wrapped C struct? I have. > I have tried the following, borrowing code from numpy's arrayobject.c: > > %extend real_vec_t { >PyObject *__array_struct

Re: [Numpy-discussion] order keyword

2006-09-05 Thread Lisandro Dalcin
BTW, in numpy-1.0b1 numpy.zeros((3,3), order='QQQ') pass without generating any error... Is this intended behaviour? -- Lisandro Dalcín --- Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC) Instituto de Desarrollo Tecnológico para la Industria Química (INTEC) Co