Skip to content

Comments

0.13.0#246

Merged
birnbaum merged 30 commits intomainfrom
0.13.0
Jan 9, 2026
Merged

0.13.0#246
birnbaum merged 30 commits intomainfrom
0.13.0

Conversation

@birnbaum
Copy link
Collaborator

@birnbaum birnbaum commented Jan 8, 2026

Merging development branch for release 0.13.0 into main.

# Conflicts:
#	docs/experimental_tutorials/pybamm_example.ipynb
#	docs/experimental_tutorials/stranger_sims_example.ipynb
@birnbaum birnbaum requested a review from Copilot January 8, 2026 23:53
@birnbaum birnbaum merged commit 5d66f3b into main Jan 9, 2026
9 of 10 checks passed
@birnbaum birnbaum deleted the 0.13.0 branch January 9, 2026 00:02
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 MicrogridPolicyPolicy, DefaultMicrogridPolicyDefaultPolicy, MonitorMemoryLogger, and introduced CsvLogger
  • 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 the set_parameters attribute 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))
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant