| @@ 142-163 (lines=22) @@ | ||
| 139 | search_data["eval_times"] |
|
| 140 | ||
| 141 | ||
| 142 | def test_attributes_results_8(): |
|
| 143 | """Test search data without times parameter excludes iteration timing.""" |
|
| 144 | ||
| 145 | def objective_function(opt): |
|
| 146 | score = -opt["x1"] * opt["x1"] |
|
| 147 | return score |
|
| 148 | ||
| 149 | search_space = { |
|
| 150 | "x1": list(np.arange(0, 10, 1)), |
|
| 151 | } |
|
| 152 | ||
| 153 | hyper = Hyperactive() |
|
| 154 | hyper.add_search( |
|
| 155 | objective_function, |
|
| 156 | search_space, |
|
| 157 | n_iter=20, |
|
| 158 | ) |
|
| 159 | hyper.run() |
|
| 160 | ||
| 161 | search_data = hyper.search_data(objective_function) |
|
| 162 | with pytest.raises(Exception): |
|
| 163 | search_data["iter_times"] |
|
| 164 | ||
| 165 | ||
| 166 | def test_attributes_results_9(): |
|
| @@ 118-139 (lines=22) @@ | ||
| 115 | assert len(set(x1_results)) < len(x1_results) |
|
| 116 | ||
| 117 | ||
| 118 | def test_attributes_results_7(): |
|
| 119 | """Test search data without times parameter excludes timing columns.""" |
|
| 120 | ||
| 121 | def objective_function(opt): |
|
| 122 | score = -opt["x1"] * opt["x1"] |
|
| 123 | return score |
|
| 124 | ||
| 125 | search_space = { |
|
| 126 | "x1": list(np.arange(0, 10, 1)), |
|
| 127 | } |
|
| 128 | ||
| 129 | hyper = Hyperactive() |
|
| 130 | hyper.add_search( |
|
| 131 | objective_function, |
|
| 132 | search_space, |
|
| 133 | n_iter=20, |
|
| 134 | ) |
|
| 135 | hyper.run() |
|
| 136 | ||
| 137 | search_data = hyper.search_data(objective_function) |
|
| 138 | with pytest.raises(Exception): |
|
| 139 | search_data["eval_times"] |
|
| 140 | ||
| 141 | ||
| 142 | def test_attributes_results_8(): |
|