Skip to content

ScenarioConfig class

Bases: Section

Configuration fields needed to instantiate an actual Scenario.

Attributes

additional_data_node_configs property

additional_data_node_configs: List[DataNodeConfig]

List of additional data nodes used by this scenario configuration.

additional_data_nodes property

additional_data_nodes: List[DataNodeConfig]

List of additional data nodes used by this scenario configuration.

comparators instance-attribute

comparators: Dict[str, List[Callable]] = defaultdict(list)

The comparator functions used to compare scenarios.

The default value is None.

Each comparator function is attached to a scenario's data node configuration. The key of the dictionary parameter corresponds to the data node configuration id. The value is a list of functions that are applied to all the data nodes instantiated from the data node configuration attached to the comparator.

data_node_configs property

data_node_configs: List[DataNodeConfig]

List of all data nodes used by this scenario configuration.

data_nodes property

data_nodes: List[DataNodeConfig]

List of all data nodes used by this scenario configuration.

frequency instance-attribute

frequency: Optional[Frequency] = frequency

The frequency of the scenario's cycle. The default value is None.

id instance-attribute

id: str = _validate_id(id)

A valid python identifier that uniquely identifies the section.

properties property writable

properties

A dictionary of additional properties.

sequences instance-attribute

sequences: Dict[str, List[TaskConfig]] = (
    sequences if sequences else {}
)

Dictionary of sequence descriptions. The default value is None.

task_configs property

task_configs: List[TaskConfig]

List of task configurations used by this scenario configuration.

tasks property

tasks: List[TaskConfig]

List of task configurations used by this scenario configuration.

Methods

add_comparator()

add_comparator(
    dn_config_id: str, comparator: Callable
) -> None

Add a comparator to the scenario configuration.

Parameters:

Name Type Description Default
dn_config_id str

The data node configuration id to which the comparator will be applied.

required
comparator Callable

The comparator function to be added.

required

add_sequences()

add_sequences(
    sequences: Dict[str, List[TaskConfig]]
) -> None

Add sequence descriptions to the scenario configuration.

When a Scenario is instantiated from this configuration, the sequence descriptions are used to add new sequences to the scenario.

Parameters:

Name Type Description Default
sequences Dict[str, List[TaskConfig]]

Dictionary of sequence descriptions.

required

default_config() classmethod

default_config() -> ScenarioConfig

Get a scenario configuration with all the default values.

Returns:

Type Description
ScenarioConfig

A scenario configuration with all the default values.

delete_comparator()

delete_comparator(dn_config_id: str) -> None

Delete a comparator from the scenario configuration.

remove_sequences()

remove_sequences(
    sequence_names: Union[str, List[str]]
) -> None

Remove sequence descriptions from the scenario configuration.

Parameters:

Name Type Description Default
sequence_names Union[str, List[str]]

The name of the sequence or a list of sequence names.

required