Skip to content

Commit b2f4c10

Browse files
committed
update
1 parent 0ad6896 commit b2f4c10

File tree

16 files changed

+38
-40
lines changed

16 files changed

+38
-40
lines changed

GraphRecipes/src/graph_layouts.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ shell_graph(
171171

172172
# for _ in 1:maxiter
173173
# x̃ = x
174-
# b̃ = Float64[sum(Float64[(i==j || adjmat[i,j] == 0) ? 0.0 : ((x̃[j] <= x̃[i] ? 1.0 : -1.0) / adjmat[i,j]) for j=1:n]) for i=1:n]
174+
# b̃ = Float64[sum(Float64[(i==j || adjmat[i,j] == 0) ? 0.0 : ((x̃[j] x̃[i] ? 1.0 : -1.0) / adjmat[i,j]) for j=1:n]) for i=1:n]
175175
# @show x̃ b̃
176176
# x = L \ b̃
177177

@@ -433,7 +433,7 @@ end
433433

434434
function shift_children!(layers, alist, placed, parent)
435435
for idx in alist[parent]
436-
if !(idx in placed) && layers[idx] <= layers[parent]
436+
if !(idx in placed) && layers[idx] layers[parent]
437437
layers[idx] = layers[parent] + 1
438438
end
439439
end

GraphRecipes/src/graphs.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ more details.
346346
trim = false,
347347
)
348348
# Process the args so that they are a Graphs.Graph.
349-
if length(g.args) <= 1 &&
349+
if length(g.args) 1 &&
350350
!(eltype(g.args[1]) <: AbstractArray) &&
351351
!(g.args[1] isa Graphs.AbstractGraph) &&
352352
method != :chorddiagram &&

