Open
Description
I just ran into the following "problem":
import numpy as np
import zarr
a = np.arange(0, 16, dtype = 'float32').reshape(4, 4)
b = zarr.open('test.zarr', mode = 'w', shape = (4, 4), chunks = (2, 2), dtype = 'f4')
np.multiply(a, 2, out = b[:, :]) # does not change file(s) on disk
np.multiply(a, 2, out = b) # TypeError: return arrays must be of ArrayType
Some ufuncs (but not those from numpy itself) allow zarr arrays as out-parameters. I.e. the result of the computation is directly written to disk. numpy in fact rejects zarr arrays because they are not of "ArrayType". Could this be changed? I am not entirely sure given the nature of numpy's memory management.