Skip to content

Commit

Permalink
run julia formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
isentropic committed Jan 18, 2024
1 parent 0561a5b commit b81e977
Show file tree
Hide file tree
Showing 14 changed files with 31 additions and 24 deletions.
13 changes: 9 additions & 4 deletions benchmark/benchmarks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ using Plots
const SUITE = BenchmarkGroup()
julia_cmd = split(get(ENV, "TESTCMD", unsafe_string(Base.JLOptions().julia_bin)))

SUITE["load_plot_display"] = @benchmarkable run(`$julia_cmd --startup-file=no --project=$(Base.active_project()) -e 'using Plots; display(plot(1:0.1:10, sin))'`)
SUITE["load"] = @benchmarkable run(`$julia_cmd --startup-file=no --project=$(Base.active_project()) -e 'using Plots'`)
SUITE["plot"] = @benchmarkable p = plot(1:0.1:10, sin) samples=1 evals=1
SUITE["display"] = @benchmarkable display(p) setup=(p = plot(1:0.1:10, sin)) samples=1 evals=1
SUITE["load_plot_display"] = @benchmarkable run(
`$julia_cmd --startup-file=no --project=$(Base.active_project()) -e 'using Plots; display(plot(1:0.1:10, sin))'`,
)
SUITE["load"] = @benchmarkable run(
`$julia_cmd --startup-file=no --project=$(Base.active_project()) -e 'using Plots'`,
)
SUITE["plot"] = @benchmarkable p = plot(1:0.1:10, sin) samples = 1 evals = 1
SUITE["display"] =
@benchmarkable display(p) setup = (p = plot(1:0.1:10, sin)) samples = 1 evals = 1
1 change: 0 additions & 1 deletion ext/PlotsGRExt/initialization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ function __init__()
Plots._backendSymbol[GRBackend] = sym
Plots._backend_packages[sym] = Symbol(package_str)


push!(Plots._initialized_backends, sym)
end
# Make GR know to Plots
Expand Down
2 changes: 0 additions & 2 deletions ext/PlotsPGFPlotsXExt/initialization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ function __init__()
Plots._backendSymbol[T] = sym
Plots._backend_packages[sym] = Symbol(package_str)


push!(Plots._initialized_backends, sym)

# Additional setup required by the backend:
Expand All @@ -26,7 +25,6 @@ end
Plots.backend_name(::T) = sym
Plots.backend_package_name(::T) = Plots.backend_package_name(sym)


const _pgfplotsx_attr = Plots.merge_with_base_supported([
:annotations,
:annotationrotation,
Expand Down
1 change: 0 additions & 1 deletion ext/PlotsUnicodePlotsExt/initialization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ function __init__()
Plots._backendSymbol[T] = sym
Plots._backend_packages[sym] = Symbol(package_str)


push!(Plots._initialized_backends, sym)
end
# Make unicodeplots know to Plots
Expand Down
8 changes: 6 additions & 2 deletions src/Colorbars.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module Colorbars

export colorbar_style, get_clims, update_clims, hascolorbar, get_colorbar_ticks, _update_subplot_colorbars
export colorbar_style,
get_clims, update_clims, hascolorbar, get_colorbar_ticks, _update_subplot_colorbars
using Plots.Commons: Commons, NaNMath, ignorenan_extrema
using Plots.PlotsSeries
using Plots.Subplots: Subplot, series_list
Expand All @@ -26,7 +27,10 @@ function update_clims(sp::Subplot, op = process_clims(sp[:clims]))::Tuple{Float6
for series in series_list(sp)
if series[:colorbar_entry]::Bool
# Avoid calling the inner `update_clims` if at all possible; dynamic dispatch hell
if (series[:seriestype] Commons._z_colored_series && series[:z] !== nothing) ||
if (
series[:seriestype] Commons._z_colored_series &&
series[:z] !== nothing
) ||
series[:line_z] !== nothing ||
series[:marker_z] !== nothing ||
series[:fill_z] !== nothing
Expand Down
1 change: 0 additions & 1 deletion src/Commons/postprocess_args.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,3 @@ end

# add all non_underscored forms to the _keyAliases
add_non_underscore_aliases!(_keyAliases)

1 change: 0 additions & 1 deletion src/Surfaces.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ using Plots.Axes: Axis
using RecipesPipeline: AbstractSurface, Surface
using Plots.Commons


function Plots.expand_extrema!(a::Axis, surf::Surface)
ex = a[:extrema]
foreach(x -> expand_extrema!(ex, x), surf.surf)
Expand Down
2 changes: 1 addition & 1 deletion src/alignment.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ function _update_min_padding!(sp::Subplot)
sp.minpad = (leftpad, toppad, rightpad, bottompad)
end

_update_plot_object(plt::Plot) = nothing
_update_plot_object(plt::Plot) = nothing
1 change: 0 additions & 1 deletion src/axes_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -551,4 +551,3 @@ function axis_drawing_info_3d(sp, letter)
border_segments = border_segments,
)
end

1 change: 1 addition & 0 deletions src/consts.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

3 changes: 2 additions & 1 deletion src/examples.jl
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ const _examples = PlotExample[
PlotExample( # 13
"Marker types",
quote
markers = filter(m -> m in Plots.supported_markers(), Plots.Commons._shape_keys)
markers =
filter(m -> m in Plots.supported_markers(), Plots.Commons._shape_keys)
markers = permutedims(markers)
n = length(markers)
x = range(0, stop = 10, length = n + 2)[2:(end - 1)]
Expand Down
12 changes: 8 additions & 4 deletions src/legend.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ legend_angle(leg::Symbol) = get(
(45, :inner),
)

Commons._initial_sp_fontsizes[:legend_font_pointsize] = _subplot_defaults[:legend_font_pointsize]
Commons._initial_sp_fontsizes[:legend_title_font_pointsize] = _subplot_defaults[:legend_title_font_pointsize]
Commons._initial_fontsizes[:legend_font_pointsize] = _subplot_defaults[:legend_font_pointsize]
Commons._initial_fontsizes[:legend_title_font_pointsize] = _subplot_defaults[:legend_title_font_pointsize]
Commons._initial_sp_fontsizes[:legend_font_pointsize] =
_subplot_defaults[:legend_font_pointsize]
Commons._initial_sp_fontsizes[:legend_title_font_pointsize] =
_subplot_defaults[:legend_title_font_pointsize]
Commons._initial_fontsizes[:legend_font_pointsize] =
_subplot_defaults[:legend_font_pointsize]
Commons._initial_fontsizes[:legend_title_font_pointsize] =
_subplot_defaults[:legend_title_font_pointsize]
2 changes: 1 addition & 1 deletion src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -987,4 +987,4 @@ function extrema_plus_buffer(v, buffmult = 0.2)
vdiff = vmax - vmin
buffer = vdiff * buffmult
vmin - buffer, vmax + buffer
end
end
7 changes: 3 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@ using Gtk # see JuliaPlots/VisualRegressionTests.jl/issues/30
const TEST_BACKENDS = let
var = get(ENV, "PLOTS_TEST_BACKENDS", nothing)
if var !== nothing
Symbol.(lowercase.(
strip.(split(var, ","))
))
Symbol.(lowercase.(strip.(split(var, ","))))
else
( :gr,
(
:gr,
:unicodeplots,
# :pythonplot,
:pgfplotsx,
Expand Down

0 comments on commit b81e977

Please sign in to comment.