From b95806be00a2c368576f8601af75ff21f89c7477 Mon Sep 17 00:00:00 2001 From: arnavk23 Date: Thu, 21 May 2026 15:22:05 +0530 Subject: [PATCH 1/2] changing example due to failure --- .../introduction-to-solverbenchmark/index.jmd | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/tutorials/introduction-to-solverbenchmark/index.jmd b/tutorials/introduction-to-solverbenchmark/index.jmd index 09ef6b5..c51433f 100644 --- a/tutorials/introduction-to-solverbenchmark/index.jmd +++ b/tutorials/introduction-to-solverbenchmark/index.jmd @@ -228,19 +228,12 @@ If a solver's `GenericExecutionStats` contains a `solver_specific` dictionary, t Here is an example showing how to set a solver-specific flag so that it appears as a column in the resulting stats table and can be used for tabulation: ```julia -using NLPModelsTest, DataFrames, SolverCore, SolverBenchmark +using ADNLPModels, SolverCore -function newton(nlp) - stats = GenericExecutionStats(nlp) - set_solver_specific!(stats, :isConvex, true) - return stats -end - -solvers = Dict(:newton => newton) -problems = [NLPModelsTest.BROWNDEN()] -stats = bmark_solvers(solvers, problems) +nlp = ADNLPModel(x -> sum(x .^ 2), [1.0, 1.0]) +stats = GenericExecutionStats(nlp) +set_solver_specific!(stats, :isConvex, true) +set_solver_specific!(stats, :inner_iterations, 7) -# Access the solver-specific column `:isConvex` for the `:newton` solver -df_newton = stats[:newton] -df_newton.isConvex +stats.solver_specific ``` From 8a7891c17aa893946f6471dc5454741e01be2846 Mon Sep 17 00:00:00 2001 From: arnavk23 Date: Thu, 21 May 2026 15:38:01 +0530 Subject: [PATCH 2/2] adding copilot suggestions --- .../introduction-to-solverbenchmark/index.jmd | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/tutorials/introduction-to-solverbenchmark/index.jmd b/tutorials/introduction-to-solverbenchmark/index.jmd index c51433f..4ad5567 100644 --- a/tutorials/introduction-to-solverbenchmark/index.jmd +++ b/tutorials/introduction-to-solverbenchmark/index.jmd @@ -224,16 +224,22 @@ The tutorial covers how to use the problems from `OptimizationProblems` to run a ### Handling `solver_specific` in `stats` -If a solver's `GenericExecutionStats` contains a `solver_specific` dictionary, then when `bmark_solvers` processes the results it creates a column in the per-solver `DataFrame` for each key in that dictionary. These columns can then be analyzed and compared alongside the standard metrics such as `status` and `elapsed_time`. +If a solver's `GenericExecutionStats` contains a `solver_specific` dictionary, those values can be tabulated alongside the standard metrics such as `status` and `elapsed_time`. -Here is an example showing how to set a solver-specific flag so that it appears as a column in the resulting stats table and can be used for tabulation: +Here is an example showing how to populate `solver_specific` and place those fields in a stats table: ```julia -using ADNLPModels, SolverCore +using ADNLPModels, DataFrames, SolverCore nlp = ADNLPModel(x -> sum(x .^ 2), [1.0, 1.0]) -stats = GenericExecutionStats(nlp) -set_solver_specific!(stats, :isConvex, true) -set_solver_specific!(stats, :inner_iterations, 7) - -stats.solver_specific +stats = SolverCore.GenericExecutionStats(nlp) +SolverCore.set_solver_specific!(stats, :isConvex, true) +SolverCore.set_solver_specific!(stats, :inner_iterations, 7) + +df = DataFrame( + solver = ["newton"], + status = [stats.status], + isConvex = [stats.solver_specific[:isConvex]], + inner_iterations = [stats.solver_specific[:inner_iterations]], +) +pretty_stats(stdout, df) ```