GraphRecipes/src/utils.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function directed_curve(
2525
miny, maxy = extrema(yview)
2626
dist = sqrt((x2 - x1)^2 + (y2 - y1)^2)
2727
flip = root in (:top, :right)
28-
need_loop = (flip && y1 <= y2) || (!flip && y1 >= y2)
28+
need_loop = (flip && y1 y2) || (!flip && y1 y2)
2929

3030
# these points give the initial/final "rise"
3131
# note: this is a function of distance between points and axis scale
@@ -113,7 +113,7 @@ function nearest_intersection(xs, ys, xd, yd, vec_xy_d)
113113
t .= (A + eps() * I) \ [xs - xvec[1]; ys - yvec[1]]
114114
xy_d_edge .=
115115
[(1 - t[2]) * xvec[1] + t[2] * xvec[2], (1 - t[2]) * yvec[1] + t[2] * yvec[2]]
116-
if 0 <= t[2] <= 1
116+
if 0 t[2] 1
117117
tmp = abs2(xy_d_edge[1] - xs) + abs2(xy_d_edge[2] - ys)
118118
if tmp < nearest
119119
ret .= xy_d_edge
@@ -304,7 +304,7 @@ end
304304

305305
# x and y limits for arc diagram ()
306306
function arcdiagram_limits(x, source, destiny)
307-
@assert length(x) >= 2
307+
@assert length(x) 2
308308
margin = abs(0.1 * (x[2] - x[1]))
309309
xmin, xmax = extrema(x)
310310
r = abs(0.5 * (xmax - xmin))

PlotsBase/ext/PGFPlotsXExt.jl

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1556,15 +1556,13 @@ end
15561556
# display calls this and then _display, its called 3 times for plot(1:5)
15571557
# Set the (left, top, right, bottom) minimum padding around the plot area
15581558
# to fit ticks, tick labels, guides, colorbars, etc.
1559-
function PlotsBase._update_min_padding!(sp::Subplot{PGFPlotsXBackend})
1560-
return sp.minpad =
1561-
if (leg = sp[:legend_position]) in
1562-
(:best, :outertopright, :outerright, :outerbottomright) ||
1563-
(leg isa Tuple && leg[1] >= 1)
1564-
(0mm, 0mm, 5mm, 0mm)
1565-
else
1566-
(0mm, 0mm, 0mm, 0mm)
1567-
end
1559+
PlotsBase._update_min_padding!(sp::Subplot{PGFPlotsXBackend}) = sp.minpad =
1560+
if (leg = sp[:legend_position]) in
1561+
(:best, :outertopright, :outerright, :outerbottomright) ||
1562+
(leg isa Tuple && leg[1] 1)
1563+
(0mm, 0mm, 5mm, 0mm)
1564+
else
1565+
(0mm, 0mm, 0mm, 0mm)
15681566
end
15691567

15701568
PlotsBase._create_backend_figure(plt::Plot{PGFPlotsXBackend}) = plt.o = PGFPlotsXPlot()

PlotsBase/src/Colorbars.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,19 @@ function update_clims(sp::Subplot, op = process_clims(sp[:clims]))::Tuple{Float6
3232
for series in series_list(sp)
3333
if series[:colorbar_entry]::Bool
3434
# Avoid calling the inner `update_clims` if at all possible; dynamic dispatch hell
35-
if (series[:seriestype] Commons._z_colored_series && series[:z] nothing) ||
35+
zmin, zmax = if (series[:seriestype] Commons._z_colored_series && series[:z] nothing) ||
3636
series[:line_z] nothing ||
3737
series[:marker_z] nothing ||
3838
series[:fill_z] nothing
39-
zmin, zmax = _update_clims(zmin, zmax, update_clims(series, op)...)
39+
_update_clims(zmin, zmax, update_clims(series, op)...)
4040
else
41-
zmin, zmax = _update_clims(zmin, zmax, NaN, NaN)
41+
_update_clims(zmin, zmax, NaN, NaN)
4242
end
4343
else
4444
update_clims(series, op)
4545
end
4646
end
47-
return sp[:clims_calculated] = zmin <= zmax ? (zmin, zmax) : (NaN, NaN)
47+
return sp[:clims_calculated] = zmin zmax ? (zmin, zmax) : (NaN, NaN)
4848
end
4949

5050
function update_clims(
@@ -62,7 +62,7 @@ function update_clims(
6262
isnan(zmin) && isnan(old_zmin) && isnan(zmax) && isnan(old_zmax) ||
6363
zmin == old_zmin && zmax == old_zmax ||
6464
update_clims(sp)
65-
return zmin <= zmax ? (zmin, zmax) : (NaN, NaN)
65+
return zmin zmax ? (zmin, zmax) : (NaN, NaN)
6666
end
6767

6868
"""
@@ -87,7 +87,7 @@ function update_clims(series::Series, op = ignorenan_extrema)::Tuple{Float64, Fl
8787
if series[:fill_z] nothing
8888
zmin, zmax = update_clims(zmin, zmax, series[:fill_z], op)
8989
end
90-
return series[:clims_calculated] = zmin <= zmax ? (zmin, zmax) : (NaN, NaN)
90+
return series[:clims_calculated] = zmin zmax ? (zmin, zmax) : (NaN, NaN)
9191
end
9292

9393
update_clims(zmin, zmax, vals::Surfaces.AbstractSurface, op)::Tuple{Float64, Float64} =
@@ -133,7 +133,7 @@ function get_colorbar_ticks(sp::Subplot; update = true, formatter = sp[:colorbar
133133
clims = get_clims(sp)
134134
scale = sp[:colorbar_scale]
135135
sp.attr[:colorbar_optimized_ticks] =
136-
get_ticks(ticks, cvals, dvals, clims, scale, formatter)
136+
Commons.get_ticks(ticks, cvals, dvals, clims, scale, formatter)
137137
end
138138
return sp.attr[:colorbar_optimized_ticks]
139139
end

PlotsBase/src/Commons/attrs.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1071,7 +1071,7 @@ function check_contour_levels(levels)
10711071
"the levels keyword argument must be an integer or AbstractVector" |>
10721072
ArgumentError |>
10731073
throw
1074-
elseif levels isa Integer && levels <= 0
1074+
elseif levels isa Integer && levels 0
10751075
"must pass a positive number of contours to the levels keyword argument" |>
10761076
ArgumentError |>
10771077
throw

PlotsBase/src/DF.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function df_helper(d, x)
5454
Expr(:call, :($(@__MODULE__).extract_columns_and_names), d, syms...),
5555
)
5656
argnames = _argnames(names, x)
57-
if (length(plot_call.args) >= 2) &&
57+
if (length(plot_call.args) 2) &&
5858
isa(plot_call.args[2], Expr) &&
5959
(plot_call.args[2].head :parameters)
6060
label_plot_call = Expr(

PlotsBase/src/DataSeries.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ function series_segments(series::Series, seriestype::Symbol = :path; check = fal
264264
(scale = get(series, scales[n], :identity)) PlotsBase.Commons._log_scales ||
265265
continue
266266
for (i, v) in enumerate(s)
267-
if v <= 0
267+
if v 0
268268
@warn "Invalid negative or zero value $v found at series index $i for $scale based $(scales[n])"
269269
@debug "" exception = (DomainError(v), stacktrace())
270270
break

PlotsBase/src/animation.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ function _animate(forloop::Expr, args...; type::Symbol = :none)
214214
n = length(args)
215215
i = 1
216216
# create filter and read parameters
217-
while i <= n
217+
while i n
218218
arg = args[i]
219219
if arg in (:when, :every)
220220
# specification of frame filter

PlotsBase/src/layouts.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ function recompute_lengths(v)
8181
end
8282
end
8383
leftover = 1.0pct - tot
84-
if cnt > 1 && leftover.value <= 0
84+
if cnt > 1 && leftover.value 0
8585
error(
8686
"Not enough length left over in layout! v = $v, cnt = $cnt, leftover = $leftover",
8787
)

0 commit comments

Comments
 (0)