Skip to content

Conversation

@guimarqu
Copy link
Member

Summary

  • Replace ugly conditional logic with clean multiple dispatch for scalar constraint registration
  • Scalar constraints now stored directly as ConstraintRef instead of containers requiring [()]

Example

# Before (ugly):
reform_model[:constraint_name][()]

# After (clean):  
reform_model[:constraint_name]

Changes

  • Added _register_constraint_object! methods with proper multiple dispatch
  • Updated all tests to use clean access pattern
  • Removed all TODO comments about ugly constraint access
  • Added comprehensive test for scalar constraint functionality

Replace ugly conditional logic with clean multiple dispatch pattern.
Scalar constraints are now stored directly as ConstraintRef instead of
requiring container access with [()].

- Add _register_constraint_object! methods for scalar vs indexed constraints
- Update tests to use clean access pattern
- Remove TODO comments about ugly access
- Add comprehensive test for scalar constraint clean access
@guimarqu guimarqu merged commit e188a07 into main Aug 25, 2025
1 check passed
@guimarqu guimarqu deleted the bugfix/register_single_constraint branch August 25, 2025 16:47
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