Backend¶
abc
¶
Abstract base class for flepimop2 file IO backends.
BackendABC
¶
Bases: ModuleABC
Abstract base class for flepimop2 file IO backends.
read(run_meta)
¶
Read a numpy array from storage.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
run_meta
|
RunMeta
|
Metadata about the current run. |
required |
Returns:
| Type | Description |
|---|---|
Float64NDArray
|
The numpy array read from storage. |
Source code in src/flepimop2/backend/abc/__init__.py
28 29 30 31 32 33 34 35 36 37 38 | |
save(data, run_meta)
¶
Save a numpy array to storage.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
Float64NDArray
|
The numpy array to save. |
required |
run_meta
|
RunMeta
|
Metadata about the current run. |
required |
Source code in src/flepimop2/backend/abc/__init__.py
18 19 20 21 22 23 24 25 26 | |
build(config)
¶
Build a BackendABC from a configuration dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
dict[str, Any] | ModuleModel
|
Configuration dictionary. The dict must contains a 'module' key, which will be used to lookup the Backend module path. The module will have "flepimop2.backend." prepended. |
required |
Returns:
| Type | Description |
|---|---|
BackendABC
|
The constructed backend instance. |
Source code in src/flepimop2/backend/abc/__init__.py
51 52 53 54 55 56 57 58 59 60 61 62 63 | |