-
Notifications
You must be signed in to change notification settings - Fork 415
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
Export NumericsWarning and UserInputWarning from botorch.exceptions #2761
Conversation
Tagging @SebastianAment |
As an alternative, could you instead just write the following?
Not saying we shouldn't land this PR (seems fine), just curious if the above would work. |
@Balandat: Yeah, what you suggested works. I just found it odd that all but two of the warnings could be used via |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2761 +/- ##
=======================================
Coverage 99.99% 99.99%
=======================================
Files 203 203
Lines 18705 18705
=======================================
Hits 18704 18704
Misses 1 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Max Balandat <[email protected]>
@SebastianAment has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@SebastianAment merged this pull request in bba835c. |
Motivation
Using
botorch.acquisition.ExpectedImprovement
(instead of LogEI) now triggers abotorch.exceptions.warnings.NumericsWarning
. I'd like to be able to suppress this warning in cases that I actually intend to use EI instead of LogEI, such as when I am comparing the two.I'd like to be able to write the following:
However,
botorch.exceptions
does not exportNumericsWarning
as a symbol, so code editors (e.g., Visual Studio Code) complain that the symbolbotorch.exceptions.NumericsWarning
is not found. This pull request updatesbotorch/exceptions/__init__.py
to exportNumericsWarning
andUserInputWarning
, the only two warnings frombotorch/exceptions/warnings.py
that were previously unexported.Have you read the Contributing Guidelines on pull requests?
Yes.
Test Plan
N/A
Related PRs
I believe it may have been a simple oversight of commit 6892be9 (from pull request #2429) to add
NumericsWarning
to the list of exported symbols inbotorch/exceptions/__init__.py
.