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 11# -*- coding: utf-8 -*-
22
3+ import collections
4+
35import numpy as np
46from skopt import Optimizer
5- from collections import OrderedDict
67
78from adaptive .learner .base_learner import BaseLearner
89from adaptive .notebook_integration import ensure_holoviews
@@ -27,11 +28,11 @@ class SKOptLearner(Optimizer, BaseLearner):
2728 def __init__ (self , function , ** kwargs ):
2829 self .function = function
2930 self .pending_points = set ()
30- self .data = OrderedDict ()
31+ self .data = collections . OrderedDict ()
3132 super ().__init__ (** kwargs )
3233
3334 def tell (self , x , y , fit = True ):
34- if hasattr (x , "__iter__" ):
35+ if isinstance (x , collections . abc . Iterable ):
3536 self .pending_points .discard (tuple (x ))
3637 self .data [tuple (x )] = y
3738 super ().tell (x , y , fit )
You can’t perform that action at this time.
0 commit comments