[Numpy-discussion] PyExc_IOError

2009-01-13 Thread Igor Sylvester
Has anyone had problems with dynamically loading PyExc_IOError when embedding a cython module? While calling init below: *in main.c: *void init { Py_Initialize(); initmymodule(); do_somethind(); Py_Finalize(); } *in module.c:* cdef public void do_something(): import exceptions pr

Re: [Numpy-discussion] record array with array elements

2009-01-06 Thread Igor Sylvester
If array fields should be of the form (name,subdtype, shape), how do I specify field offsets? My datatype is word-aligned. Thanks. On Tue, Jan 6, 2009 at 3:41 PM, Robert Kern wrote: > On Tue, Jan 6, 2009 at 14:07, Igor Sylvester wrote: > > Everyone, > > > > Shouldn'

Re: [Numpy-discussion] record array with array elements

2009-01-06 Thread Igor Sylvester
A simpler example returns 1 as well: np.dtype( [ (((2,), 'a'), 'i1') ] ).itemsize On Tue, Jan 6, 2009 at 2:07 PM, Igor Sylvester wrote: > Everyone, > > Shouldn't the itemsize below be 2? > > >>> import numpy as np > >

[Numpy-discussion] record array with array elements

2009-01-06 Thread Igor Sylvester
type array of size 2. Each element is a (nested) record array of size 2 with one field of type 'i1'. In contiguous memory, this should look identical to an 'i1' array of size 2. -Igor Sylvester ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Fwd: PyArray_DescrConverter segfault

2009-01-01 Thread Igor Sylvester
dules. Igor. On Thu, Jan 1, 2009 at 4:11 PM, Robert Kern wrote: > On Thu, Jan 1, 2009 at 14:21, Igor Sylvester wrote: > > I realize I need to call import_array() in the module initialization > > module. Why isn't this equivalent to importing numpy before importing my >

[Numpy-discussion] Fwd: PyArray_DescrConverter segfault

2009-01-01 Thread Igor Sylvester
I realize I need to call import_array() in the module initialization module. Why isn't this equivalent to importing numpy before importing my module? -- Forwarded message -- From: Igor Sylvester Date: Thu, Jan 1, 2009 at 1:09 PM Subject: PyArray_DescrConverter segfault To:

[Numpy-discussion] PyArray_DescrConverter segfault

2009-01-01 Thread Igor Sylvester
Hi, Does anyone have an insight on the following problem? PyObject* descr(PyObject* self, PyObject* args) { PyObject *d; PyArg_ParseTuple(args, "O&", PyArray_DescrConverter, &d); return d; } >>> import numpy >>> import mymodule >>> numpy.__version__ '1.2.1' >>> mymodule.descr([('a', 'i4'),

[Numpy-discussion] building issue in windows

2008-05-20 Thread Igor Sylvester
Hi. I have mingw and Visual Studio installed on my computer. I am following the building instructions posted in [1]. I explicitly tell setup.py to use mingw by passing the argument --compiler=mingw32. However, setuptools is using Visual Studio anyways. has anyone encountered this problem? I am