Passed
Push — master ( 5d3b63...4bbf89 )
by Simon
01:23
created

hyperactive.verbosity.info.Info.init_p_bar()   A

Complexity

Conditions 1

Size

Total Lines 2
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nop 3
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
# Author: Simon Blanke
2
# Email: [email protected]
3
# License: MIT License
4
5
6
class Info:
7
    def warm_start(self):
8
        pass
9
10
    def scatter_start(self):
11
        pass
12
13
    def random_start(self):
14
        pass
15
16
    def load_meta_data(self):
17
        pass
18
19
    def no_meta_data(self, model_func):
20
        pass
21
22
    def load_samples(self, para):
23
        pass
24
25
26
class InfoLVL0(Info):
27
    def __init__(self):
28
        pass
29
30
    def print_start_point(self, _cand_):
31
        return _cand_._get_warm_start()
32
33
34
class InfoLVL1(InfoLVL0):
35
    def __init__(self):
36
        pass
37
38
    def print_start_point(self, _cand_):
39
        start_point = _cand_._get_warm_start()
40
        print("best para =", start_point)
41
        print("score     =", _cand_.score_best, "\n")
42
43
        return start_point
44
45
    def warm_start(self):
46
        print("Set warm start")
47
48
    def scatter_start(self):
49
        print("Set scatter init")
50
51
    def random_start(self):
52
        print("Set random start position")
53
54
    def load_meta_data(self):
55
        print("Loading meta data successful", end="\r")
56
57
    def no_meta_data(self, model_func):
58
        print("No meta data found for", model_func.__name__, "function")
59
60
    def load_samples(self, para):
61
        print("Loading meta data successful:", len(para), "samples found")
62