diff --git a/ext/SymbolicRegressionRecipesBaseExt.jl b/ext/SymbolicRegressionRecipesBaseExt.jl index c0d83f48..d7f07459 100644 --- a/ext/SymbolicRegressionRecipesBaseExt.jl +++ b/ext/SymbolicRegressionRecipesBaseExt.jl @@ -7,9 +7,9 @@ using SymbolicRegression.HallOfFameModule: HallOfFame, format_hall_of_fame using SymbolicRegression.MLJInterfaceModule: SRFitResult, SRRegressor using SymbolicRegression.LoggingModule: convex_hull -import SymbolicRegression.LoggingModule: add_plot_to_log! +import SymbolicRegression.LoggingModule: make_plot -function add_plot_to_log!(; +function make_plot(; hall_of_fame::HallOfFame, @nospecialize(options::Options), variable_names ) plot_result = plot(hall_of_fame, options; variable_names=variable_names) diff --git a/src/Logging.jl b/src/Logging.jl index fefdda91..dee26823 100644 --- a/src/Logging.jl +++ b/src/Logging.jl @@ -65,8 +65,9 @@ function LG.with_logger(f::Function, logger::AbstractSRLogger) end # Will get method created by RecipesBase extension -function add_plot_to_log! end -@ignore add_plot_to_log!(; kws...) = nothing +function make_plot(; kws...) + return error("Please load `Plots` or another plotting package.") +end """ logging_callback!(logger::AbstractSRLogger; kws...) @@ -120,7 +121,7 @@ function log_payload( if should_log_plots out = merge( out, - add_plot_to_log!(; + make_plot(; hall_of_fame=state.halls_of_fame[i], options, variable_names=datasets[i].variable_names,