[Numpy-discussion] Numpy 1.7b1 API change cause big trouble

David Cournapeau cournape@gmail....
Wed Sep 5 13:05:07 CDT 2012


Hi Frederic,

On Wed, Sep 5, 2012 at 6:36 PM, Frédéric Bastien <nouiz@nouiz.org> wrote:
> Hi,
>
> I spent up to now 2 or 3 days making change to Theano to support numpy
> 1.7b1. But now, I just find an interface change that will need
> recoding a function, not just small code change.
>
> The problem is that we can't access fields from PyArrayObject anymore,
> we absolutely must use the old macro/newly function.

Why can't you adress the PyArrayObject anymore ? It is deprecated, but
the structure itself has not changed. It would certainly be a
significant issue if that is not possible anymore, as it would be a
significant API break.

>
> For the data field, the new function don't allow to set it. There is
> no function that allow to do this. After so much time spent on small
> syntactic change, I don't feel making more complex change today.
>
> Also, I think there should be a function PyArray_SetDataPtr as similar
> to PyArray_SetBaseObject.
>
> Do you plan to add one? I though that you wanted to force the removing
> of the old API, but I never hear you wanted to disable this.

It was a design mistake to leak this in the first place, so the end
goal (not for 1.7), is certainly to 'forbid' access. It is necessary
to move numpy forward and keep ABI compatibility later on.

Adding functions to directly access the underlying structures would
defeat a lot of this. Regarding the need for new API:
    - speed issues: do you have any concrete measurements (or
usecases) where this is problematic ?
    - updating the refcount: can you give an example ?

thanks,

David


More information about the NumPy-Discussion mailing list