`numpy.lib.stride_tricks.as_strided` is not working
The function raises NotImplementedError
.
Test script (borrowed from numpy issue (fixed)).
import numpy as np
from numpy.lib.stride_tricks import as_strided
t = np.dtype([("a", np.float64), ("b", np.float64)], align=True)
a = np.zeros(10, dtype=t)
as_strided(a)
Result under pypy
Traceback (most recent call last):
File "app_main.py", line 75, in run_toplevel
File "test-pypy.py", line 5, in <module>
as_strided(a)
File "/opt/pypy/site-packages/numpy/lib/stride_tricks.py", line 30, in as_strided
array = np.asarray(DummyArray(interface, base=x))
File "/opt/pypy/site-packages/numpy/core/numeric.py", line 460, in asarray
return array(a, dtype, copy=False, order=order)
NotImplementedError: unable to create dtype from objects, "DummyArray" instance not supported
Comments (6)
-
-
- changed status to resolved
This was fixed on the dtypes-object2 branch which was merged to our trunk about a month ago, and available on the latest nightly version
http://buildbot.pypy.org/nightly/trunk/
It will be released as pypy-2.6.0 soonish
-
Does this mean that 'vectorize' will be working?
-
not yet, vectorize uses frompyfunc() and there is still missing functionality in frompyfunc(), I get a
object dtype requested but not implemented
error. I am working my way down the list of numpy test suite failures, and that one is pretty high up, so no need to file another issue. Here are the latest results https://gist.github.com/mattip/7c51c88d3accf34938d1 you can see that one at line 16 -
- changed status to open
Sorry, it seems I jumped the gun. We still get a
NotImplementedError: creating array from __array_interface__ not supported yet
error with as_strided -
- changed status to resolved
fixed in pypy commit dcf9a1751e29
- Log in to comment
I've got a similar error:
NotImplementedError: unable to create dtype from objects, "function" instance not supported