Skip to content

feat(types): add an optional invalid value hook - #1361

Merged
MilesCranmer merged 4 commits into
astroautomata:masterfrom
MilesCranmerBot:invalid-value-hook-bot
Sep 10, 2026
Merged

MilesCranmer merged 4 commits into
astroautomata:masterfrom
MilesCranmerBot:invalid-value-hook-bot

Conversation

@MilesCranmerBot

@MilesCranmerBot MilesCranmerBot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Add optional TypeSpec(init_invalid="() -> value") to define DynamicExpressions.invalid_value(T). The result must have the generated type and fail is_valid. Types without invalid states can omit the hook.

Require SymbolicRegression ~2.4.1, which requires DynamicExpressions ~2.11 and supplies this API transitively. Existing positional TypeSpec arguments retain their positions.

Verification

  • Ordinary registry resolution selected DynamicExpressions 2.11.0 and SymbolicRegression 2.4.1, without local source overrides.
  • Both renamed hook tests and two rejection subtests passed, including fit/predict.
  • A failed convenience evaluation used init_invalid; the old invalid keyword was rejected.
  • Pre-commit checks passed.

MilesCranmerBot and others added 2 commits September 10, 2026 18:20
Co-authored-by: Miles Cranmer <miles.cranmer@gmail.com>
Co-authored-by: Miles Cranmer <miles.cranmer@gmail.com>
@MilesCranmerBot
MilesCranmerBot marked this pull request as ready for review September 10, 2026 17:33
MilesCranmerBot and others added 2 commits September 10, 2026 18:45
Co-authored-by: Miles Cranmer <miles.cranmer@gmail.com>
Co-authored-by: Miles Cranmer <miles.cranmer@gmail.com>
@codecov

codecov Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@MilesCranmer
MilesCranmer merged commit f3420e8 into astroautomata:master Sep 10, 2026
25 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.

3 participants