feat(scenarios): add canonical TOML scenario presets and schema-driven dynamics#74
feat(scenarios): add canonical TOML scenario presets and schema-driven dynamics#74
Conversation
baseline/ high_solar/dr_event presents
|
Docs preview was removed because this PR is closed. |
There was a problem hiding this comment.
Pull request overview
This PR adds canonical scenario presets in TOML format (stored under ./scenarios/) and extends the scenario config schema so simulations can vary solar generation and demand-response (DR) behavior via config, with CLI + runner support and an integration test to validate distinct dynamics.
Changes:
- Add TOML scenario parsing/loading (with basic schema validation +
./scenariosfallback resolution) and extendScenarioConfigwith solar/DR parameters. - Update the simulation runner to consume the new solar/DR fields instead of hardcoded constants.
- Add built-in TOML presets and a CLI-based integration test that asserts presets produce different KPI outcomes.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/scenario_presets_integration.rs | New integration test that runs the CLI against preset TOML scenarios and parses KPI output. |
| src/scenario.rs | Adds TOML support, path resolution fallback, new schema fields, and validation logic. |
| src/runner.rs | Uses scenario-configured solar peak and DR window/reduction. |
| src/main.rs | Switches scenario loading from JSON-only to from_path (TOML/JSON). |
| src/cli.rs | Updates --scenario help/error text to reflect scenario files (TOML recommended). |
| scenarios/baseline.toml | Adds baseline preset with default-like solar + DR parameters. |
| scenarios/high_solar.toml | Adds high-solar preset with higher PV peak and adjusted DR reduction. |
| scenarios/dr_event.toml | Adds DR-event preset with earlier/stronger DR window. |
| README.md | Documents TOML scenario format, presets, schema keys, and CLI examples. |
| Cargo.toml | Adds toml dependency. |
| Cargo.lock | Lockfile updates for the new TOML dependency graph. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 11 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This PR introduces pre-configured scenario presets with a canonical TOML schema and measurable behavior differences.
Changes
./scenarios/:baseline.tomlhigh_solar.tomldr_event.tomlsolar_kw_peak_per_housedr_start_stepdr_end_stepdr_reduction_kw_per_houseCloses #23