-
Notifications
You must be signed in to change notification settings - Fork 391
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 test function test utils #1839
Conversation
This pull request was exported from Phabricator. Differential Revision: D45969036 |
Summary: Pull Request resolved: pytorch#1839 Refactors the test utils for botorch test functions to make things more modular. Instead of subclassing the base test cases, we now have class Mixins for synthetic, constrained, and multi-objective problems. This means we can mix-and-match the test case as needed. This also flattens the `TestMultiObjectiveProblems` and `TestConstrainedMultiObjectiveProblems` test collections (the idea behind the test design is that we have separate test cases for each problem (potentially with different arguments) to better identify and group the tests, so this reestablishes that. Differential Revision: D45969036 fbshipit-source-id: 227662f7914eba3e461a604b6ace592cc9fca227
1d5afd0
to
006c400
Compare
This pull request was exported from Phabricator. Differential Revision: D45969036 |
Summary: Pull Request resolved: pytorch#1839 Refactors the test utils for botorch test functions to make things more modular. Instead of subclassing the base test cases, we now have class Mixins for synthetic, constrained, and multi-objective problems. This means we can mix-and-match the test case as needed. This also flattens the `TestMultiObjectiveProblems` and `TestConstrainedMultiObjectiveProblems` test collections (the idea behind the test design is that we have separate test cases for each problem (potentially with different arguments) to better identify and group the tests, so this reestablishes that. Differential Revision: D45969036 fbshipit-source-id: 2b3c00813185b93bfd55874f34b330ed7280d52b
006c400
to
5f7a444
Compare
This pull request was exported from Phabricator. Differential Revision: D45969036 |
Codecov Report
@@ Coverage Diff @@
## main #1839 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 170 170
Lines 14937 14939 +2
=========================================
+ Hits 14937 14939 +2
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
botorch/utils/testing.py
Outdated
@@ -93,7 +93,7 @@ def assertAllClose( | |||
) | |||
|
|||
|
|||
class BaseTestProblemBaseTestCase: | |||
class BaseTestProblemTestCaseMixIn: | |||
|
|||
functions: List[BaseTestProblem] |
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.
functions: List[BaseTestProblem] | |
functions: Sequence[BaseTestProblem] = [] |
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.
The refactoring makes a lot of sense, thanks! See comments.
Summary: Pull Request resolved: pytorch#1839 Refactors the test utils for botorch test functions to make things more modular. Instead of subclassing the base test cases, we now have class Mixins for synthetic, constrained, and multi-objective problems. This means we can mix-and-match the test case as needed. This also flattens the `TestMultiObjectiveProblems` and `TestConstrainedMultiObjectiveProblems` test collections (the idea behind the test design is that we have separate test cases for each problem (potentially with different arguments) to better identify and group the tests, so this reestablishes that. Reviewed By: esantorella Differential Revision: D45969036 fbshipit-source-id: 7e9ec80ed93bab55e857761dd462545de44ceca9
5f7a444
to
7d79d52
Compare
This pull request was exported from Phabricator. Differential Revision: D45969036 |
Summary: Pull Request resolved: pytorch#1839 Refactors the test utils for botorch test functions to make things more modular. Instead of subclassing the base test cases, we now have class Mixins for synthetic, constrained, and multi-objective problems. This means we can mix-and-match the test case as needed. This also flattens the `TestMultiObjectiveProblems` and `TestConstrainedMultiObjectiveProblems` test collections (the idea behind the test design is that we have separate test cases for each problem (potentially with different arguments) to better identify and group the tests, so this reestablishes that. Reviewed By: esantorella Differential Revision: D45969036 fbshipit-source-id: dbb694536aff9c844fc7060f115aedfbb16a2575
7d79d52
to
e20b24c
Compare
This pull request was exported from Phabricator. Differential Revision: D45969036 |
This pull request has been merged in 98b4194. |
Summary:
Refactors the test utils for botorch test functions to make things more modular.
Instead of subclassing the base test cases, we now have class Mixins for synthetic, constrained, and multi-objective problems. This means we can mix-and-match the test case as needed.
Further,
BaseTestProblemTestCase
now subclassesBotorchTestCase
so that we don't need to subclass fromBotorchTestCase
separately for every test.Finally, this flattens the
TestMultiObjectiveProblems
andTestConstrainedMultiObjectiveProblems
test collections (the idea behind the test design is that we have separate test cases for each problem (potentially with different arguments) to better identify and group the tests, so this reestablishes that.Differential Revision: D45969036