[issue34778] Memoryview for column-major (f_contiguous) arrays from bytes impossible to achieve

2021-10-03 Thread Laurent Gautier
Laurent Gautier added the comment: Bump. I am still stumbling on that issue. I have a workaround by importing numpy but that's a rather large dependency for that one little thing. I see that the related issue https://bugs.python.org/issue35845 opened later has later discussion entries. ---

[issue34778] Memoryview for column-major (f_contiguous) arrays from bytes impossible to achieve

2019-08-31 Thread Laurent Gautier
Laurent Gautier added the comment: Bump. Is there anything I could do to move this forward (as in write and submit a patch for review) ? -- ___ Python tracker ___ __

[issue34778] Memoryview for column-major (f_contiguous) arrays from bytes impossible to achieve

2019-02-05 Thread Stefan Krah
Change by Stefan Krah : -- assignee: -> skrah ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue34778] Memoryview for column-major (f_contiguous) arrays from bytes impossible to achieve

2019-02-02 Thread Laurent Gautier
Laurent Gautier added the comment: > General support for strides in cast(), i.e. a zero-copy view for > non-contiguous arrays does not seem possible because buf.ptr is > moved around. Even NumPy does not support that: I'd be happy enough with zero-copy `cast()` of f-continguous arrays along wi

[issue34778] Memoryview for column-major (f_contiguous) arrays from bytes impossible to achieve

2019-02-02 Thread Stefan Krah
Stefan Krah added the comment: It seems reasonable to support f-contiguous for cast() and tobytes(). For tobytes() it's implemented in the issue that Antoine linked to. General support for strides in cast(), i.e. a zero-copy view for non-contiguous arrays does not seem possible because buf.pt

[issue34778] Memoryview for column-major (f_contiguous) arrays from bytes impossible to achieve

2019-01-31 Thread Nick Coghlan
Nick Coghlan added the comment: +1 for Antoine's comment - while our approach with memoryview has generally been "If you're doing serious work with n-dimensional data, you still need NumPy (or an equivalent)", we've also been open to borrowing more NumPy behaviours for memoryview as particul

[issue34778] Memoryview for column-major (f_contiguous) arrays from bytes impossible to achieve

2019-01-29 Thread Antoine Pitrou
Antoine Pitrou added the comment: I think feature creep is ok if it stems from user needs. Slighty related, but simpler, is https://bugs.python.org/issue35845 -- ___ Python tracker _

[issue34778] Memoryview for column-major (f_contiguous) arrays from bytes impossible to achieve

2019-01-29 Thread Stefan Krah
Stefan Krah added the comment: CC Antoine and Nick. I think we can do it, but we'd need cast(shape=[2,3], order='F') to allow casting back. The only practical objections are feature creep. To preserve symmetry with tobytes(), we'd need to add tobytes('F') (and tobytes('A')). -- nosy:

[issue34778] Memoryview for column-major (f_contiguous) arrays from bytes impossible to achieve

2018-12-30 Thread mattip
mattip added the comment: > the original decision to exclude non 'C' views was deliberate Seems this is reflected in the code: ``` a = np.array([[0, 1, 2], [3, 4, 5]]) mv = memoryview(a.T) mv.f_contiguous # True mv.cast('i', (3, 2)) # TypeError: memoryview: casts are restricted to C-contiguo

[issue34778] Memoryview for column-major (f_contiguous) arrays from bytes impossible to achieve

2018-12-30 Thread Laurent Gautier
Laurent Gautier added the comment: Wait. Isn't a `memoryview` memerely a Python object for a buffer inferface, whatever its valid attributes or flags might be ? The perceived oddness that lead to the addition of the keyword 'shape' was a good initial instinct that something was off, but this

[issue34778] Memoryview for column-major (f_contiguous) arrays from bytes impossible to achieve

2018-12-30 Thread Stefan Krah
Stefan Krah added the comment: memoryview.cast() was originally meant to be a faster version of tobytes(), which always converts to C-contiguous. The 'shape' keyword was added because it is odd if you can cast from ND-C to 1D-Bytes but not back. I'm not sure if we should introduce that feat

[issue34778] Memoryview for column-major (f_contiguous) arrays from bytes impossible to achieve

2018-12-29 Thread Laurent Gautier
Laurent Gautier added the comment: Bump. What are the next steps here ? -- ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue34778] Memoryview for column-major (f_contiguous) arrays from bytes impossible to achieve

2018-09-29 Thread Laurent Gautier
Laurent Gautier added the comment: Wouldn't a contiguity argument ('C' or 'F') be simpler ? (Independently, an argument strides is likely also missing from "cast"). Do you know what are the next possible steps here ? Bring this to the python-dev list ? Submit a patch ? -- component

[issue34778] Memoryview for column-major (f_contiguous) arrays from bytes impossible to achieve

2018-09-29 Thread mattip
mattip added the comment: Sorry, I meant a "strides" keyword. "shape" is already a valid keyword -- ___ Python tracker ___ ___ Pyth

[issue34778] Memoryview for column-major (f_contiguous) arrays from bytes impossible to achieve

2018-09-28 Thread Laurent Gautier
Laurent Gautier added the comment: @mattip : do you mean that it can currently be achieved by calling `cast` with a specific shape parameter ? If the case, how so ? -- ___ Python tracker ___

[issue34778] Memoryview for column-major (f_contiguous) arrays from bytes impossible to achieve

2018-09-24 Thread mattip
mattip added the comment: This could be done via a `shape` kwarg to `cast` -- nosy: +mattip ___ Python tracker ___ ___ Python-bugs-

[issue34778] Memoryview for column-major (f_contiguous) arrays from bytes impossible to achieve

2018-09-24 Thread Stefan Krah
Change by Stefan Krah : -- nosy: +skrah ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.o

[issue34778] Memoryview for column-major (f_contiguous) arrays from bytes impossible to achieve

2018-09-23 Thread Laurent Gautier
New submission from Laurent Gautier : The buffer protocol is accounting for the row-major or column-major arrays, and that information is shown in the attributes, `c_contiguous` and `f_contiguous` respectively, of a memoryview object. Using the method `cast` allows one to specify a shape but