Executable

HermesPy base for executable configurations.

class Verbosity(value)

Bases: enum.Enum

Information output behaviour configuration of an executable.

ALL = 0
INFO = 1
WARNING = 2
ERROR = 3
NONE = 4
class Executable(results_dir=None, verbosity=Verbosity.INFO, console=None)

Bases: abc.ABC, hermespy.core.factory.Serializable

Base Class for HermesPy Entry Points.

All executables are required to implement the run() method.

Parameters
  • results_dir (str, optional) – Directory in which all execution artifacts will be dropped.

  • verbosity (Union[str, Verbosity], optional) – Information output behaviour during execution.

  • console (Console, optional) – The console instance the executable will operate on.

yaml_tag: Optional[str] = 'Executable'

YAML serialization tag.

execute()

Execute the executable.

Sets up the environment to the implemented run() routine.

Return type

None

abstract run()

Execute the configuration.

Return type

None

property results_dir: str

Directory in which the execution results will be saved.

Returns

The directory.

Return type

str

property verbosity: hermespy.core.executable.Verbosity

Information output behaviour during execution.

Returns

Configuration flag.

Return type

Verbosity

static default_results_dir()

Create a default directory to store execution results.

Returns

Path to the newly created directory.

Return type

str

property style: str

Matplotlib color scheme.

Returns

Color scheme.

Return type

str

Raises

ValueError – If the style is not available.

static style_context()

Context for the configured style.

Returns

Style context manager.

Return type

ContextManager

property console: rich.console.Console

Console the Simulation writes to.

Returns

Handle to the console.

Return type

Console