Conditions | 2 |
Total Lines | 21 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import copy |
||
79 | def test_callback_3(): |
||
80 | def callback_1(access): |
||
81 | access.pass_through["stuff1"] = 1 |
||
82 | |||
83 | def objective_function(access): |
||
84 | if access.nth_iter == 0: |
||
85 | assert access.pass_through["stuff1"] == 0 |
||
86 | else: |
||
87 | assert access.pass_through["stuff1"] == 1 |
||
88 | |||
89 | return 0 |
||
90 | |||
91 | hyper = Hyperactive() |
||
92 | hyper.add_search( |
||
93 | objective_function, |
||
94 | search_space, |
||
95 | n_iter=100, |
||
96 | callbacks={"after": [callback_1]}, |
||
97 | pass_through={"stuff1": 0}, |
||
98 | ) |
||
99 | hyper.run() |
||
100 |