Skip to content

Reject NaN values in numeric inputs#493

Merged
MaxGhenis merged 1 commit into
masterfrom
fix/reject-nan-set-input
May 17, 2026
Merged

Reject NaN values in numeric inputs#493
MaxGhenis merged 1 commit into
masterfrom
fix/reject-nan-set-input

Conversation

@MaxGhenis
Copy link
Copy Markdown
Contributor

Summary

  • reject NaN values passed through simulation.set_input / holder input paths for numeric variables
  • keep internal cache writes free of the new validation so calculated values are not newly blocked
  • validate built-in period dispatch/divide input helper paths and add regressions for float and int inputs

Fixes #389.

TDD / verification

  • Confirmed the new NaN regressions failed before the implementation.
  • uv run --no-sync pytest tests/core/test_holders.py -q
  • uv run --no-sync ruff check policyengine_core/holders/holder.py policyengine_core/holders/helpers.py tests/core/test_holders.py
  • uv run --no-sync ruff format --check policyengine_core/holders/holder.py policyengine_core/holders/helpers.py tests/core/test_holders.py

Review

  • Read-only subagent review requested before merge.

@MaxGhenis MaxGhenis force-pushed the fix/reject-nan-set-input branch from dff3be6 to 72c6aaf Compare May 17, 2026 12:53
@MaxGhenis MaxGhenis merged commit 434c26b into master May 17, 2026
23 checks passed
@MaxGhenis MaxGhenis deleted the fix/reject-nan-set-input branch May 17, 2026 12:58
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.

Raise error when arrays with NaNs are passed to simulation.set_input

1 participant