Skip to content

0.15.0

Latest

Choose a tag to compare

@birnbaum birnbaum released this 03 May 23:16

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_factor is gone from Environment.run(). The behind_threshold argument has been moved to Environment.live().
  • Breaking: SilSignal now strictly requires Environment.live(). Attempting to use a SiL signal in a simulated environment will raise a RuntimeError.

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) replaces Signal.now(at=...). Time is now passed as elapsed time since sim_start (either a timedelta or elapsed seconds as a float).
  • Breaking: Custom Signal subclasses, as well as Actor.power(now) and Actor.state(now), must be updated to accept elapsed instead of a datetime.
  • Breaking: The internal Clock utility was removed. Custom simulators subclassing _ActorSim, _ControllerSim, or _MicrogridSim now receive sim_start directly instead of a Clock instance.

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: Trace is now strictly offset-indexed. Row 0 sits at offset=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-indexed watttime_example.csv for demonstrating calendar-data loading.
  • Breaking: When using datetime-indexed data for a Trace, you must now provide an explicit anchor (the timestamp in your data that corresponds to elapsed=0).
  • Removed: Trace.load() and the dataset registry (_data.py, ~/.cache/vessim downloads) are gone. Use Trace.from_csv() against the new examples in datasets/ 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 a timedelta, a datetime, an int/float (elapsed seconds), or None for 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.py and sil_example.py to reflect the new API.

Full Changelog: 0.14.0...0.15.0