Wrappers¶
-
class
Packable_Array
[source]¶ Bases:
humpack.packing.Packable
Wrapper to allow saving numpy arrays. Aside from being rather useful, this serves as an example for how to write a Packable wrapper.
Note the necessary Packable methods are all static, and the use of “use_cls” in the class declaration.
-
static
__create__
(data)[source]¶ Creates an empty np.array
- Parameters
data – packed data
- Returns
empty array with the correct size
-
static
-
class
ObjectWrapper
(obj)[source]¶ Bases:
humpack.transactions.Transactionable
,humpack.packing.Packable
,ObjectProxy
Wrapper to transform an object to be transactionable.
Note: wrapped object must be copyable (shallow copy using .copy())
WARNING: It is NOT recommended to use this wrapper, unless you need a transactionable features
-
class
Array
(obj)[source]¶ Bases:
humpack.wrappers.ObjectWrapper
This is an example of how to use the ObjectWrapper. Wraps numpy arrays.
WARNING: it is NOT recommended to use this wrapper for numpy arrays (they are already registered).