Process¶
process
¶
Process module for handling processing steps in flepimop2.
ProcessABC()
¶
Bases: ABC
Abstract base class for flepimop2 processing steps.
Initialize the process with the given configuration.
Source code in src/flepimop2/process/abc.py
13 14 | |
execute(*, dry_run=False)
¶
Execute a processing step.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dry_run
|
bool
|
If True, the process will not actually execute but will simulate execution. |
False
|
Source code in src/flepimop2/process/abc.py
16 17 18 19 20 21 22 23 24 | |
build(config)
¶
Build a ProcessABC from a configuration dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
dict[str, Any] | ModuleModel
|
Configuration dictionary. The dict should contain a 'module' key, which will be used to lookup the Process module path. The module will have "flepimop2.process." prepended. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
ProcessABC |
ProcessABC
|
The constructed process object. |
Raises:
| Type | Description |
|---|---|
TypeError
|
If the built process is not an instance of ProcessABC. |
Source code in src/flepimop2/process/abc.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | |
abc
¶
Abstract base class for flepimop2 processing steps.
ProcessABC()
¶
Bases: ABC
Abstract base class for flepimop2 processing steps.
Initialize the process with the given configuration.
Source code in src/flepimop2/process/abc.py
13 14 | |
execute(*, dry_run=False)
¶
Execute a processing step.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dry_run
|
bool
|
If True, the process will not actually execute but will simulate execution. |
False
|
Source code in src/flepimop2/process/abc.py
16 17 18 19 20 21 22 23 24 | |
build(config)
¶
Build a ProcessABC from a configuration dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
dict[str, Any] | ModuleModel
|
Configuration dictionary. The dict should contain a 'module' key, which will be used to lookup the Process module path. The module will have "flepimop2.process." prepended. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
ProcessABC |
ProcessABC
|
The constructed process object. |
Raises:
| Type | Description |
|---|---|
TypeError
|
If the built process is not an instance of ProcessABC. |
Source code in src/flepimop2/process/abc.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | |
shell
¶
Shell process for flepimop2.
ShellProcess()
¶
Bases: ModuleModel, ProcessABC
Shell process for executing commands.
Attributes:
| Name | Type | Description |
|---|---|---|
module |
Literal['shell']
|
The module type, fixed to "shell". |
command |
str
|
The shell command to execute. |
args |
list[str]
|
Arguments to pass to the shell command. |
Source code in src/flepimop2/process/abc.py
13 14 | |
build(config)
¶
Build a ShellProcess from a configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
dict[str, Any]
|
Configuration dictionary to create a shell process. If module key is defined, it must be "shell". Must contain a 'command' key with the shell command to execute. |
required |
Returns:
| Type | Description |
|---|---|
ShellProcess
|
The ready-to-use |
Source code in src/flepimop2/process/shell.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 | |