save_early_exit#
- JSONLogger.save_early_exit(reason: str = 'Unknown') None#
Save partial optimization history to disk with
early_exitflag.Called when an optimization run crashes or is terminated before
on_optimization_endfires. The data collected so far (which may be empty if the crash happened at the very first evaluation) is written to a sidecar file whose name ends in_eexit_history.jsonso that normal_history.jsonlog-collection logic ignores it, while it remains available for post-hoc inspection.Multiple early exits in the same session are auto-numbered (
_0001,_0002, …) so they don’t overwrite one another.- Parameters:
- reason
str Human-readable description of why the run exited early (typically the string form of the exception that was caught).
- reason