openevolve icon indicating copy to clipboard operation
openevolve copied to clipboard

It there any problems to return EvaluationResult object in evaluator?

Open xwqsl opened this issue 11 months ago • 1 comments

evaluator in examples such as function_minimization return EvaluationResult object, but the README in examples fold say "Return a dictionary, not EvaluationResult object" , it there any problems to return EvaluationResult object in evaluator?

xwqsl avatar Dec 10 '25 02:12 xwqsl

The actual code in openevolve/evaluator.py handles both formats:

def _process_evaluation_result(self, result: Any) -> EvaluationResult:
    if isinstance(result, dict):
        # Backward compatibility - wrap dict in EvaluationResult
        return EvaluationResult.from_dict(result)
    elif isinstance(result, EvaluationResult):
        return result

I will update the README to indicate that.

codelion avatar Dec 10 '25 02:12 codelion