pySimBlocks.core.config

class pySimBlocks.core.config.SimulationConfig(dt: float, T: float, t0: float = 0.0, solver: str = 'fixed', logging: List[str] = <factory>, clock: str = 'internal')[source]

Bases: object

Simulation execution configuration.

Contains only execution-related parameters. Must not hold any model or block-specific information.

dt: float

Simulation time step in seconds.

T: float

Simulation end time in seconds.

t0: float = 0.0

Simulation start time in seconds.

solver: str = 'fixed'

Integration scheme, either "fixed" or "variable".

logging: List[str]

Signals to log during simulation.

clock: str = 'internal'

Clock source, either "internal" or "external".

validate() None[source]

Verify that the configuration is consistent.

Checks that dt > 0, T > t0, solver and clock are known values.

Raises:

ValueError – If any parameter is invalid or out of range.

class pySimBlocks.core.config.PlotConfig(plots: List[Dict[str, Any]])[source]

Bases: object

Plot configuration.

Describes how logged signals should be visualized. Contains no plotting logic.

plots: List[Dict[str, Any]]

List of plot descriptors. Each descriptor is a dict with at least a "signals" field, which is a list of signal names to plot together

validate() None[source]

Verify that each plot descriptor has the required fields.

Classic plots require signals. Manual layout presets use layout: manual with a panels list instead.

Raises:

ValueError – If a plot descriptor is invalid.