- id: The id of new scenario configuration to be created. This id is mandatory and must be a unique and valid Python variable name.
- pipelines: The list of pipeline configs.
- frequency: The recurrence of the scenarios instantiated from this configuration. Based on this frequency the scenarios will be attached to the right cycles.
- comparators: The list of functions used to compare scenarios. A comparator function is attached to a scenario's data node configuration. During the scenario comparison, each comparator is applied to all the data nodes instantiated from the data node configuration attached to the comparator.
- properties: A dictionary of additional properties.
Scenario configuration from pipeline configurations¶
Here is a simple example assuming the pipeline configuration
pipeline_config has already been created :
1 2 3
In this example, we create a scenario configuration
taipy.core.taipy.ScenarioConfig from a pipeline configuration already defined.
Scenario configuration from task configurations¶
When the scenario configuration contains only one single pipeline configuration, we can also create the
taipy.core.taipy.ScenarioConfig from the task configurations directly.
1 2 3
Behind the scenes, a pipeline configuration is created. Its id will be the scenario configuration id with the
_pipeline postfix (
multiply_scenario_pipeline in the example).
Note that the pipeline id can be configured as an optional parameter as follows:
1 2 3
Scenario configuration with Cycle¶
Assuming the pipeline configuration
pipeline_config has already been created, here is an example of a weekly
scenario configuration :
1 2 3
In this small example, we create a scenario configuration
taipy.core.taipy.ScenarioConfig from a pipeline configuration with a
WEEKLY frequency. When scenarios (entities) do get created using the scenario configuration above, they will be
associated to a Cycle corresponding to their creation date. See documentation on
Scenario and cycle management.