Jim Kleckner | 1 Nov 23:56 2008
Picon

Re: [Cython] Cython 0.9.8.2 beta

Robert Bradshaw wrote:
> There are lots of new things in cython-devel, and we're overdue for a  
> release. I have posed a beta up at http://cython.org/ 
> Cython-0.9.8.2.beta.tar.gz based on the current devel. Sage compiles  
> and passes all tests, please try it out on your own projects.

I gave it a try with Python 2.6 on Windows.

8 regression tests fail on Python 2.6 release using Visual Studio 9.0 on 
Windows XP.

This was run using the changeset 1291:16fc9454a2e5

The output is stored here:
  http://trac.cython.org/cython_trac/ticket/106

Jim Kleckner | 2 Nov 00:51 2008
Picon

Re: [Cython] Cython 0.9.8.2 beta

This simple case causes the parser to fail:

cdef int doublePointer(double* inOutArray):
     return 1

See: http://trac.cython.org/cython_trac/ticket/107

Robert Bradshaw | 2 Nov 01:44 2008

Re: [Cython] Cython 0.9.8.2 beta

Thanks for your reports.

On Nov 1, 2008, at 3:56 PM, Jim Kleckner wrote:
> I gave it a try with Python 2.6 on Windows.
>
> 8 regression tests fail on Python 2.6 release using Visual Studio  
> 9.0 on
> Windows XP.
>
> This was run using the changeset 1291:16fc9454a2e5
>
> The output is stored here:
>   http://trac.cython.org/cython_trac/ticket/106

I don't have access to a windows build platform, but it seems that  
these errors are for "fake" extern definitions to test that correct  
code is generated. I wonder why windows complains but other platforms  
don't... Not sure the best way to proceed here, any Windows experts  
out there? Do we have to make a .h file that actually defines all the  
filler stuff?

> On Nov 1, 2008, at 4:51 PM, Jim Kleckner wrote:
>
> This simple case causes the parser to fail:
>
> cdef int doublePointer(double* inOutArray):
>      return 1

This is bad, surprised we haven't run into it before. This should  
certainly be fixed before release.
(Continue reading)

Lisandro Dalcin | 4 Nov 04:52 2008
Picon

Re: [Cython] py.test + cython

Perhaps this is related to the way Cython implements tracebacks?.
Tracebacks contain references to the pyx files, and then py.test
surely get confused.

On Mon, Nov 3, 2008 at 10:27 PM, Simon Burton <simon@...> wrote:
>
> I have problems with py.test (all untraceable thanks to py.test's builtin magic)
> Looks like it is picking up pyx source files (is this from the module's __file__ ?) and choking.
> Does anyone here use py.test ?
>
> Simon.
> _______________________________________________
> Cython-dev mailing list
> Cython-dev@...
> http://codespeak.net/mailman/listinfo/cython-dev
>

--

-- 
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594
Stephane DROUARD | 3 Nov 21:59 2008

Re: [Cython] Intra-package reference not working with cimport

Robert Bradshaw wrote:

> cimport imports c definitions, which must be declared in .pxd files.  
> Do you have a .pxd file? If not, that's probably the issue.

OK let me detail what I'm doing ;-)

foo.pxd
cdef foo()

foo.pyx
cdef foo():
    pass

bar.pyx
cimport foo
foo.foo()

Once both compiled, importing bar is OK.

Now I move foo.pyd and bar.pyd into a package (pkg).
Then I import pkg.bar. It fails importing foo.

As previously mentionned, this is because "cimport foo" is mapped using
PyImport_Import(), that lets parameter globals to NULL.

The issue can be solved by replacing, in

static PyObject *__Pyx_ImportModule(char *name)

(Continue reading)

Robert Bradshaw | 3 Nov 22:36 2008

Re: [Cython] Intra-package reference not working with cimport

On Nov 3, 2008, at 12:59 PM, Stephane DROUARD wrote:

> Robert Bradshaw wrote:
>
>> cimport imports c definitions, which must be declared in .pxd files.
>> Do you have a .pxd file? If not, that's probably the issue.
>
> OK let me detail what I'm doing ;-)
>
> foo.pxd
> cdef foo()
>
> foo.pyx
> cdef foo():
>     pass
>
> bar.pyx
> cimport foo
> foo.foo()
>
> Once both compiled, importing bar is OK.
>
> Now I move foo.pyd and bar.pyd into a package (pkg).
> Then I import pkg.bar. It fails importing foo.

Ah hah, that's where the error is getting introduced. You can't just  
move compiled files around, as their absolute (rather than relative)  
location is needed and used at compile time.

> As previously mentionned, this is because "cimport foo" is mapped  
(Continue reading)

Robert Bradshaw | 4 Nov 06:18 2008

Re: [Cython] Cython 0.9.8.2 beta

On Nov 1, 2008, at 4:51 PM, Jim Kleckner wrote:

> This simple case causes the parser to fail:
>
> cdef int doublePointer(double* inOutArray):
>      return 1
>
>
> See: http://trac.cython.org/cython_trac/ticket/107

I've been unable to reproduce this with my copy, either with the beta  
release or the current cython-devel. Has anyone else seen this? Or  
perhaps there's more context that one needs to reproduce this error.

- Robert

Greg Ewing | 4 Nov 09:01 2008
Picon
Picon

Re: [Cython] Intra-package reference not working with cimport

Stephane DROUARD wrote:

> Here, the problem comes from the genererated code of bar which imports foo
> through PyImport_Import(), so letting globals to NULL, avoiding Python to
> first try importing foo from the package bar resides.

The cimport statement uses the Pyrex/Cython compiler's
idea of the module namespace at compile time. If you
move things around after that, it will get confused.

--

-- 
Greg
Jim Kleckner | 4 Nov 17:10 2008
Picon

Re: [Cython] Cython 0.9.8.2 beta

Robert Bradshaw wrote:
> Thanks for your reports.
...
>> On Nov 1, 2008, at 4:51 PM, Jim Kleckner wrote:
>>
>> This simple case causes the parser to fail:
>>
>> cdef int doublePointer(double* inOutArray):
>>      return 1
> 
> This is bad, surprised we haven't run into it before. This should  
> certainly be fixed before release.

In reducing the example, I guess I reduced it too far.
I coulda sworn I ran that specific file!

Try this, which is bad code but shouldn't cause an exception.
And has nothing to do with platforms.

cdef int foo((double*)inOutArray,):
    cdef int i
    i = <int> inOutArray
    return i

Separately, gmane seems to be broken and isn't getting the list feed.
I've reported the problem to gmane.discuss.  I hope this gets through...

Simon Burton | 4 Nov 02:27 2008

[Cython] py.test + cython


I have problems with py.test (all untraceable thanks to py.test's builtin magic)
Looks like it is picking up pyx source files (is this from the module's __file__ ?) and choking.
Does anyone here use py.test ?

Simon.

Gmane