| Conditions | 2 |
| Total Lines | 11 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | """Common functions used by multiple optimizers.""" |
||
| 6 | def _score_params(params, meta): |
||
| 7 | """Score parameters, used in parallelization.""" |
||
| 8 | meta = meta.copy() |
||
| 9 | experiment = meta["experiment"] |
||
| 10 | error_score = meta["error_score"] |
||
| 11 | |||
| 12 | try: |
||
| 13 | return experiment(**params) |
||
| 14 | except Exception: # noqa: B904 |
||
| 15 | # Catch all exceptions and assign error_score |
||
| 16 | return error_score |
||
| 17 |