-
Notifications
You must be signed in to change notification settings - Fork 10
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
Refactor Tests #91
Merged
merajhashemi
merged 105 commits into
gallego-posada/1.0.0-alpha
from
merajhashemi/refactor-tests
Jul 8, 2024
Merged
Refactor Tests #91
Changes from 99 commits
Commits
Show all changes
105 commits
Select commit
Hold shift + click to select a range
4aee1d6
Implement new `SquaredNormLinearCMP` for tests
merajhashemi efbbe85
Refactor old convergence tests to use new cmp
merajhashemi becceaa
Fix augmented lagrangian convergence test
merajhashemi c49f65d
Fix line break style
merajhashemi 4485eb1
Remove hardcoded constants
merajhashemi a5f8b53
Rename variables
merajhashemi ff8c2d3
Add observed constraint feature size as parameter
merajhashemi 3cfbab1
Randomize convergence test
merajhashemi 8a5add0
Fix type hint
merajhashemi 7f9cdcf
Add cvxpy to requirements
merajhashemi c740a30
Fix randomized convergence test
merajhashemi 570d38c
Fix stochasticity in noise
merajhashemi 89a9e3e
Add optimality check for cvxpy
merajhashemi 8808a0f
Add check to skip overconstrained settings
merajhashemi eb501d8
Add manual tests
merajhashemi e76b085
Fix tests augmented lagrangian
merajhashemi 437244f
Fix manual indexed multiplier tests
merajhashemi d0fa38d
Fix manual surrogate tests
merajhashemi e359825
Add manual test for equality constraints
merajhashemi 6ecc2a2
Remove unused test util functions
merajhashemi da26c90
Move common fixtures to conftest.py
merajhashemi 0af638f
Fix checkpoint test
merajhashemi 6cc912e
Add test for cmp state_dict
merajhashemi 8dcedb8
Remove `Toy2dCMP`
merajhashemi 2600dc9
Remove unused utils for tests
merajhashemi d2a0549
Add tests for multiple primal optimizers
merajhashemi 29b3cdd
Move fixtures from utils to conftest
merajhashemi 13d679a
Fix tests for multiple primal optimizers
merajhashemi 01c2528
Skip convergence test for equality constraint
merajhashemi ef299f3
Add convergence test for no constraints
merajhashemi c7796c6
Fix convergence test for surrogate
merajhashemi a028e68
Fix manual test for surrogate
merajhashemi 1c78b70
Adjust hyperparameters for convergence test
merajhashemi 4db784f
Fix tests for multiple primal optimizers
merajhashemi 650b906
Updates to tests
juan43ramirez 11c5de4
pipeline test updates
juan43ramirez 3422f86
Revert "pipeline test updates"
merajhashemi 60189da
(Fix tests on GPU): Ensure CPU and GPU create consistent tensors
merajhashemi 97ebd1d
Fix style
merajhashemi 3b7c7b1
Add expected failure test for formulation
merajhashemi 756d6fb
Revert "Fix style"
merajhashemi 4ba95ad
Remove extra line
merajhashemi e2e69f3
(Fix test setup): Generate random full-rank matrices with uniform sin…
merajhashemi 9aec4b8
Simplify primal_lr selection for new tests
merajhashemi 2ccb572
Fix primal_lr for Adam
merajhashemi b5a8a2e
Add docstring
merajhashemi 23fe34f
Fix comment
merajhashemi c808461
Parameterize surrogate constraint noise magnitude
merajhashemi e1c891c
Add type hints
merajhashemi f2f57c7
Remove unnecessary function
merajhashemi 765573e
Add comment
merajhashemi 4e97452
Remove unnecessary imports
merajhashemi 89e8c4c
Add docstring
merajhashemi 1ee2e2e
Rename fixture
merajhashemi af4444a
Fix checkpoint test with multiple primal optimizers
merajhashemi 62a4c48
Add docstring
merajhashemi 442a2db
Improve code readability
merajhashemi 53b2837
Tighter tolerance for manual tests
merajhashemi c9acfaa
Add seed fixture to create different tests
merajhashemi 6397a50
Improve code readability
merajhashemi f2439a6
Rename variables for clarity
merajhashemi 295ccdc
Rename variables for clarity
merajhashemi 99c3015
Split tests in separate files
merajhashemi f21e504
Refactor setup steps in separate fixtures
merajhashemi f43734d
Move test to separate module
merajhashemi ee40cd7
Refactor setup steps in separate fixtures
merajhashemi e8d4155
Move fixtures to conftest module
merajhashemi 435de8f
Move manual test module
merajhashemi 22f6cd8
Fix code repetition
merajhashemi f9515dc
Add helper function for extracting constraint features from cmpstate
merajhashemi 98cb04a
Use fixtures
merajhashemi 728bea3
Add tests for `LagrangianStore`
merajhashemi 670747b
Remove importlib for python 3.7 and older
merajhashemi 94c6ca0
Add functional tests for cmp module
merajhashemi 8e87eed
Remove unnecessary line
merajhashemi a5e31a7
Refactor conftest fixtures
merajhashemi be99380
Fix init for scalar penalty coefficient
merajhashemi 7e1f9ea
Add functional tests for penalty coefficient updater
merajhashemi e5871ff
Remove unnecessary line when required positional argument isn't provided
merajhashemi 180ba62
Add tests for multipliers
merajhashemi 37fad6f
Add tests for penalty coefficients
merajhashemi bc32603
Add tests for constraint
merajhashemi da51c05
Add tests for constraint_state
merajhashemi 5571335
Refactor move test_formulation
merajhashemi 1efd124
Fix type hints
merajhashemi 27ffc3a
Fix style
merajhashemi 8e08adf
Fix penalty coefficient for scalar
merajhashemi dd16cb4
Add formulation_utils test
merajhashemi 1b973fd
Ensure tensors are on same device
merajhashemi 91ab48b
Improve multiplier & penalty coefficients design
merajhashemi 6503e7a
Fix device check in test
merajhashemi 5018079
Add more tests for formulation_utils
merajhashemi 3ccbf46
Add more tests for multipliers
merajhashemi 2028262
Add more tests for penalty coefficients
merajhashemi d87e133
Add more tests for constraint_state
merajhashemi a08a46e
Add more tests for formulations
merajhashemi d695156
Add tests for cmp
merajhashemi c552070
Fix typo
merajhashemi 874ec27
Add tests for optimizers
merajhashemi ca94269
Undo change to ensure_sequence util function
merajhashemi 1264ad3
Remove unused variable
merajhashemi 488edc3
Rename fixture
merajhashemi 2df71d1
Fix typo
merajhashemi 1074ba2
Replace repetition with loop
merajhashemi 3ee14f9
Remove code repetition for penalty coefficient sanity_check
merajhashemi 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 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 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 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 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 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 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 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 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 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 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 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 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 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently this has code repetition with
Constraint.sanity_check_penalty_coefficient
. Let's merge the two.Create a helper function for this in the
Formulation
calledsanity_check_penalty_coefficient
and call it here. Moreover, replace the check inConstraint
with aself.formulation.sanity_check_penalty_coefficient
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 3ee14f9