Skip to content

feat(gds-psuu): declarative parameter space constraints#115

Merged
rororowyourboat merged 1 commit intodevfrom
feat/psuu-constraints
Mar 5, 2026
Merged

feat(gds-psuu): declarative parameter space constraints#115
rororowyourboat merged 1 commit intodevfrom
feat/psuu-constraints

Conversation

@rororowyourboat
Copy link
Collaborator

Summary

  • Add Constraint ABC with LinearConstraint (sum of coefficients ≤ bound) and FunctionalConstraint (arbitrary predicate) implementations
  • ParameterSpace gains optional constraints tuple with construction-time validation of param name references
  • ParameterSpace.is_feasible(point) checks all constraints; grid_points() filters infeasible points
  • RandomSearchOptimizer uses rejection sampling (1000 retry limit) when constraints are present
  • GridSearchOptimizer inherits filtering via grid_points() — no code change needed

Test plan

  • 22 new tests covering all constraint types, validation, grid filtering, optimizer integration, edge cases
  • All 74 tests pass (51 existing + 22 new + 1 skipped)
  • 100% coverage on modified space.py and random.py
  • Backwards-compatible: constraints=() default, existing tests unchanged
  • Ruff lint + format clean

Closes #113

Add Constraint ABC with LinearConstraint and FunctionalConstraint
implementations. ParameterSpace now accepts an optional constraints
tuple, validates constraint param references at construction time,
and filters infeasible points from grid_points(). RandomSearchOptimizer
uses rejection sampling with a 1000-retry limit. 22 new tests.

Closes #113
@rororowyourboat rororowyourboat merged commit 4f2d43e into dev Mar 5, 2026
@rororowyourboat rororowyourboat deleted the feat/psuu-constraints branch March 5, 2026 09:52
@rororowyourboat rororowyourboat mentioned this pull request Mar 5, 2026
3 tasks
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.

feat(gds-psuu): parameter space constraints

1 participant