-
Notifications
You must be signed in to change notification settings - Fork 577
Add tests for trivial constraints in pyomo/contrib/solver #3703
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
Open
michaelbynum
wants to merge
28
commits into
Pyomo:main
Choose a base branch
from
michaelbynum:trivial_constraints
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
d16bee5
adding tests for trivial constraints and fixing bugs
michaelbynum 2001d15
Merge branch 'solver_api' into trivial_constraints
michaelbynum d25e721
run black
michaelbynum 02f383d
Merge branch 'solver_api' into trivial_constraints
michaelbynum 3d302a1
Merge branch 'solver_api' into trivial_constraints
michaelbynum ecd602d
Merge branch 'solver_api' into trivial_constraints
michaelbynum 92e77ba
merge solver_api into trivial_constraints
michaelbynum 045f537
merge main
michaelbynum 253bdd9
Merge branch 'solver_api' into trivial_constraints
michaelbynum c3ad9b5
Merge branch 'solver_api' into trivial_constraints
michaelbynum ef6dcf6
Merge branch 'solver_api' into trivial_constraints
michaelbynum fb38368
Merge branch 'solver_api' into trivial_constraints
michaelbynum 0365ae5
merge solver_api into trivial_constraints
michaelbynum 7293c29
Merge branch 'solver_api' into trivial_constraints
michaelbynum 75fee85
Merge branch 'solver_api' into trivial_constraints
michaelbynum 29a72f7
Merge branch 'solver_api' into trivial_constraints
michaelbynum c216e19
Merge branch 'solver_api' into trivial_constraints
michaelbynum b754a29
merge main
michaelbynum ae7d2d9
run black
michaelbynum 87a0f75
Merge remote-tracking branch 'origin/main' into trivial_constraints
michaelbynum d0c0515
remove redundant code and propagate error messages
michaelbynum bf6f6fd
fix highs interface
michaelbynum a1ed8e0
better handling of trivially feasible and infeasible constraints
michaelbynum 29b9bf3
run black
michaelbynum eb7abb6
better handling of trivially infeasible constraints
michaelbynum c987a9f
run black
michaelbynum fe00fdd
better handling of trivially infeasible constraints
michaelbynum 0c54635
remove unused line
michaelbynum File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,7 @@ | |
| from pyomo.core.base.var import VarData | ||
| from pyomo.core.staleflag import StaleFlagManager | ||
| from pyomo.core.base.suffix import Suffix | ||
| from .util import NoSolutionError | ||
|
|
||
|
|
||
| def load_import_suffixes( | ||
|
|
@@ -187,6 +188,43 @@ def load_import_suffixes(self, solution_id=None): | |
| return NotImplemented | ||
|
|
||
|
|
||
| class NoSolutionSolutionLoader(SolutionLoaderBase): | ||
| def __init__(self) -> None: | ||
| pass | ||
|
|
||
| def get_solution_ids(self) -> List[Any]: | ||
| return [] | ||
|
|
||
| def get_number_of_solutions(self) -> int: | ||
| return 0 | ||
|
|
||
| def load_solution(self, solution_id=None): | ||
| raise NoSolutionError() | ||
|
|
||
| def load_vars( | ||
| self, vars_to_load: Sequence[VarData] | None = None, solution_id=None | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't we use Optional here? |
||
| ) -> None: | ||
| raise NoSolutionError() | ||
|
|
||
| def get_vars( | ||
| self, vars_to_load: Sequence[VarData] | None = None, solution_id=None | ||
| ) -> Mapping[VarData, float]: | ||
| raise NoSolutionError() | ||
|
|
||
| def get_duals( | ||
| self, cons_to_load: Sequence[ConstraintData] | None = None, solution_id=None | ||
| ) -> Dict[ConstraintData, float]: | ||
| raise NoSolutionError() | ||
|
|
||
| def get_reduced_costs( | ||
| self, vars_to_load: Sequence[VarData] | None = None, solution_id=None | ||
| ) -> Mapping[VarData, float]: | ||
| raise NoSolutionError() | ||
|
|
||
| def load_import_suffixes(self, solution_id=None): | ||
| raise NoSolutionError() | ||
|
|
||
|
|
||
| class PersistentSolutionLoader(SolutionLoaderBase): | ||
| """ | ||
| Loader for persistent solvers | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.