Francesc Alted | 1 Nov 2011 11:11

Re: [Cython] Cython 0.16

2011/10/31 mark florisson <markflorisson88@...>:
> We can now pass a chunksize argument into prange:
> https://github.com/cython/cython/commit/5c3e77d3c70686fedd5619d7267728fc819b4c60

Cool.  And very well documented too. Thank you!

--

-- 
Francesc Alted
mark florisson | 3 Nov 2011 21:38
Picon
Gravatar

Re: [Cython] Cython 0.16

On 29 October 2011 17:40, Vitja Makarov <vitja.makarov <at> gmail.com> wrote:
> 2011/10/29 Stefan Behnel <stefan_ml <at> behnel.de>:
>> mark florisson, 28.10.2011 22:59:
>>>
>>> On 28 October 2011 21:55, Robert Bradshaw wrote:
>>>>
>>>> With Mark's fused types and memory views going in, I think it's about
>>>> time for a new release.
>>
>> Agreed.
>>
>>
>>>> Thoughts?
>>
>> I still haven't investigated the decorator issue that appeared in the Sage
>> tests. I think it's related to decorators on module level def functions,
>> which would suggest that it's best to eventually fix it as part of the
>> function implementation changes that Vitja has started. But there may still
>> be a simpler work-around somewhere that I'm not seeing yet.
>>
>
> Recently I've implemented py3k-super and dynamic default args if we
> have time. I would see this in release also.
>
> Can you please point me to sage decorators related failure?
>
>
>> I basically broke the Sage tests by resolving a bug (593 IIRC), and both
>> don't currently work together. So, a variant would be to revert my changes
>> for 0.16 and just leave the bug in, if that keeps us from breaking existing
(Continue reading)

Vitja Makarov | 3 Nov 2011 21:42
Picon
Gravatar

Re: [Cython] Cython 0.16

2011/11/4 mark florisson <markflorisson88@...>:
> On 29 October 2011 17:40, Vitja Makarov <vitja.makarov@...> wrote:
>> 2011/10/29 Stefan Behnel <stefan_ml@...>:
>>> mark florisson, 28.10.2011 22:59:
>>>>
>>>> On 28 October 2011 21:55, Robert Bradshaw wrote:
>>>>>
>>>>> With Mark's fused types and memory views going in, I think it's about
>>>>> time for a new release.
>>>
>>> Agreed.
>>>
>>>
>>>>> Thoughts?
>>>
>>> I still haven't investigated the decorator issue that appeared in the Sage
>>> tests. I think it's related to decorators on module level def functions,
>>> which would suggest that it's best to eventually fix it as part of the
>>> function implementation changes that Vitja has started. But there may still
>>> be a simpler work-around somewhere that I'm not seeing yet.
>>>
>>
>> Recently I've implemented py3k-super and dynamic default args if we
>> have time. I would see this in release also.
>>
>> Can you please point me to sage decorators related failure?
>>
>>
>>> I basically broke the Sage tests by resolving a bug (593 IIRC), and both
>>> don't currently work together. So, a variant would be to revert my changes
(Continue reading)

Stefan Behnel | 3 Nov 2011 22:26
Picon
Favicon

Re: [Cython] Cython 0.16

