File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change 9
9
from adaptive .runner import BlockingRunner , simple
10
10
11
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
+
12
21
def test_pending_loss_intervals ():
13
22
# https://github.com/python-adaptive/adaptive/issues/40
14
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 )
402
- return np .interp (x , xs , ys )
403
-
404
405
learner = Learner1D (
405
406
flat_middle ,
406
407
bounds = (0 , 1e-7 ),
You can’t perform that action at this time.
0 commit comments