Skip to content

Commit 339511f

Browse files
committed
Remove trailing whitespace in scripts, run JuliaFormatter
1 parent fa0a565 commit 339511f

File tree

3 files changed

+36
-22
lines changed

3 files changed

+36
-22
lines changed

ci/bench-icount.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ iai_home="iai-home"
77
# Download the baseline from master
88
./ci/ci-util.py locate-baseline --download --extract
99

10-
# Run benchmarks once
10+
# Run benchmarks once
1111
function run_icount_benchmarks() {
1212
cargo_args=(
1313
"--bench" "icount"

ci/run.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ if [ "$nextest" = "1" ]; then
9090
echo "dir = \"$CARGO_TARGET_DIR/nextest\"" >> "$cfg_file"
9191
cfg_flag="--config-file $cfg_file"
9292
fi
93-
93+
9494
cmd="cargo nextest run ${cfg_flag:-} --max-fail=10 $flags"
9595
profile="--cargo-profile"
9696
fi
@@ -111,7 +111,7 @@ $cmd --features unstable-intrinsics --benches
111111

112112
# Test the same in release mode, which also increases coverage. Also ensure
113113
# the soft float routines are checked.
114-
$cmd "$profile" release-checked
114+
$cmd "$profile" release-checked
115115
$cmd "$profile" release-checked --features force-soft-floats
116116
$cmd "$profile" release-checked --features unstable-intrinsics
117117
$cmd "$profile" release-checked --features unstable-intrinsics --benches

crates/libm-test/examples/plot_file.jl

+33-19
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ using CairoMakie
1313
using TOML
1414

1515
function main()::Nothing
16-
CairoMakie.activate!(px_per_unit=10)
16+
CairoMakie.activate!(px_per_unit = 10)
1717
config_path = ARGS[1]
1818

1919
cfg = Dict()
@@ -75,15 +75,25 @@ function plot_one(
7575
gen_x = map((v) -> parse(Float32, v), inputs)
7676

7777
do_plot(
78-
fig, gen_x, func, xlims[1], xlims[2],
78+
fig,
79+
gen_x,
80+
func,
81+
xlims[1],
82+
xlims[2],
7983
"$fn_name $gen_name (linear scale)",
80-
lin_out_file, false,
84+
lin_out_file,
85+
false,
8186
)
8287

8388
do_plot(
84-
fig, gen_x, func, xlims_log[1], xlims_log[2],
89+
fig,
90+
gen_x,
91+
func,
92+
xlims_log[1],
93+
xlims_log[2],
8594
"$fn_name $gen_name (log scale)",
86-
log_out_file, true,
95+
log_out_file,
96+
true,
8797
)
8898
end
8999

@@ -97,7 +107,7 @@ function do_plot(
97107
title::String,
98108
out_file::String,
99109
logscale::Bool,
100-
)::Nothing where F<:AbstractFloat
110+
)::Nothing where {F<:AbstractFloat}
101111
println("plotting $title")
102112

103113
# `gen_x` is the values the generator produces. `actual_x` is for plotting a
@@ -116,32 +126,36 @@ function do_plot(
116126
actual_x = LinRange(input_min, input_max, steps)
117127
xscale = identity
118128
end
119-
129+
120130
gen_y = @. func(gen_x)
121131
actual_y = @. func(actual_x)
122132

123-
ax = Axis(fig[1, 1], xscale=xscale, title=title)
133+
ax = Axis(fig[1, 1], xscale = xscale, title = title)
124134

125135
lines!(
126-
ax, actual_x, actual_y, color=(:lightblue, 0.6),
127-
linewidth=6.0, label="true function",
136+
ax,
137+
actual_x,
138+
actual_y,
139+
color = (:lightblue, 0.6),
140+
linewidth = 6.0,
141+
label = "true function",
128142
)
129143
scatter!(
130-
ax, gen_x, gen_y, color=(:darkblue, 0.9),
131-
markersize=markersize, label="checked inputs",
144+
ax,
145+
gen_x,
146+
gen_y,
147+
color = (:darkblue, 0.9),
148+
markersize = markersize,
149+
label = "checked inputs",
132150
)
133-
axislegend(ax, position=:rb, framevisible=false)
151+
axislegend(ax, position = :rb, framevisible = false)
134152

135153
save(out_file, fig)
136154
delete!(ax)
137155
end
138156

139157
"Apply a function, returning the default if there is a domain error"
140-
function map_or(
141-
input::AbstractFloat,
142-
f::Function,
143-
default::Any
144-
)::Union{AbstractFloat,Any}
158+
function map_or(input::AbstractFloat, f::Function, default::Any)::Union{AbstractFloat,Any}
145159
try
146160
return f(input)
147161
catch
@@ -151,7 +165,7 @@ end
151165

152166
# Operations for logarithms that are symmetric about 0
153167
C = 10
154-
symlog10(x::Number) = sign(x) * (log10(1 + abs(x)/(10^C)))
168+
symlog10(x::Number) = sign(x) * (log10(1 + abs(x) / (10^C)))
155169
sympow10(x::Number) = (10^C) * (10^x - 1)
156170

157171
main()

0 commit comments

Comments
 (0)