on_optimization_end#

JSONLogger.on_optimization_end(success: bool, final_fom: float, final_params: ndarray, num_iterations: int, **kwargs) None#

Flush the in-memory history to disk as a JSON document.

I/O errors are caught and logged via the module logger; they cannot bring down the surrounding optimization.

Parameters:
successbool

Whether optimization succeeded.

final_fomfloat

Final FOM value.

final_paramsnp.ndarray

Final parameter values (currently captured in param_history[-1] rather than as a separate top-level key).

num_iterationsint

Number of iterations completed.

**kwargs

Additional information. initial_fom (if provided) is used to compute and persist the absolute and relative improvement.