Executable¶

Base class of all executable entry points in HermesPy.
- class Executable(results_dir=None, verbosity=Verbosity.INFO, console=None, console_mode=ConsoleMode.INTERACTIVE, debug=False)[source]¶
Bases:
ABC
Base Class for HermesPy Entry Points.
All executables are required to implement the
run()
method.- Parameters:
results_dir (
str
|None
) – Directory in which all execution artifacts will be dropped.verbosity (
Union
[Verbosity
,str
]) – Information output behaviour during execution.console (
Console
|None
) – The console instance the executable will operate on.console_mode (
ConsoleMode
) – Output behaviour of the information printed to the console. Interactive by default.debug (
bool
) – If enabled, the executable will be run in debug mode. In this case, the exception handler will re-raise exceptions and stop the execution.
- static default_results_dir(experiment=None, overwrite_results=False)[source]¶
Create a default directory to store execution results.
Warning
If overwrite_results is set to True, the current results directory will be erased. Proceed with caution as to not lose any important data.
- Parameters:
- Return type:
Returns: Path to the newly created directory.
- execute()[source]¶
Execute the executable.
Sets up the environment to the implemented
run()
routine.- Return type:
- static style_context()[source]¶
Context for the configured style.
Returns: Style context manager generator.
- Return type:
- property console_mode: ConsoleMode¶
Console mode during runtime.
Returns: The current console mode.
- property debug: bool¶
Debug mode flag.
If enabled, the executable will be run in debug mode. In this case, the exception handler will re-raise exceptions and stop the execution.
- property results_dir: str¶
Directory in which the execution results will be saved.
- Returns:
The directory.
- Return type:
- property style: str¶
Matplotlib color scheme.
Returns: Color scheme.
- Raises:
ValueError – If the style is not available.