getting pypy to play nice with matplotlib

The pypy C-API progress, where we can basically run all of numpy (on a
HEAD version numpy + nightly version of pypy).

That means I will start to look at passing the matplotlib test suite.

My first try segfaults, due to the tkagg backend blit function which
calls into tk via id(data) and id(bbox_array).

That of course will not work on PyPy since the address of a random
python object does not reflect anything usable in C.

So my question, as someone who is new to your codebase, is how to
rewrite this using cffi or the standard C-API without impacting performance?

Matti

Which branch are you working off of? Matthew Brett recently did a whole
bunch of work over-hauling how that linking happens.

We currently have a blanket ban on cffi so that mpl will run in locked-down
environments, but I would be open to being convinced using it in a
localized way inside of the tk code.

How are you running the test suite? It is odd that you are hitting tk at
all.

Tom

···

On Fri, Sep 2, 2016 at 9:24 AM Matti Picus <matti.picus at gmail.com> wrote:

The pypy C-API progress, where we can basically run all of numpy (on a
HEAD version numpy + nightly version of pypy).

That means I will start to look at passing the matplotlib test suite.

My first try segfaults, due to the tkagg backend blit function which
calls into tk via id(data) and id(bbox_array).

That of course will not work on PyPy since the address of a random
python object does not reflect anything usable in C.

So my question, as someone who is new to your codebase, is how to
rewrite this using cffi or the standard C-API without impacting
performance?

Matti

_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel at python.org
https://mail.python.org/mailman/listinfo/matplotlib-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-devel/attachments/20160902/ba04fb21/attachment.html>

I am working off of 1.5.1, should I be using HEAD? Would any of the data
access API's like np.array.__array_interface__ be acceptable?
I did these two calls

<pypy> setup.py build

<pypy> setup.py nosetests --verbosity=10

and got a crash in matplotlib.tests.test_artist.test_remove

Is there a better way to run tests?

Thanks
Matti

···

On 02/09/16 16:32, Thomas Caswell wrote:

Which branch are you working off of? Matthew Brett recently did a
whole bunch of work over-hauling how that linking happens.

We currently have a blanket ban on cffi so that mpl will run in
locked-down environments, but I would be open to being convinced using
it in a localized way inside of the tk code.

How are you running the test suite? It is odd that you are hitting tk
at all.

Tom

On Fri, Sep 2, 2016 at 9:24 AM Matti Picus <matti.picus at gmail.com > <mailto:matti.picus at gmail.com>> wrote:

    The pypy C-API progress, where we can basically run all of numpy (on a
    HEAD version numpy + nightly version of pypy).

    That means I will start to look at passing the matplotlib test suite.

    My first try segfaults, due to the tkagg backend blit function which
    calls into tk via id(data) and id(bbox_array).

    That of course will not work on PyPy since the address of a random
    python object does not reflect anything usable in C.

    So my question, as someone who is new to your codebase, is how to
    rewrite this using cffi or the standard C-API without impacting
    performance?

    Matti

    _______________________________________________
    Matplotlib-devel mailing list
    Matplotlib-devel at python.org <mailto:Matplotlib-devel at python.org>
    https://mail.python.org/mailman/listinfo/matplotlib-devel

On my phone so excuse the terse answer.

Use the numpy calls if likely OK

Work of of master or v2.x

Look at our travis.yml file for how to run the tests.

Python tests.py

Tom

···

On Fri, Sep 2, 2016, 09:54 Matti Picus <matti.picus at gmail.com> wrote:

I am working off of 1.5.1, should I be using HEAD? Would any of the data
access API's like np.array.__array_interface__ be acceptable?
I did these two calls

<pypy> setup.py build

<pypy> setup.py nosetests --verbosity=10

and got a crash in matplotlib.tests.test_artist.test_remove

Is there a better way to run tests?

Thanks
Matti

On 02/09/16 16:32, Thomas Caswell wrote:
> Which branch are you working off of? Matthew Brett recently did a
> whole bunch of work over-hauling how that linking happens.
>
> We currently have a blanket ban on cffi so that mpl will run in
> locked-down environments, but I would be open to being convinced using
> it in a localized way inside of the tk code.
>
> How are you running the test suite? It is odd that you are hitting tk
> at all.
>
> Tom
>
> On Fri, Sep 2, 2016 at 9:24 AM Matti Picus <matti.picus at gmail.com > > <mailto:matti.picus at gmail.com>> wrote:
>
> The pypy C-API progress, where we can basically run all of numpy (on
a
> HEAD version numpy + nightly version of pypy).
>
> That means I will start to look at passing the matplotlib test suite.
>
> My first try segfaults, due to the tkagg backend blit function which
> calls into tk via id(data) and id(bbox_array).
>
> That of course will not work on PyPy since the address of a random
> python object does not reflect anything usable in C.
>
> So my question, as someone who is new to your codebase, is how to
> rewrite this using cffi or the standard C-API without impacting
> performance?
>
> Matti
>
> _______________________________________________
> Matplotlib-devel mailing list
> Matplotlib-devel at python.org <mailto:Matplotlib-devel at python.org>
> https://mail.python.org/mailman/listinfo/matplotlib-devel
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-devel/attachments/20160902/2398d163/attachment.html>

The newer tcl / tk linking finds the relevant functions from libraries
loaded by Python, at run time, rather than at compile time. This is
already working for pypy over at Pillow :

https://github.com/python-pillow/Pillow/pull/1932

Cheers,

Matthew

···

On Fri, Sep 2, 2016 at 10:05 AM, Thomas Caswell <tcaswell at gmail.com> wrote:

On my phone so excuse the terse answer.

Use the numpy calls if likely OK

Work of of master or v2.x

Look at our travis.yml file for how to run the tests.

Python tests.py