| Conditions | 2 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | from ._result import Result |
||
| 11 | def _call_objective(self, pos): |
||
| 12 | """Run the underlying objective and normalise outputs.""" |
||
| 13 | params = self._conv.value2para(self._conv.position2value(pos)) |
||
| 14 | out = self._objective(params) |
||
| 15 | |||
| 16 | if isinstance(out, tuple): |
||
| 17 | score, metrics = out |
||
| 18 | else: |
||
| 19 | score, metrics = float(out), {} |
||
| 20 | |||
| 21 | result = Result(score, metrics) |
||
| 22 | |||
| 23 | return result, params |
||
| 24 | |||
| 28 |