Skip to content

Comments

feat(scenarios): add canonical TOML scenario presets and schema-driven dynamics#74

Merged
jdhoffa merged 3 commits intomainfrom
23-scenario_presets
Feb 20, 2026
Merged

feat(scenarios): add canonical TOML scenario presets and schema-driven dynamics#74
jdhoffa merged 3 commits intomainfrom
23-scenario_presets

Conversation

@jdhoffa
Copy link
Owner

@jdhoffa jdhoffa commented Feb 20, 2026

This PR introduces pre-configured scenario presets with a canonical TOML schema and measurable behavior differences.

Changes

  • Added canonical scenario format support (TOML) with schema validation
  • Added built-in presets under ./scenarios/:
    • baseline.toml
    • high_solar.toml
    • dr_event.toml
  • Extended scenario schema to control solar and DR dynamics:
    • solar_kw_peak_per_house
    • dr_start_step
    • dr_end_step
    • dr_reduction_kw_per_house
  • Updated simulation runner to consume those fields
  • CLI integration

Closes #23

baseline/ high_solar/dr_event presents
Copilot AI review requested due to automatic review settings February 20, 2026 13:17
@github-actions
Copy link
Contributor

github-actions bot commented Feb 20, 2026

Docs preview was removed because this PR is closed.

Copy link
Contributor

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 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 + ./scenarios fallback resolution) and extend ScenarioConfig with 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.

Copy link
Contributor

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

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>
@jdhoffa jdhoffa merged commit bd3b56c into main Feb 20, 2026
5 checks passed
@jdhoffa jdhoffa deleted the 23-scenario_presets branch February 20, 2026 13:35
github-actions bot added a commit that referenced this pull request Feb 20, 2026
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.

Add pre-configured scenario presets

1 participant