SimpleProxy¶
Simple proxy for a NumPy array (or similar) that can be used with the Blosc2 compute engine.
This only supports the __getitem__ method. No caching is performed.
- class blosc2.SimpleProxy(src, chunks: tuple | None = None, blocks: tuple | None = None)[source]¶
Simple proxy for a NumPy array (or similar) that can be used with the Blosc2 compute engine.
This only supports the __getitem__ method. No caching is performed.
Examples
>>> import numpy as np >>> import blosc2 >>> a = np.arange(20, dtype=np.float32).reshape(4, 5) >>> proxy = blosc2.SimpleProxy(a) >>> proxy[1:3, 2:4] [[ 7. 8.] [12. 13.]]
- Attributes:
- Special Methods:
__init__
(src[, chunks, blocks])__getitem__
(item)Get a slice as a numpy.ndarray (via this proxy).
Constructor¶
Utility Methods¶
- __getitem__(item: slice | list[slice]) ndarray [source]¶
Get a slice as a numpy.ndarray (via this proxy).
- Parameters:
item¶
- Returns:
out – An array with the data slice.
- Return type:
numpy.ndarray
- property dtype¶
The data type of the source array.
- property shape¶
The shape of the source array.
- property src¶
The source object that this proxy wraps.