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
{{ message }}
This repository has been archived by the owner on Feb 14, 2020. It is now read-only.
Cool project. I gave it a shot with an eye towards using it with dask arrays. I have some feedback on the numpy slicing protocol.
A common API for array storage technologies is to mimic Numpy slicing syntax:
>>>array[:5, ::2, 100]
... mynumpyarray ...
I'm glad to see that diced supports much of this API. This makes it much easier to interact with with other libraries. After looking through the README and trying things out I got as far as the following:
It would be useful if the dtype object was actually just a numpy dtype, rather than a custom diced-specific type
Slicing only works if all dimensions are specified and the elements of the slices are specified explicitly
In [21]: array[0]
---------------------------------------------------------------------------DicedExceptionTraceback (mostrecentcalllast)
<ipython-input-21-bdd46aa5d024>in<module>()
---->1array[0]
/home/mrocklin/Software/anaconda/envs/diced/lib/python2.7/site-packages/diced/DicedArray.pycin__getitem__(self, index)
179180ifself.numdims!=dimsreq:
-->181raiseDicedException("Array has a different number of dimensions than requested")
182183z=y=x=slice(0,1)
DicedException: ArrayhasadifferentnumberofdimensionsthanrequestedIn [22]: array[0, 0, :5]
---------------------------------------------------------------------------TypeErrorTraceback (mostrecentcalllast)
<ipython-input-22-ab665471e927>in<module>()
---->1array[0, 0, :5]
/home/mrocklin/Software/anaconda/envs/diced/lib/python2.7/site-packages/diced/DicedArray.pycin__getitem__(self, index)
195zsize=z.stop-z.start196ysize=y.stop-y.start-->197xsize=x.stop-x.start198ifzsize*ysize*xsize>self.MAX_REQ_SIZE:
199data=np.zeros((zsize, ysize, xsize), self.dtype.value)
TypeError: unsupportedoperandtype(s) for-: 'int'and'NoneType'
For reference this interface of dtype, shape, and slicing is supported by h5py, netcdf4, zarr, and most other array storage technologies in Python. This has allowed other projects (like Dask) to these formats without having to special case them (docs here)
The text was updated successfully, but these errors were encountered:
Cool project. I gave it a shot with an eye towards using it with dask arrays. I have some feedback on the numpy slicing protocol.
A common API for array storage technologies is to mimic Numpy slicing syntax:
I'm glad to see that diced supports much of this API. This makes it much easier to interact with with other libraries. After looking through the README and trying things out I got as far as the following:
This is great to see! Some critical feedback:
array.shape
as wellFor reference this interface of dtype, shape, and slicing is supported by
h5py
,netcdf4
,zarr
, and most other array storage technologies in Python. This has allowed other projects (like Dask) to these formats without having to special case them (docs here)The text was updated successfully, but these errors were encountered: