Skip to content

Commit 30f8dfa

Browse files
committed
style and remove superfluous comment
1 parent 3e83b93 commit 30f8dfa

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

adaptive/learner/average_learner1D.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -379,17 +379,19 @@ def tell_many_at_point(self, x, ys):
379379
# If x is not a new point or if there were more than 1 sample in ys:
380380
if len(ys) > 0:
381381
self._data_samples[x].extend(ys)
382-
n = len(ys)+self._number_samples[x]
383-
# Same as n=len(self._data_samples[x]) but faster
384-
self.data[x] = (np.mean(ys)*len(ys) + self.data[x]*self._number_samples[x])/n
385-
# Same as self.data[x]=np.mean(self._data_samples[x]) but faster
382+
n = len(ys) + self._number_samples[x]
383+
self.data[x] = (
384+
np.mean(ys) * len(ys) + self.data[x] * self._number_samples[x]
385+
) / n
386386
self._number_samples[x] = n
387387
# `self._update_data(x, y, "new")` included the point
388388
# in _undersampled_points. We remove it if there are
389389
# more than min_samples samples, disregarding neighbor_sampling.
390390
if n > self.min_samples:
391391
self._undersampled_points.discard(x)
392-
self.error[x] = self._calc_error_in_mean(self._data_samples[x], self.data[x], n)
392+
self.error[x] = self._calc_error_in_mean(
393+
self._data_samples[x], self.data[x], n
394+
)
393395
self._update_distances(x)
394396
self._update_rescaled_error_in_mean(x, "resampled")
395397
if self.error[x] <= self.min_error or n >= self.max_samples:

0 commit comments

Comments
 (0)