Skip to content

Commit

Permalink
Makes TikzPictures.jl a requirement for using export_performance_prof…
Browse files Browse the repository at this point in the history
…ile_tikz
  • Loading branch information
d-monnet committed Nov 3, 2023
1 parent e639a63 commit 840b779
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ LaTeXStrings = "^1.3"
NaNMath = "0.3, 1"
Requires = "1"
Tables = "1.11"
TikzPictures = "3.5"
julia = "^1.6"

[extras]
PGFPlotsX = "8314cec4-20b6-5062-9cdb-752b83310925"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
TikzPictures = "37f6aa50-8035-52d0-81c2-5a1d08754b2d"
UnicodePlots = "b8865327-cd53-5732-bb35-84acbb429228"

[targets]
test = ["PGFPlotsX", "Plots", "Test", "UnicodePlots"]
test = ["PGFPlotsX", "Plots", "Test", "TikzPictures", "UnicodePlots"]
5 changes: 4 additions & 1 deletion src/BenchmarkProfiles.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@ for backend ∈ bp_backends
end
end

@eval begin
export_performance_profile_tikz(args...;kwargs...) = error("Please load TikzPictures.jl package to access this function.")
end

include("performance_profiles.jl")
include("data_profiles.jl")
include("tikz_export.jl")

"""
Replace each number by 2^{number} in a string.
Expand Down
4 changes: 4 additions & 0 deletions src/requires.jl
Original file line number Diff line number Diff line change
Expand Up @@ -181,4 +181,8 @@ function __init__()
return profile
end
end

@require TikzPictures = "37f6aa50-8035-52d0-81c2-5a1d08754b2d" begin
include("tikz_export.jl")
end
end
6 changes: 1 addition & 5 deletions src/tikz_export.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
using TikzPictures

export export_performance_profile_tikz

"""
function export_performance_profile_tikz(T, filename; kwargs...)
Export tikz figure of the performance profiles given by `T` in `filename`.
Export tikz-generated figure of the performance profiles given by `T` in `filename`.
## Arguments
Expand Down
8 changes: 4 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,16 @@ if !Sys.isfreebsd() # GR_jll not available, so Plots won't install
@testset "tikz export" begin
T = 10 * rand(25, 3)
filename = "tikz_fig"
export_performance_profile_tikz(T, filename)
BenchmarkProfiles.export_performance_profile_tikz(T, filename)
@test isfile(filename * ".tikz")
rm(filename * ".tikz")
export_performance_profile_tikz(T, filename, file_type = TEX)
BenchmarkProfiles.export_performance_profile_tikz(T, filename, file_type = TEX)
@test isfile(filename * ".tex")
rm(filename * ".tex")
export_performance_profile_tikz(T, filename, file_type = SVG)
BenchmarkProfiles.export_performance_profile_tikz(T, filename, file_type = SVG)
@test isfile(filename * ".svg")
rm(filename * ".svg")
export_performance_profile_tikz(T, filename, file_type = PDF)
BenchmarkProfiles.export_performance_profile_tikz(T, filename, file_type = PDF)
@test isfile(filename * ".pdf")
rm(filename * ".pdf")
end
Expand Down

0 comments on commit 840b779

Please sign in to comment.