Skip to content

fix: reject invalid dispatch inputs - #2

Merged
chenyi6758-source merged 2 commits into
chenyi6758-source:mainfrom
Cyrus-chip:fix/dispatch-input-validation
Oct 13, 2026
Merged

chenyi6758-source merged 2 commits into
chenyi6758-source:mainfrom
Cyrus-chip:fix/dispatch-input-validation

Conversation

@Cyrus-chip

Copy link
Copy Markdown

Summary

  • reject multidimensional, empty, NaN, and infinite PV/load profiles
  • reject non-positive or non-finite battery capacity and timestep values
  • reject non-finite initial SOC fractions
  • add regression tests and document the input contract

Why

Dispatch silently accepted several invalid inputs that could produce misleading energy balances or runtime errors. The validation is limited to the public input boundary and does not change valid dispatch behavior.

Validation

  • uv run --python 3.11 --extra test pytest -q — 35 passed
  • python3 -m compileall -q src tests examples
  • git diff --check

@chenyi6758-source
chenyi6758-source merged commit 9088020 into chenyi6758-source:main Oct 13, 2026
2 checks passed
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.

2 participants