Scenario¶
abc
¶
Abstract base class for scenarios.
Float64NDArray = npt.NDArray[np.float64]
module-attribute
¶
Alias for a NumPy ndarray with float64 data type.
ScenarioABC
¶
Bases: ModuleABC
Abstract base class for scenarios.
scenario_type
abstractmethod
property
¶
Return the type of the scenario tuples for introspection purposes.
Returns:
| Type | Description |
|---|---|
type[NamedTuple]
|
The type of the scenario tuples. |
scenarios()
abstractmethod
¶
Expose the scenarios.
Returns:
| Type | Description |
|---|---|
Iterable[NamedTuple]
|
An iterable of scenario tuples. |
build(config)
¶
Build a ScenarioABC from a configuration dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
dict[IdentifierString, Any] | ModuleModel
|
Configuration dictionary or a |
required |
Returns:
| Type | Description |
|---|---|
ScenarioABC
|
The constructed scenario instance. |
Source code in src/flepimop2/scenario/abc/__init__.py
grid
¶
Grid scenario implementation.
Float64NDArray = npt.NDArray[np.float64]
module-attribute
¶
Alias for a NumPy ndarray with float64 data type.
GridScenario
¶
Bases: ModuleModel, ScenarioABC
Grid scenario implementation.
This scenario generates scenarios by taking the Cartesian product of parameter lists defined in the configuration.
Attributes:
| Name | Type | Description |
|---|---|---|
module |
Literal['flepimop2.scenario.grid']
|
The module type, fixed to "flepimop2.scenario.grid". |
parameters |
dict[IdentifierString, list[Any]]
|
A dictionary where keys are parameter names and values are lists of parameter values to be combined into scenarios. |
scenario_type
property
¶
Return the type of the scenario tuples for introspection purposes.
Returns:
| Type | Description |
|---|---|
type[NamedTuple]
|
The type of the scenario tuples. |
scenarios()
¶
Expose the scenarios.
Yields:
| Type | Description |
|---|---|
Iterable[NamedTuple]
|
Scenario tuples from parameters. |