Skip to content

Commit

Permalink
Merge pull request #406 from fmfn/fix_old_param_behavior
Browse files Browse the repository at this point in the history
change Deprecation warning to Error
  • Loading branch information
bwheelz36 authored Apr 25, 2023
2 parents cf13889 + 57ad6ef commit d2d35b6
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions bayes_opt/bayesian_optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,11 +285,10 @@ def maximize(self,

old_params_used = any([param is not None for param in [acq, kappa, kappa_decay, kappa_decay_delay, xi]])
if old_params_used or gp_params:
warnings.warn('\nPassing acquisition function parameters or gaussian process parameters to maximize'
'\nis no longer supported, and will cause an error in future releases. Instead,'
'\nplease use the "set_gp_params" method to set the gp params, and pass an instance'
'\n of bayes_opt.util.UtilityFunction using the acquisition_function argument\n',
DeprecationWarning, stacklevel=2)
raise Exception('\nPassing acquisition function parameters or gaussian process parameters to maximize'
'\nis no longer supported. Instead,please use the "set_gp_params" method to set'
'\n the gp params, and pass an instance of bayes_opt.util.UtilityFunction'
'\n using the acquisition_function argument\n')

if acquisition_function is None:
util = UtilityFunction(kind='ucb',
Expand Down

0 comments on commit d2d35b6

Please sign in to comment.