This release focuses on simplifying real-time Software-in-the-Loop (SiL) experiments and streamlining how Vessim handles time and data.
Live Mode
Real-time, Software-in-the-Loop simulations are now explicit. Previously, running a simulation in real-time required passing low-level parameters to Environment.run() and interacting with historical traces would often get messy.
- New: Real-time simulations are now instantiated through a dedicated
Environment.live()classmethod, which forces the simulation clock to advance 1:1 with wall-clock time. - Removed:
rt_factoris gone fromEnvironment.run(). Thebehind_thresholdargument has been moved toEnvironment.live(). - Breaking:
SilSignalnow strictly requiresEnvironment.live(). Attempting to use a SiL signal in a simulated environment will raise aRuntimeError.
Elapsed-Time Signal API
To make Live Mode reliable, we decoupled the simulation clock from absolute calendar dates. The simulation now only cares about how much time has elapsed since it started, rather than the absolute date on the calendar.
- New:
Signal.at(elapsed)replacesSignal.now(at=...). Time is now passed as elapsed time sincesim_start(either atimedeltaor elapsed seconds as afloat). - Breaking: Custom
Signalsubclasses, as well asActor.power(now)andActor.state(now), must be updated to acceptelapsedinstead of adatetime. - Breaking: The internal
Clockutility was removed. Custom simulators subclassing_ActorSim,_ControllerSim, or_MicrogridSimnow receivesim_startdirectly instead of aClockinstance.
Traces and Datasets
With the shift to relative elapsed time, we overhauled how time-series data is ingested. We want to make it easier for users to bring their own data rather than relying on Vessim to maintain a registry of datasets.
- New:
Traceis now strictly offset-indexed. Row 0 sits atoffset=0, and every other row is a positive offset from there.Trace.from_csv(..., scale=...)now natively handles both offset-indexed and datetime-indexed CSVs. - New: We replaced the old Solcast/WattTime archives with three simple examples:
solar_example.csv(10 solar traces),load_example.csv(10 load traces), and a datetime-indexedwatttime_example.csvfor demonstrating calendar-data loading. - Breaking: When using datetime-indexed data for a
Trace, you must now provide an explicitanchor(the timestamp in your data that corresponds toelapsed=0). - Removed:
Trace.load()and the dataset registry (_data.py,~/.cache/vessimdownloads) are gone. UseTrace.from_csv()against the new examples indatasets/or your own files. - Removed: We removed
Trace.forecast(). In practice, built-in forecasting added too much complexity for edge cases, and most users were implementing custom forecasting solutions anyway.
Minor Changes
Environment.run(until=...)now accepts atimedelta, adatetime, anint/float(elapsed seconds), orNonefor indefinite runs.
Documentation Updates
- Rewrote the Signals and Datasets concept page to explain the new offset-indexed model, with recipes for using your own CSVs or in-memory data.
- Reworked the Getting Started guide and updated
basic_example.pyandsil_example.pyto reflect the new API.
Full Changelog: 0.14.0...0.15.0