File tree 1 file changed +10
-0
lines changed
1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 1
1
import sys
2
+ import time
2
3
import warnings
3
4
from copy import copy
4
5
5
6
from adaptive .learner .base_learner import BaseLearner
6
7
8
+ from adaptive_scheduler .utils import _print_same_line
9
+
7
10
inf = sys .float_info .max
8
11
9
12
@@ -23,6 +26,13 @@ def ensure_hashable(x):
23
26
24
27
class SequenceLearner (BaseLearner ):
25
28
def __init__ (self , function , sequence ):
29
+ warnings .warn ("Use `adaptive.SequenceLearner` from adaptive>=0.9!" )
30
+ print (
31
+ "I am going to sleep for 10 seconds to annoy you into updating your code!"
32
+ )
33
+ for i in range (10 , - 1 , - 1 ):
34
+ _print_same_line (f"Sleeping for { i } seconds more" , new_line_end = (i == 0 ))
35
+ time .sleep (1 )
26
36
self .function = function
27
37
self ._to_do_seq = {ensure_hashable (x ) for x in sequence }
28
38
self ._npoints = len (sequence )
You can’t perform that action at this time.
0 commit comments