`numpy.lib.stride_tricks.as_strided` is not working

Issue #9 resolved
Yichao Yu created an issue

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)

  1. Andrii Magalich

    I've got a similar error:

    NotImplementedError: unable to create dtype from objects, "function" instance not supported

  2. mattip

    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

  3. mattip
    • 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

  4. Log in to comment