| Conditions | 1 |
| Total Lines | 22 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | """Test module for objective function argument functionality.""" |
||
| 12 | def test_argument_0(): |
||
| 13 | """Test objective function arguments with pass_through parameter.""" |
||
| 14 | |||
| 15 | def objective_function(para): |
||
| 16 | print("\npara.nth_iter", para.nth_iter) |
||
| 17 | print("nth_iter_local", para.pass_through["nth_iter_local"]) |
||
| 18 | |||
| 19 | assert para.nth_iter == para.pass_through["nth_iter_local"] |
||
| 20 | |||
| 21 | para.pass_through["nth_iter_local"] += 1 |
||
| 22 | |||
| 23 | return 0 |
||
| 24 | |||
| 25 | hyper = Hyperactive() |
||
| 26 | hyper.add_search( |
||
| 27 | objective_function, |
||
| 28 | search_space, |
||
| 29 | n_iter=100, |
||
| 30 | pass_through={"nth_iter_local": 0}, |
||
| 31 | memory=False, |
||
| 32 | ) |
||
| 33 | hyper.run() |
||
| 34 |