Skip to content

Commit

Permalink
rename '_pending' to 'pending_points' in the 'LearnerND' for code hom…
Browse files Browse the repository at this point in the history
…ogeneity
  • Loading branch information
basnijholt committed Oct 12, 2018
1 parent 381cedb commit c65c10c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions adaptive/learner/learnerND.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def __init__(self, func, bounds, loss_per_simplex=None):
self.loss_per_simplex = loss_per_simplex or default_loss
self.bounds = tuple(tuple(map(float, b)) for b in bounds)
self.data = OrderedDict()
self._pending = set()
self.pending_points = set()

self._bounds_points = list(map(tuple, itertools.product(*bounds)))

Expand Down Expand Up @@ -247,7 +247,7 @@ def tell(self, point, value):
if value is None:
return self.tell_pending(point)

self._pending.discard(point)
self.pending_points.discard(point)
tri = self.tri
self.data[point] = value

Expand All @@ -274,7 +274,7 @@ def tell_pending(self, point, *, simplex=None):
if not self.inside_bounds(point):
return

self._pending.add(point)
self.pending_points.add(point)

if self.tri is None:
return
Expand Down Expand Up @@ -333,7 +333,7 @@ def ask(self, n, tell_pending=True):
def _ask_bound_point(self):
# get the next bound point that is still available
new_point = next(p for p in self._bounds_points
if p not in self.data and p not in self._pending)
if p not in self.data and p not in self.pending_points)
self.tell_pending(new_point)
return new_point, np.inf

Expand Down Expand Up @@ -394,7 +394,7 @@ def _ask_best_point(self):

@property
def _bounds_available(self):
return any((p not in self._pending and p not in self.data)
return any((p not in self.pending_points and p not in self.data)
for p in self._bounds_points)

def _ask(self):
Expand Down Expand Up @@ -459,7 +459,7 @@ def loss(self, real=True):

def remove_unfinished(self):
# XXX: implement this method
self._pending = set()
self.pending_points = set()
self._subtriangulations = dict()
self._pending_to_simplex = dict()

Expand Down

0 comments on commit c65c10c

Please sign in to comment.