Skip to content

Commit 114aedc

Browse files
committed
implement dickish code to force people to update
1 parent 5c255dd commit 114aedc

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

adaptive_scheduler/sequence_learner.py

+10
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import sys
2+
import time
23
import warnings
34
from copy import copy
45

56
from adaptive.learner.base_learner import BaseLearner
67

8+
from adaptive_scheduler.utils import _print_same_line
9+
710
inf = sys.float_info.max
811

912

@@ -23,6 +26,13 @@ def ensure_hashable(x):
2326

2427
class SequenceLearner(BaseLearner):
2528
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)
2636
self.function = function
2737
self._to_do_seq = {ensure_hashable(x) for x in sequence}
2838
self._npoints = len(sequence)

0 commit comments

Comments
 (0)