Subsets
- class deker.subset.Subset(slice_expression, shape, array, adapter)
Bases:
BaseSubsetArraysubset.A subset of the
Arraydata with setbounds,shape,dtypeandfill_value.It is final
lazyobject that canread,updateandclearthe data within theArray. Once created, it does not contain any data and does not access the storage until user manually invokes one of the subset API methods. If you need to get and manage all the data from the array you should create a subset withArray[:]orArray[...].Properties
shape: returns shape of the subsetbounds: returns the bounds that were applied to theArraydtype: returns type of the queried datafill_value: returns the value that fills empty cells instead of None
API methods
describe: returns an OrderedDict with description of all the subset’s dimensionsread: returns a numpy ndarray with all the data from the Subset boundsNote
If the Subset or Array is empty, a numpy ndarray of
fill_valueswill be returnedWarning
Mind your RAM!
read_xarray: returns anxarray.DataArraywith data returned by read method and its description.Attention
Scalar data cannot be converted to
xarray.DataArrayupdate: writes new data to the storage;Note
Data cannot be
NoneData
shapeshould be equal to theSubset.shapeData
dtypeshould be equal to theArray.dtype
clear: removes or resets with fill_value all data from the storage within the subset bounds;
- clear()
Clear data in
Arrayby slice.- Return type
None
- read()
Read data from
Arrayslice.- Return type
Union[int, float, complex, int8, int16, int32, int64, longlong, uint64, uint8, uint16, uint32, ulonglong, float16, complex128, float32, clongdouble, float64, longdouble, complex64, ndarray]
- update(data)
Update data in
Arrayby slice.Data cannot be
NoneData
shapeshould be equal to theSubset.shapeData
dtypeshould be equal to theArray.dtype
- Parameters
data (Union[list, tuple, ndarray, int, float, complex, int8, int16, int32, int64, longlong, uint64, uint8, uint16, uint32, ulonglong, float16, complex128, float32, clongdouble, float64, longdouble, complex64]) – new data which shall match subset slicing
- Return type
None
- Parameters
slice_expression (Tuple[Union[slice, int], ...]) –
shape (Tuple[int, ...]) –
array (Array) –
adapter (BaseArrayAdapter) –
- class deker.subset.VSubset(slice_expression, shape, array, array_adapter, varray_adapter, collection)
Bases:
BaseSubsetVArraysubset.A subset of
VArraydata with setbounds,shape,dtypeandfill_value.It is final
lazyobject that canread,updateandclearthe data within theVArray. Once created, it does not contain any data and does not access the storage until user manually invokes one of the virtual subset API methods. If you need to get and manage all the data from array you shall create a virtual subset withVArray[:]orVArray[...].Properties
shape: returns shape of the virtual subsetbounds: returns bounds that were applied toVArraydtype: returns type of queried datafill_value: returns value that fills empty cells instead of None
API methods
describe: returns an OrderedDict with description of all VSubset’s dimensionsread: returns a numpy ndarray with all the data from the VSubset boundsNote
If the VSubset or VArray is empty, a numpy ndarray of
fill_valueswill be returnedWarning
Mind your RAM!
read_xarray: returns anxarray.DataArraywith data returned by read method and its description.Attention
Scalar data cannot be converted to
xarray.DataArrayupdate: writes new data to the storage;Note
Data cannot be
NoneData
shapeshall be equal to theVSubset.shapeData
dtypeshall be equal to theVArray.dtype
clear: removes or resets with fill_value all data from the storage within the virtual subset bounds;
- param slice_expression
a slice, tuple of slices or numpy IndexExpression, created by VArray.__getitem__()
- param shape
subset shape, calculated by VArray.__getitem__()
- param array
an instance of VArray to which the virtual subset is bound
- param array_adapter
ArrayAdapter instance
- param collection
Collection instance, to which the virtual array is bound
- clear()
Clear data in
VArrayby slice.- Return type
None
- read()
Read data from
VArrayslice.- Return type
Union[int, float, complex, int8, int16, int32, int64, longlong, uint64, uint8, uint16, uint32, ulonglong, float16, complex128, float32, clongdouble, float64, longdouble, complex64, ndarray]
- update(data)
Update data in
VArrayby slice.Data cannot be
NoneData
shapeshould be equal to theVSubset.shapeData
dtypeshould be equal to theVArray.dtype
- Parameters
data (Union[list, tuple, ndarray, int, float, complex, int8, int16, int32, int64, longlong, uint64, uint8, uint16, uint32, ulonglong, float16, complex128, float32, clongdouble, float64, longdouble, complex64]) – new data which shall match subset slicing
- Return type
None
- Parameters
slice_expression (Tuple[Union[slice, int], ...]) –
shape (Tuple[int, ...]) –
array (VArray) –
array_adapter (BaseArrayAdapter) –
varray_adapter (BaseVArrayAdapter) –
collection (Collection) –