Skip to content

Commit 5fc8eec

Browse files
Apply Runic.jl formatting
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ec9612e commit 5fc8eec

File tree

5 files changed

+31
-20
lines changed

5 files changed

+31
-20
lines changed

.github/scripts/compute_affected_sublibraries.jl

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ function compute_reverse_deps(graph::Dict{String, Vector{String}})
8484
for rdep in get(rev, pkg, Set{String}())
8585
get_all_rdeps!(visited, rdep)
8686
end
87+
return
8788
end
8889

8990
transitive = Dict{String, Set{String}}()
@@ -110,9 +111,11 @@ function load_test_groups(lib_dir::String, pkg::String)
110111
return DEFAULT_TEST_GROUPS
111112
end
112113

113-
function compute_affected(changed_files::Vector{String},
114-
graph::Dict{String, Vector{String}},
115-
reverse_deps::Dict{String, Set{String}})
114+
function compute_affected(
115+
changed_files::Vector{String},
116+
graph::Dict{String, Vector{String}},
117+
reverse_deps::Dict{String, Set{String}}
118+
)
116119
affected = Set{String}()
117120
for filepath in changed_files
118121
filepath = strip(filepath)
@@ -131,9 +134,11 @@ end
131134
# Entries to exclude from the matrix.
132135
# Each entry is (group, version) where group is the CI GROUP string.
133136
# See: https://github.com/SciML/OrdinaryDiffEq.jl/issues/2977
134-
const EXCLUDES = Set([
135-
("OrdinaryDiffEqBDF", "pre"), # JET resolution fails on pre-release Julia
136-
])
137+
const EXCLUDES = Set(
138+
[
139+
("OrdinaryDiffEqBDF", "pre"), # JET resolution fails on pre-release Julia
140+
]
141+
)
137142

138143
function build_matrix(affected::Set{String}, lib_dir::String)
139144
entries = Vector{@NamedTuple{group::String, version::String}}()
@@ -159,7 +164,7 @@ function print_json(entries)
159164
i > 1 && print(",")
160165
print("{\"group\":\"", entry.group, "\",\"version\":\"", entry.version, "\"}")
161166
end
162-
println("]")
167+
return println("]")
163168
end
164169

165170
function main()
@@ -183,7 +188,7 @@ function main()
183188
affected = compute_affected(collect(String, changed_files), graph, reverse_deps)
184189

185190
matrix = build_matrix(affected, lib_dir)
186-
print_json(matrix)
191+
return print_json(matrix)
187192
end
188193

189194
main()

lib/OrdinaryDiffEqNonlinearSolve/test/dae_initialization_tests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,6 @@ integrator = init(
169169
# Rosenbrock methods (Rodas5P) linearize and don't iterate, so the step succeeds
170170
# but the constraint remains violated — u[2] stays near 0 instead of tracking u[1].
171171
step!(integ, 0.01, true)
172-
@test abs(integ.u[2]) < 1e-10 # u[2] stuck near 0, not reinitialized
172+
@test abs(integ.u[2]) < 1.0e-10 # u[2] stuck near 0, not reinitialized
173173
@test abs(integ.u[1]) > 1.5 # u[1] still evolving
174174
end

lib/OrdinaryDiffEqVerner/test/ode_verner_tests.jl

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ println("Backward solve lazy interpolation")
138138

139139
function backward_ode!(du, u, p, t)
140140
du[1] = -u[1]
141-
du[2] = -2 * u[2]
141+
return du[2] = -2 * u[2]
142142
end
143143

144144
prob_back = ODEProblem(backward_ode!, [1.0, 1.0], (1.0, 0.0))
@@ -155,7 +155,8 @@ cb_lazy = DiscreteCallback(
155155
push!(interp_lazy, curu[1])
156156
u_modified!(integrator, false)
157157
end,
158-
save_positions = (false, false))
158+
save_positions = (false, false)
159+
)
159160

160161
cb_nolazy = DiscreteCallback(
161162
(u, t, int) -> true,
@@ -166,12 +167,17 @@ cb_nolazy = DiscreteCallback(
166167
push!(interp_nolazy, curu[1])
167168
u_modified!(integrator, false)
168169
end,
169-
save_positions = (false, false))
170-
171-
solve(prob_back, Vern9(lazy = true), abstol = 1e-12, reltol = 1e-12,
172-
callback = cb_lazy, save_everystep = false)
173-
solve(prob_back, Vern9(lazy = false), abstol = 1e-12, reltol = 1e-12,
174-
callback = cb_nolazy, save_everystep = false)
170+
save_positions = (false, false)
171+
)
172+
173+
solve(
174+
prob_back, Vern9(lazy = true), abstol = 1.0e-12, reltol = 1.0e-12,
175+
callback = cb_lazy, save_everystep = false
176+
)
177+
solve(
178+
prob_back, Vern9(lazy = false), abstol = 1.0e-12, reltol = 1.0e-12,
179+
callback = cb_nolazy, save_everystep = false
180+
)
175181

176182
@test length(interp_lazy) == length(interp_nolazy)
177-
@test maximum(abs.(interp_lazy .- interp_nolazy)) < 1e-10
183+
@test maximum(abs.(interp_lazy .- interp_nolazy)) < 1.0e-10

test/gpu/simple_dae.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,6 @@ end
6262

6363
@testset "Compare GPU to CPU solution" begin
6464
for t in tspan[begin]:0.1:tspan[end]
65-
@test isapprox(Vector(sol_d(t)), sol(t); rtol = 1e-4)
65+
@test isapprox(Vector(sol_d(t)), sol(t); rtol = 1.0e-4)
6666
end
6767
end

test/interface/dae_initialization_tests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,6 @@ integrator = init(
168168
# Rosenbrock methods (Rodas5P) linearize and don't iterate, so the step succeeds
169169
# but the constraint remains violated — u[2] stays near 0 instead of tracking u[1].
170170
step!(integ, 0.01, true)
171-
@test abs(integ.u[2]) < 1e-10 # u[2] stuck near 0, not reinitialized
171+
@test abs(integ.u[2]) < 1.0e-10 # u[2] stuck near 0, not reinitialized
172172
@test abs(integ.u[1]) > 1.5 # u[1] still evolving
173173
end

0 commit comments

Comments
 (0)