Skip to content

Commit

Permalink
refactor: fix jet error
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesCranmer committed Nov 9, 2024
1 parent 94ec463 commit 22c4657
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions ext/SymbolicRegressionRecipesBaseExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 4 additions & 3 deletions src/Logging.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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...)
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 22c4657

Please sign in to comment.