JuliaSmoothOptimizers / SolverBenchmark.jl

Benchmark tools for solvers
Other
23 stars 10 forks source link

markdown_table and latex_table are not working #165

Open amontoison opened 2 days ago

amontoison commented 2 days ago

The function pretty_latex_stats is working.

julia> open(path_md, "w") do io
         SolverBenchmark.markdown_table(io, df)
       end
ERROR: ArgumentError: column name "id" not found in the data frame; existing most similar names are: "ipm"
Stacktrace:
  [1] lookupname
    @ ~/.julia/packages/DataFrames/kcA9R/src/other/index.jl:434 [inlined]
  [2] getindex
    @ ~/.julia/packages/DataFrames/kcA9R/src/other/index.jl:440 [inlined]
  [3] getindex(df::DataFrame, ::typeof(!), col_ind::Symbol)
    @ DataFrames ~/.julia/packages/DataFrames/kcA9R/src/dataframe/dataframe.jl:557
  [4] getproperty(df::DataFrame, col_ind::Symbol)
    @ DataFrames ~/.julia/packages/DataFrames/kcA9R/src/abstractdataframe/abstractdataframe.jl:448
  [5] find_failure_ids(df::DataFrame)
    @ SolverBenchmark ~/.julia/packages/SolverBenchmark/ZnJii/src/highlighters.jl:5
  [6] passfail_highlighter (repeats 2 times)
    @ ~/.julia/packages/SolverBenchmark/ZnJii/src/highlighters.jl:25 [inlined]
  [7] markdown_table(io::IOStream, df::DataFrame)
    @ SolverBenchmark ~/.julia/packages/SolverBenchmark/ZnJii/src/markdown_tables.jl:41
  [8] (::var"#17#18")(io::IOStream)
    @ Main ./REPL[18]:2
  [9] open(::var"#17#18", ::String, ::Vararg{String}; kwargs::@Kwargs{})
    @ Base ./io.jl:396
 [10] open(::Function, ::String, ::String)
    @ Base ./io.jl:393
 [11] top-level scope
    @ REPL[18]:1
julia> open(path_tex, "w") do io
         SolverBenchmark.latex_table(io, df)
       end
ERROR: BoundsError: attempt to access Tuple{Vector{LaTeXStrings.LaTeXString}, Matrix{LaTeXStrings.LaTeXString}} at index [3]
Stacktrace:
 [1] indexed_iterate
   @ ./tuple.jl:92 [inlined]
 [2] latex_table(io::IOStream, df::DataFrame; kwargs::@Kwargs{})
   @ SolverBenchmark ~/.julia/packages/SolverBenchmark/ZnJii/src/latex_tables.jl:56
 [3] latex_table(io::IOStream, df::DataFrame)
   @ SolverBenchmark ~/.julia/packages/SolverBenchmark/ZnJii/src/latex_tables.jl:55
 [4] (::var"#19#20")(io::IOStream)
   @ Main ./REPL[19]:2
 [5] open(::var"#19#20", ::String, ::Vararg{String}; kwargs::@Kwargs{})
   @ Base ./io.jl:396
 [6] open(::Function, ::String, ::String)
   @ Base ./io.jl:393
 [7] top-level scope
   @ REPL[19]:1
tmigot commented 2 days ago

Isn't there a deprecated message for these two functions?

https://github.com/JuliaSmoothOptimizers/SolverBenchmark.jl/blob/73a394b420f125004b0fe862b0cf616221405065/src/markdown_tables.jl#L48

https://github.com/JuliaSmoothOptimizers/SolverBenchmark.jl/blob/73a394b420f125004b0fe862b0cf616221405065/src/latex_tables.jl#L63

The markdown_table actually assumes that you have a column status and id in your dataframe. We could implement something more robust here https://github.com/JuliaSmoothOptimizers/SolverBenchmark.jl/blob/73a394b420f125004b0fe862b0cf616221405065/src/highlighters.jl#L4

amontoison commented 2 days ago

No I didn't get any deprecated message. :( I propose to remove the docstring of these two functions from the documentation.