Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Off the shelf Cooper #56

Merged
merged 4 commits into from
Nov 3, 2022
Merged

Conversation

juan43ramirez
Copy link
Collaborator

@juan43ramirez juan43ramirez commented Oct 26, 2022

Addresses #55

Changes

  • Passing a CMP when constructing a formulation is now optional
  • Constrained Optimizers no longer hold a self.cmp attribute
  • When no CMP is provided to the formulation, the user must provide pre_computed_state when calling formulation.composite_objective method of the formulation.
  • write_state parameter of formulation.composite_objective is a no-op when formulation.cmp is None

Testing

A toy test was implemented (tests/test_simplest_pipeline.py) without a CMP or closure. This considers inequality constraints (not proxy) and a SimultaneousConstrainedOptimizer.

Extrapolation and Alternating updates without a CMP are untested. Nonetheless, if a closure is provided to their step() method, they should work.

This is NOT breaking backwards compatibility. It is an alternative way for the user to use Cooper, but creating a CMP with a closure is still supported.

Docs

The changes in this PR have not been documented. Documentation is currently lagging behind code in dev branch (#53 #29).
I think that we could tackle all the issues with documentation in one go. For now, I propose to consider this PR without docs.

@juan43ramirez juan43ramirez marked this pull request as ready for review October 26, 2022 22:55
@juan43ramirez juan43ramirez changed the title Juan43ramirez/55 easy as possible to use Off the shelf Cooper Oct 28, 2022
Copy link
Collaborator

@gallego-posada gallego-posada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@juan43ramirez juan43ramirez merged commit 62e384b into dev Nov 3, 2022
@merajhashemi merajhashemi deleted the juan43ramirez/55-easy-as-possible-to-use branch July 25, 2024 15:39
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