System¶
abc
¶
Abstract class for Dynamic Systems.
SystemABC(*args, **kwargs)
¶
Bases: ModuleABC
Abstract class for Dynamic Systems.
Attributes:
| Name | Type | Description |
|---|---|---|
module |
str
|
The module name for the system. |
state_change |
StateChangeEnum
|
The type of state change. |
options |
dict[str, Any] | None
|
Optional dictionary of additional options the system exposes for
|
Initialize the SystemABC.
The default initialization sets the stepper to a no-op function. Concrete implementations should override this with a valid stepper function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*args
|
Any
|
Positional arguments. |
()
|
**kwargs
|
Any
|
Keyword arguments. |
{}
|
Source code in src/flepimop2/system/abc/__init__.py
77 78 79 80 81 82 83 84 85 86 87 88 | |
__init_subclass__(**kwargs)
¶
Ensure concrete subclasses define a valid state change type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
**kwargs
|
Any
|
Additional keyword arguments passed to parent classes. |
{}
|
Raises:
| Type | Description |
|---|---|
TypeError
|
If a concrete subclass does not define |
Source code in src/flepimop2/system/abc/__init__.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | |
step(time, state, **params)
¶
Perform a single step of the system's dynamics.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
float64
|
The current time. |
required |
state
|
Float64NDArray
|
The current state array. |
required |
**params
|
Any
|
Additional parameters for the stepper. |
{}
|
Returns:
| Type | Description |
|---|---|
Float64NDArray
|
The next state array after one step. |
Source code in src/flepimop2/system/abc/__init__.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 | |
SystemProtocol
¶
Bases: Protocol
Type-definition (Protocol) for system stepper functions.
__call__(time, state, **kwargs)
¶
Protocol for system stepper functions.
Source code in src/flepimop2/system/abc/__init__.py
20 21 22 23 24 | |
build(config)
¶
Build a SystemABC from a configuration dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
dict[str, Any] | ModuleModel
|
Configuration dictionary or a |
required |
Returns:
| Type | Description |
|---|---|
SystemABC
|
The constructed system instance. |
Source code in src/flepimop2/system/abc/__init__.py
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | |
wrapper
¶
A SystemABC which wraps a user-defined script file.
WrapperSystem(*args, **kwargs)
¶
Bases: ModuleModel, SystemABC
A SystemABC which wraps a user-defined script file.
Source code in src/flepimop2/system/abc/__init__.py
77 78 79 80 81 82 83 84 85 86 87 88 | |