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 more mocks from MBM Surrogate tests #3256

Closed
wants to merge 3 commits into from

Conversation

esantorella
Copy link
Contributor

Summary: I'm hoping the code is self-explanatory. I reorganized test_fit to make it clearer.

Differential Revision: D68358008

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
Summary: I'm hoping the code is self-explanatory. I reorganized test_fit to make it clearer.

Differential Revision: D68358008
@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: D68358008

@codecov-commenter
Copy link

Codecov Report

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

Project coverage is 95.87%. Comparing base (cd23abf) to head (1d2e66a).

Files with missing lines Patch % Lines
ax/models/torch/tests/test_surrogate.py 98.43% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3256      +/-   ##
==========================================
- Coverage   95.87%   95.87%   -0.01%     
==========================================
  Files         513      513              
  Lines       51710    51701       -9     
==========================================
- Hits        49579    49570       -9     
  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 b2d01c1.

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