New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Arbitrary Dimensional memoryviews #2656

Open
jakirkham opened this Issue Oct 14, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@jakirkham
Contributor

jakirkham commented Oct 14, 2018

Would be nice to be able to define functions that take arbitrary dimensional memoryviews. Perhaps could use syntax like double[...] a. Interestingly this comes up in CEP 517 in this section and a few SO questions.

ref: https://stackoverflow.com/q/29484943
ref: https://stackoverflow.com/q/33316131

@scoder

This comment has been minimized.

Contributor

scoder commented Oct 14, 2018

Sounds like a nice feature. A few comments:

  • Would probably also suggest to support a minimum dimensionality as in double[:, :, ...] for "at least two dimensions" (I guess).
  • There is currently a hard default limit of 8 dimensions, which can be configured at compile time.
  • The main difficulty is probably to fix all the places where the compiler assumes a known dimensionality.

@scoder scoder added the help wanted label Oct 14, 2018

@jakirkham

This comment has been minimized.

Contributor

jakirkham commented Oct 14, 2018

That sounds reasonable. Was also thinking about how best to enforce contiguity (e.g.
double[..., ::1] a as C-order).

Where does the hard limit come from? Cython itself? Python? Something else?

Do we have a good idea of where those places are?

@scoder

This comment has been minimized.

Contributor

scoder commented Oct 14, 2018

The hard limit is in Cython.

Search for ndim in Cython/Compiler/, that should point you to most of the interesting compile time decisions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment