| Total Complexity | 1 |
| Total Lines | 31 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | import numpy as np |
||
| 2 | from hyperactive import Hyperactive |
||
| 3 | |||
| 4 | |||
| 5 | search_space = { |
||
| 6 | "x1": list(np.arange(0, 100, 1)), |
||
| 7 | } |
||
| 8 | |||
| 9 | |||
| 10 | def test_argument_0(): |
||
| 11 | def objective_function(para): |
||
| 12 | |||
| 13 | print("\npara.nth_iter", para.nth_iter) |
||
| 14 | print("nth_iter_local", para.pass_through["nth_iter_local"]) |
||
| 15 | |||
| 16 | assert para.nth_iter == para.pass_through["nth_iter_local"] |
||
| 17 | |||
| 18 | para.pass_through["nth_iter_local"] += 1 |
||
| 19 | |||
| 20 | return 0 |
||
| 21 | |||
| 22 | hyper = Hyperactive() |
||
| 23 | hyper.add_search( |
||
| 24 | objective_function, |
||
| 25 | search_space, |
||
| 26 | n_iter=100, |
||
| 27 | pass_through={"nth_iter_local": 0}, |
||
| 28 | memory=False, |
||
| 29 | ) |
||
| 30 | hyper.run() |
||
| 31 |