Message227113
In NumPy we decided some time ago that if you have a multi dimensional buffer, shaped for example 1x10, then this buffer should be considered both C- and F-contiguous. Currently, some buffers which can be used validly in a contiguous fashion are rejected.
CPython does not support this currently possibly creating smaller nuisance if/once we change it fully in NumPy, see for example https://github.com/numpy/numpy/issues/5085
I have attached a patch which should (sorry I did not test this at all yet) relax the checks as much as possible. I think this is right, but we did some subtle breaks in user code (mostly cython code) when we first tried changing it, and while numpy arrays may be more prominently C/F-contiguous, compatibility issues with libraries checking for contiguity explicitly and then requesting a strided buffer are very possible.
If someone could give me a hint about adding tests, that would be great.
Also I would like to add a small note to the PEP in any case regarding this subtlety, in the hope that more code will take care about such subtleties. |
|
Date |
User |
Action |
Args |
2014-09-19 19:00:50 | seberg | set | recipients:
+ seberg |
2014-09-19 19:00:50 | seberg | set | messageid: <1411153250.02.0.529032306838.issue22445@psf.upfronthosting.co.za> |
2014-09-19 19:00:49 | seberg | link | issue22445 messages |
2014-09-19 19:00:49 | seberg | create | |
|