We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fe1263f commit b0d336cCopy full SHA for b0d336c
1 file changed
adaptive/tests/test_learner1d.py
@@ -9,6 +9,15 @@
9
from adaptive.runner import BlockingRunner, simple
10
11
12
+def flat_middle(x):
13
+ x *= 1e7
14
+ xs = np.array([0.0, 0.1, 0.9, 1.0])
15
+ ys = [0, 1, 1, 0]
16
+ if x < xs[1] or x > xs[-2]:
17
+ time.sleep(1)
18
+ return np.interp(x, xs, ys)
19
+
20
21
def test_pending_loss_intervals():
22
# https://github.com/python-adaptive/adaptive/issues/40
23
learner = Learner1D(lambda x: x, (0, 4))
@@ -393,14 +402,6 @@ def f(x):
393
402
394
403
395
404
def test_inf_loss_with_missing_bounds():
396
- def flat_middle(x):
397
- x *= 1e7
398
- xs = np.array([0.0, 0.1, 0.9, 1.0])
399
- ys = [0, 1, 1, 0]
400
- if x < xs[1] or x > xs[-2]:
401
- time.sleep(1)
- return np.interp(x, xs, ys)
-
405
learner = Learner1D(
406
flat_middle,
407
bounds=(0, 1e-7),
0 commit comments