[pypy-dev] Looking into numpy ndarray.flags.writeable

Eli Stevens (Gmail) wickedgrey at gmail.com
Thu May 19 02:58:50 EDT 2016


I've got a pypy clone and checkout, and have added TestFlags. When I
run it, I see:

>       a.flags.writeable = False
E       TypeError: readonly attribute

But nothing that looks like it should raise a TypeError in either of:

pypy/pypy/module/micronumpy/flagsobj.py
pypy/pypy/module/micronumpy/ndarray.py

Still trying to get oriented with the code. Any suggestions?

Thanks,
Eli

On Wed, May 18, 2016 at 10:55 AM, Matti Picus <matti.picus at gmail.com> wrote:
> On 18/05/16 20:19, Eli Stevens (Gmail) wrote:
>
> Great, thanks for the pointers. I'll hopefully be able to dig in after
> work tonight. Is there a from-scratch guide to getting to the point
> where I can run those micronumpy tests? NBD if not, I'm sure I can
> figure it out.
>
> Do you think it would make sense to start off by copying
> test_multiarray.py:TestFlags there?
>
> Cheers,
> Eli
>
> On Wed, May 18, 2016 at 9:59 AM, Matti Picus <matti.picus at gmail.com> wrote:
>
> It seems you are doing everything correctly.
> multiarray_tests comes from numpy/core/src/multiarray/multiarray.c.src which
> is compiled to a C-API module.
> We skip building it as we have quite a way to go before we can support that
> level of C-API compatibility.
> The issue with readonly flag attributes actually lies with micronumpy, in
> the pypy interpreter itself.
> If you wish to work on this, you should add a test (in the pypy repo) to
> pypy/module/micronumpy/test/test_flagsobj.py and continue from there.
> Matti
>
> There is an explanation of running tests here
> http://doc.pypy.org/en/latest/getting-started-dev.html#running-pypy-s-unit-tests
> The tests in TestFlags require refactoring for our simpler 'assert' style -
> no fancy assert_equal() or assert_() functions
> Matti


More information about the pypy-dev mailing list