-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: exceptions * fix: rename exceptions -> exception * fix tests * docs: add reference/exception.rst
- Loading branch information
1 parent
9a315ed
commit 04670dd
Showing
8 changed files
with
47 additions
and
19 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
"""This module contains custom exceptions for Bayesian Optimization.""" | ||
|
||
from __future__ import annotations | ||
|
||
__all__ = [ | ||
"BayesianOptimizationError", | ||
"NotUniqueError", | ||
"ConstraintNotSupportedError", | ||
"NoValidPointRegisteredError", | ||
"TargetSpaceEmptyError", | ||
] | ||
|
||
|
||
class BayesianOptimizationError(Exception): | ||
"""Base class for exceptions in the Bayesian Optimization.""" | ||
|
||
|
||
class NotUniqueError(BayesianOptimizationError): | ||
"""A point is non-unique.""" | ||
|
||
|
||
class ConstraintNotSupportedError(BayesianOptimizationError): | ||
"""Raised when constrained optimization is not supported.""" | ||
|
||
|
||
class NoValidPointRegisteredError(BayesianOptimizationError): | ||
"""Raised when an acquisition function depends on previous points but none are registered.""" | ||
|
||
|
||
class TargetSpaceEmptyError(BayesianOptimizationError): | ||
"""Raised when the target space is empty.""" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
:py:mod:`bayes_opt.exception` | ||
------------------------------- | ||
|
||
.. automodule:: bayes_opt.exception | ||
:members: |
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