Engine¶
abc
¶
Abstract class for Engines to evolve Dynamic Systems.
EngineABC
¶
Bases: ModuleBase
Abstract class for Engines to evolve Dynamic Systems.
model_post_init(__context)
¶
Set _runner to the no-op sentinel if not already overridden.
Concrete subclasses should call super().model_post_init(__context)
first, then assign self._runner to their runner function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
__context
|
Any
|
Pydantic model post-init context. |
required |
Source code in src/flepimop2/engine/abc/__init__.py
run(system, eval_times, initial_state, params, model_state=None, **kwargs)
¶
Run the engine with the provided system and parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
system
|
SystemABC
|
The dynamic system to be evolved. |
required |
eval_times
|
Float64NDArray
|
Array of time points for evaluation. |
required |
initial_state
|
dict[IdentifierString, ParameterValue]
|
Structured initial-state entries sampled from parameters. |
required |
params
|
Mapping[IdentifierString, ParameterValue]
|
Additional parameters for the stepper. |
required |
model_state
|
ModelStateSpecification | None
|
Specification describing the semantic ordering of the state entries. |
None
|
**kwargs
|
Any
|
Additional keyword arguments for the engine. |
{}
|
Returns:
| Type | Description |
|---|---|
Float64NDArray
|
The evolved time x state array. |
Source code in src/flepimop2/engine/abc/__init__.py
validate_system(system)
¶
Validation hook for system properties.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
system
|
SystemABC
|
The system to validate. |
required |
Returns:
| Type | Description |
|---|---|
list[ValidationIssue] | None
|
A list of validation issues, or |
Source code in src/flepimop2/engine/abc/__init__.py
EngineProtocol
¶
Bases: Protocol
Type-definition (Protocol) for engine runner functions.
__call__(stepper, times, initial_state, params, model_state=None, **kwargs)
¶
Protocol for engine runner functions.
Source code in src/flepimop2/engine/abc/__init__.py
build(config)
¶
Build a EngineABC from a configuration dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
dict[str, Any] | ModuleBase | str
|
Configuration dictionary or a |
required |
Returns:
| Type | Description |
|---|---|
EngineABC
|
The constructed engine instance. |
Source code in src/flepimop2/engine/abc/__init__.py
wrapper
¶
A EngineABC which wraps a user-defined script file.
WrapperEngine
¶
Bases: EngineABC
A EngineABC which wraps a user-defined script file.
validate_system(system)
¶
Validate that the given system is compatible with this engine.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
system
|
SystemABC
|
The system to validate. |
required |
Returns:
| Type | Description |
|---|---|
list[ValidationIssue] | None
|
A list of validation issues, or |