Vitja Makarov, 03.11.2011 21:42:
> 2011/11/4 mark florisson:
>> With Vitja's super() ready and with fused classmethods and
>> staticmethods ready, I think we're almost ready for a release. I also
>> supported cdef class static methods (previously it gave compiler
>> crashes).
>
> That's nice. I've also implemented support for dynamic default args
>
> http://trac.cython.org/cython_trac/ticket/674
>
> I think it could be merged either.
>
>> I think we should also merge pull requests 'casting to template
>> pointer' (after a test is added), and probably 'Makefile: rework repo
>> creation target' (although I haven't looked at it closely). I think
>> cythonize() is also worth documenting better, as it's a pretty neat
>> feature that should be more prominent and easier to find for users
>> (including examples of some of the #distutils directives).

That's a great list of improvements!

The one problem with cythonize() is that it doesn't (yet) have a good way 
of defining additional build options, e.g. required libraries etc. for an 
extension. Those should be keyword arguments of some sort, maybe just 
passed through into the Extension class constructor.

Stefan
mark florisson | 4 Nov 2011 09:33
Picon
Gravatar

Re: [Cython] Cython 0.16

On 3 November 2011 20:42, Vitja Makarov <vitja.makarov <at> gmail.com> wrote:
> 2011/11/4 mark florisson <markflorisson88 <at> gmail.com>:
>> On 29 October 2011 17:40, Vitja Makarov <vitja.makarov <at> gmail.com> wrote:
>>> 2011/10/29 Stefan Behnel <stefan_ml <at> behnel.de>:
>>>> mark florisson, 28.10.2011 22:59:
>>>>>
>>>>> On 28 October 2011 21:55, Robert Bradshaw wrote:
>>>>>>
>>>>>> With Mark's fused types and memory views going in, I think it's about
>>>>>> time for a new release.
>>>>
>>>> Agreed.
>>>>
>>>>
>>>>>> Thoughts?
>>>>
>>>> I still haven't investigated the decorator issue that appeared in the Sage
>>>> tests. I think it's related to decorators on module level def functions,
>>>> which would suggest that it's best to eventually fix it as part of the
>>>> function implementation changes that Vitja has started. But there may still
>>>> be a simpler work-around somewhere that I'm not seeing yet.
>>>>
>>>
>>> Recently I've implemented py3k-super and dynamic default args if we
>>> have time. I would see this in release also.
>>>
>>> Can you please point me to sage decorators related failure?
>>>
>>>
>>>> I basically broke the Sage tests by resolving a bug (593 IIRC), and both
(Continue reading)

mark florisson | 4 Nov 2011 09:33
Picon
Gravatar

Re: [Cython] Cython 0.16

On 3 November 2011 21:26, Stefan Behnel <stefan_ml@...> wrote:
> Vitja Makarov, 03.11.2011 21:42:
>>
>> 2011/11/4 mark florisson:
>>>
>>> With Vitja's super() ready and with fused classmethods and
>>> staticmethods ready, I think we're almost ready for a release. I also
>>> supported cdef class static methods (previously it gave compiler
>>> crashes).
>>
>> That's nice. I've also implemented support for dynamic default args
>>
>> http://trac.cython.org/cython_trac/ticket/674
>>
>> I think it could be merged either.
>>
>>> I think we should also merge pull requests 'casting to template
>>> pointer' (after a test is added), and probably 'Makefile: rework repo
>>> creation target' (although I haven't looked at it closely). I think
>>> cythonize() is also worth documenting better, as it's a pretty neat
>>> feature that should be more prominent and easier to find for users
>>> (including examples of some of the #distutils directives).
>
> That's a great list of improvements!
>
> The one problem with cythonize() is that it doesn't (yet) have a good way of
> defining additional build options, e.g. required libraries etc. for an
> extension. Those should be keyword arguments of some sort, maybe just passed
> through into the Extension class constructor.

(Continue reading)

Vitja Makarov | 4 Nov 2011 09:58
Picon
Gravatar

Re: [Cython] Cython 0.16

2011/11/4 mark florisson <markflorisson88@...>:
>>
>> That's nice. I've also implemented support for dynamic default args
>>
>> http://trac.cython.org/cython_trac/ticket/674
>>
>> I think it could be merged either.
>
> That's great, because it's a nasty bug. I see no pull request for that
> though, although I see it in one of your branches. Is it ready?
>

Yeah, you can find it here:

https://github.com/vitek/cython/commit/175c8994ead619ce8425de8fed96ffa9adb18a88

Btw, it needs to be cleaned. Now it packs default args in C struct this way:

struct defaults {
    PyObject *objects[N];
    int int_arg; // C type args here
    ...
}

So perhaps it would be better to pack that into PyObject so it would
be easier to copy default args when creating fused functions.

--

-- 
vitja.
(Continue reading)

mark florisson | 4 Nov 2011 12:17
Picon
Gravatar

Re: [Cython] Cython 0.16

On 4 November 2011 08:58, Vitja Makarov <vitja.makarov <at> gmail.com> wrote:
> 2011/11/4 mark florisson <markflorisson88 <at> gmail.com>:
>>>
>>> That's nice. I've also implemented support for dynamic default args
>>>
>>> http://trac.cython.org/cython_trac/ticket/674
>>>
>>> I think it could be merged either.
>>
>> That's great, because it's a nasty bug. I see no pull request for that
>> though, although I see it in one of your branches. Is it ready?
>>
>
> Yeah, you can find it here:
>
> https://github.com/vitek/cython/commit/175c8994ead619ce8425de8fed96ffa9adb18a88
>
> Btw, it needs to be cleaned. Now it packs default args in C struct this way:
>
> struct defaults {
>    PyObject *objects[N];
>    int int_arg; // C type args here
>    ...
> }
>
> So perhaps it would be better to pack that into PyObject so it would
> be easier to copy default args when creating fused functions.

I don't think we need dynamic default arguments for fused functions
(yet), as fused closures are not supported. But if we want those in
(Continue reading)

Vitja Makarov | 6 Nov 2011 18:10
Picon
Gravatar

[Cython] File encoding issue

When file encoding is specified cython generates two PyObject entries
for string consts one for the variable name and one for the string
constant.

Here is ticket: http://trac.cython.org/cython_trac/ticket/740

At the first time I thought that this is C++ related bug. Now I
realise that C doesn't complains about.

Here is minimal example:
$ cat cplus.pyx
# -*- coding: koi8-r -*-
wtf = 'wtf'

Generaets the following code:

/* Implementation of 'cplus' */
static char __pyx_k__wtf[] = "wtf";
static char __pyx_k____main__[] = "__main__";
static char __pyx_k____test__[] = "__test__";
static PyObject *__pyx_n_s____main__;
static PyObject *__pyx_n_s____test__;
static PyObject *__pyx_n_s__wtf;
static PyObject *__pyx_n_s__wtf;

...

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__),
0, 0, 1, 1},
(Continue reading)

Stefan Behnel | 6 Nov 2011 18:33
Picon
Favicon

Re: [Cython] File encoding issue

Vitja Makarov, 06.11.2011 18:10:
> When file encoding is specified cython generates two PyObject entries
> for string consts one for the variable name and one for the string
> constant.

That's because the content may actually become different after decoding, 
even if the encoded byte sequence is identical. Note that decoding is only 
done in Py3. In Py2, the byte sequence is used, so both values are identical.

> Here is ticket: http://trac.cython.org/cython_trac/ticket/740
>
> At the first time I thought that this is C++ related bug. Now I
> realise that C doesn't complains about.

I bet there's the usual "yes, please really tell me what I'm doing wrong" 
compiler option for that. "-Werrors" may do the trick at least.

> Here is minimal example:
> $ cat cplus.pyx
> # -*- coding: koi8-r -*-
> wtf = 'wtf'
>
> Generaets the following code:
>
> /* Implementation of 'cplus' */
> static char __pyx_k__wtf[] = "wtf";
> static char __pyx_k____main__[] = "__main__";
> static char __pyx_k____test__[] = "__test__";
> static PyObject *__pyx_n_s____main__;
> static PyObject *__pyx_n_s____test__;
(Continue reading)


Gmane