File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 1
1
# -*- coding: utf-8 -*-
2
2
3
+ import collections
4
+
3
5
import numpy as np
4
6
from skopt import Optimizer
5
- from collections import OrderedDict
6
7
7
8
from adaptive .learner .base_learner import BaseLearner
8
9
from adaptive .notebook_integration import ensure_holoviews
@@ -27,11 +28,11 @@ class SKOptLearner(Optimizer, BaseLearner):
27
28
def __init__ (self , function , ** kwargs ):
28
29
self .function = function
29
30
self .pending_points = set ()
30
- self .data = OrderedDict ()
31
+ self .data = collections . OrderedDict ()
31
32
super ().__init__ (** kwargs )
32
33
33
34
def tell (self , x , y , fit = True ):
34
- if hasattr (x , "__iter__" ):
35
+ if isinstance (x , collections . abc . Iterable ):
35
36
self .pending_points .discard (tuple (x ))
36
37
self .data [tuple (x )] = y
37
38
super ().tell (x , y , fit )
You can’t perform that action at this time.
0 commit comments