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

Remove mocks from MBM surrogate tests #3255

Closed
wants to merge 2 commits into from

Conversation

esantorella
Copy link
Contributor

Summary:

  • In test_fit_model_reuse, test_fit_multiple_model_configs, test_fit_model_selection_metric_to_model_configs_multiple_metrics, test_predict, remove mocks or use them with wraps, and use mock_botorch_optimize where not already used.

In test_best_in_sample_point:

  • Make data and TorchOptConfig work with 2 outcomes, as they previously did not.
  • Once I did that, the test was failing because there were no points inside the search space, so I added a case where they all are and a case where one is.

Reviewed By: saitcakmak

Differential Revision: D68333000

Summary:
* Use of TypeVars: A `TypeVar` indicates that multiple objects (e.g. an argument and a return type) are the same type. Using `TypeVar`s with functions that work with either numpy arrays or torch tensors indicates that either everything is a numpy array or everything is a tensor. Otherwise, Pyre has no idea whether arrays might be randomly turning into tensors and vice versa.
* Added more detailed comments on tensor shapes
* Used `Sequence` instead of `list`

Reviewed By: saitcakmak

Differential Revision: D68332888
Summary:
* In `test_fit_model_reuse`, `test_fit_multiple_model_configs`, `test_fit_model_selection_metric_to_model_configs_multiple_metrics`, `test_predict`, remove mocks or use them with `wraps`, and use `mock_botorch_optimize` where not already used.

In `test_best_in_sample_point`:
* Make data and TorchOptConfig work with 2 outcomes, as they previously did not.
* Once I did that, the test was failing because there were no points inside the search space, so I added a case where they all are and a case where one is.

Reviewed By: saitcakmak

Differential Revision: D68333000
@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Jan 21, 2025
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D68333000

esantorella added a commit to esantorella/Ax that referenced this pull request Jan 21, 2025
Summary:

* In `test_fit_model_reuse`, `test_fit_multiple_model_configs`, `test_fit_model_selection_metric_to_model_configs_multiple_metrics`, `test_predict`, remove mocks or use them with `wraps`, and use `mock_botorch_optimize` where not already used.

In `test_best_in_sample_point`:
* Make data and TorchOptConfig work with 2 outcomes, as they previously did not.
* Once I did that, the test was failing because there were no points inside the search space, so I added a case where they all are and a case where one is.

Reviewed By: saitcakmak

Differential Revision: D68333000
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 97.67442% with 1 line in your changes missing coverage. Please review.

Project coverage is 95.88%. Comparing base (cd23abf) to head (19c95a5).

Files with missing lines Patch % Lines
ax/models/torch/tests/test_surrogate.py 97.14% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3255   +/-   ##
=======================================
  Coverage   95.87%   95.88%           
=======================================
  Files         513      513           
  Lines       51710    51729   +19     
=======================================
+ Hits        49579    49598   +19     
  Misses       2131     2131           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 74149da.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity. fb-exported Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants