Skip to content

Commit bb9013c

Browse files
committed
add 'pending_points' to the 'SKOptLearner'
This was the only learner that didn't have this attribute.
1 parent c65c10c commit bb9013c

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

adaptive/learner/skopt_learner.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,17 @@ class SKOptLearner(Optimizer, BaseLearner):
2424

2525
def __init__(self, function, **kwargs):
2626
self.function = function
27+
self.pending_points = set()
2728
super().__init__(**kwargs)
2829

29-
def tell(self, x, y, fit=True):
30+
def tell(self, x, y, fit=True):
31+
self.pending_points.discard(x)
3032
super().tell([x], y, fit)
3133

3234
def tell_pending(self, x):
3335
# 'skopt.Optimizer' takes care of points we
3436
# have not got results for.
35-
pass
37+
self.pending_points.add(x)
3638

3739
def remove_unfinished(self):
3840
pass
@@ -97,3 +99,10 @@ def plot(self, nsamples=200):
9799
plot_bounds = (bounds[0] - margin, bounds[1] + margin)
98100

99101
return p.redim(x=dict(range=plot_bounds))
102+
103+
def _get_data(self):
104+
return [x[0] for x in self.Xi], self.yi
105+
106+
def _set_data(self, data):
107+
xs, ys = data
108+
self.tell_many(xs, ys)

0 commit comments

Comments
 (0)