Conversation
# Conflicts: # docs/experimental_tutorials/pybamm_example.ipynb # docs/experimental_tutorials/stranger_sims_example.ipynb
There was a problem hiding this comment.
Pull request overview
This PR merges the 0.13.0 branch, introducing significant architectural changes and API improvements to Vessim. The changes include class renamings for better clarity, a refactored controller architecture, removal of the dynamic parameter-setting mechanism, migration from Sphinx to MkDocs for documentation, and comprehensive new tests and tutorials.
Key changes:
- API Simplification: Renamed
MicrogridPolicy→Policy,DefaultMicrogridPolicy→DefaultPolicy,Monitor→MemoryLogger, and introducedCsvLogger - Controller Refactoring: Changed from per-microgrid controllers to a unified global controller approach with a new
start()lifecycle method - Removed Features: Eliminated the
set_parameter()mechanism from policies and storage, along with theset_parametersattribute communication between components
Reviewed changes
Copilot reviewed 67 out of 83 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| vessim/storage.py | Removed set_parameter method and updated type imports; renamed MicrogridPolicy to Policy |
| vessim/signal.py | Added type hints for kwargs parameters |
| vessim/policy.py | Renamed classes to Policy and DefaultPolicy; removed set_parameter method |
| vessim/plot.py | Renamed plot_microgrid_trace to plot_result_df with enhanced multi-microgrid support |
| vessim/microgrid.py | Updated attribute names from p to power; added docstrings |
| vessim/environment.py | Refactored controller initialization to use global controller approach |
| vessim/controller.py | Complete refactor: split Monitor into MemoryLogger and CsvLogger; changed Api initialization |
| vessim/actor.py | Renamed p() method to power(); removed SilActor class |
| vessim/_util.py | Added flatten_dict utility function |
| vessim/_data.py | Added type ignore comments for pandas compatibility |
| vessim/_broker.py | Enhanced API endpoints; improved error handling for prometheus dependencies |
| vessim/init.py | Updated exports to reflect renamed classes |
| tests/* | Added comprehensive new tests for multiple components |
| examples/* | New example files for tutorials |
| docs/* | Migrated from Sphinx to MkDocs with new tutorial content |
| pyproject.toml | Updated dependencies and documentation tooling |
| mkdocs.yml | New MkDocs configuration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ```python | ||
| # Enable the API controller | ||
| # export_prometheus=True enables a /metrics endpoint for Prometheus scraping | ||
| environment.add_controller(vs.Api(export_prometheus=True, broker_port=8700)) |
There was a problem hiding this comment.
The example usage of vs.Api here starts the REST API broker with default settings, which in the current implementation binds FastAPI on 0.0.0.0 without any authentication or authorization. When this is run on a host reachable from other machines, any network client can query microgrid state and send control commands (e.g., changing storage or policy parameters) without restriction. You should restrict exposure of the API (e.g., bind only to localhost or place it behind authenticated/authorized access) and document these requirements so users do not accidentally deploy an unauthenticated control plane on a shared network.
Merging development branch for release 0.13.0 into main.