(self, N=-1)
| 166 | trials.attachments["FMinIter_Domain"] = msg |
| 167 | |
| 168 | def serial_evaluate(self, N=-1): |
| 169 | for trial in self.trials._dynamic_trials: |
| 170 | if trial["state"] == base.JOB_STATE_NEW: |
| 171 | trial["state"] = base.JOB_STATE_RUNNING |
| 172 | now = coarse_utcnow() |
| 173 | trial["book_time"] = now |
| 174 | trial["refresh_time"] = now |
| 175 | spec = base.spec_from_misc(trial["misc"]) |
| 176 | ctrl = base.Ctrl(self.trials, current_trial=trial) |
| 177 | try: |
| 178 | result = self.domain.evaluate(spec, ctrl) |
| 179 | except Exception as e: |
| 180 | logger.error("job exception: %s" % str(e)) |
| 181 | trial["state"] = base.JOB_STATE_ERROR |
| 182 | trial["misc"]["error"] = (str(type(e)), str(e)) |
| 183 | trial["refresh_time"] = coarse_utcnow() |
| 184 | if not self.catch_eval_exceptions: |
| 185 | # -- JOB_STATE_ERROR means this trial |
| 186 | # will be removed from self.trials.trials |
| 187 | # by this refresh call. |
| 188 | self.trials.refresh() |
| 189 | raise |
| 190 | else: |
| 191 | trial["state"] = base.JOB_STATE_DONE |
| 192 | trial["result"] = result |
| 193 | trial["refresh_time"] = coarse_utcnow() |
| 194 | N -= 1 |
| 195 | if N == 0: |
| 196 | break |
| 197 | self.trials.refresh() |
| 198 | |
| 199 | @property |
| 200 | def is_cancelled(self): |
no test coverage detected