You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, here I get the following error message: ValueError: buffer source array is read-only. This error has already been discussed and tackled elsewhere (e.g. Dask#1978, scikit-allel#208), typically by running the array through a function like this (h/t @alimanfoo):
defmemoryview_safe(x):
"""Make array safe to run in a Cython memoryview-based kernel. These kernels typically break down with the error ``ValueError: buffer source array is read-only`` when running in dask distributed. See Also -------- https://github.com/dask/distributed/issues/1978 https://github.com/cggh/scikit-allel/issues/206 """ifnotx.flags.writeable:
ifnotx.flags.owndata:
x=x.copy(order='A')
x.setflags(write=True)
returnx
My question is: Is it possible to make ragged arrays memoryview-safe natively? I can definitely run memoryview_safe on each array I retrieve, but it will incur an overhead that I would like to avoid in my program.
The text was updated successfully, but these errors were encountered:
Hi there,
I'm using Zarr to store ragged arrays in a fashion that's similar to what's outlined in the documentation:
In my case, I need to retrieve those arrays and then process them in a
cython
function:However, here I get the following error message:
ValueError: buffer source array is read-only
. This error has already been discussed and tackled elsewhere (e.g. Dask#1978, scikit-allel#208), typically by running the array through a function like this (h/t @alimanfoo):My question is: Is it possible to make ragged arrays memoryview-safe natively? I can definitely run
memoryview_safe
on each array I retrieve, but it will incur an overhead that I would like to avoid in my program.The text was updated successfully, but these errors were encountered: