Skip to content

Commit 68500f1

Browse files
committed
Merge remote-tracking branch 'origin/stable-0.7'
2 parents 28497d9 + 98607da commit 68500f1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

adaptive/learner/learner2D.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,12 @@ def plot(self, n=None, tri_alpha=0):
543543
n = int(0.658 / sqrt(areas(ip).min()))
544544
n = max(n, 10)
545545

546-
x = y = np.linspace(-0.5, 0.5, n)
546+
# The bounds of the linspace should be (-0.5, 0.5) but because of
547+
# numerical precision problems it could (for example) be
548+
# (-0.5000000000000001, 0.49999999999999983), then any point at exact
549+
# boundary would be outside of the domain. See #181.
550+
eps = 1e-13
551+
x = y = np.linspace(-0.5 + eps, 0.5 - eps, n)
547552
z = ip(x[:, None], y[None, :] * self.aspect_ratio).squeeze()
548553

549554
if self.vdim > 1:

0 commit comments

Comments
 (0)