From 1569fecf8cf6dd2fd8206fbefa0bb947e72909a8 Mon Sep 17 00:00:00 2001
From: Bas Nijholt <basnijholt@gmail.com>
Date: Fri, 8 Sep 2017 14:14:37 +0200
Subject: [PATCH] 2D: add comment explaining why the interpolator can't return
 exact zeros

---
 adaptive/learner.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/adaptive/learner.py b/adaptive/learner.py
index 41cebf1a..57d53900 100644
--- a/adaptive/learner.py
+++ b/adaptive/learner.py
@@ -703,7 +703,9 @@ class Learner2D(BaseLearner):
                 ip_real = interpolate.LinearNDInterpolator(self.points_real,
                                                            self.values_real)
             else:
-                # It is important not to return exact zeros
+                # It is important not to return exact zeros because
+                # otherwise the algo will try to add the same point
+                # to the stack each time.
                 ip_real = lambda x: np.empty(len(x))
             n_interp = list(self._interp.values())
             values = ip_real(p[n_interp])
-- 
GitLab