Skip to content

Commit eb72cad

Browse files
author
SciML Bot
committed
Apply JuliaFormatter to fix code formatting
- Applied JuliaFormatter with SciML style guide - Formatted 4 files 🤖 Generated by OrgMaintenanceScripts.jl
1 parent 0838aa4 commit eb72cad

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

src/legacy.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ function AutoModelingToolkit(; obj_sparse::Bool = false, cons_sparse::Bool = fal
3737
return mtk_to_symbolics(obj_sparse, cons_sparse)
3838
end
3939

40-
function AutoTapir(; safe_mode=true)
40+
function AutoTapir(; safe_mode = true)
4141
Base.depwarn(
42-
"`AutoTapir` is deprecated in favour of `AutoMooncake`.", :AutoTapir; force=false
42+
"`AutoTapir` is deprecated in favour of `AutoMooncake`.", :AutoTapir; force = false
4343
)
4444
return AutoTapir(safe_mode)
4545
end

src/symbols.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Auto(package::Symbol, args...; kws...) = Auto(Val(package), args...; kws...)
2424
for backend in (:ChainRules, :Diffractor, :Enzyme, :FastDifferentiation,
2525
:FiniteDiff, :FiniteDifferences, :ForwardDiff, :Mooncake, :PolyesterForwardDiff,
2626
:ReverseDiff, :Symbolics, :Tapir, :Tracker, :Zygote)
27-
@eval Auto(::Val{$(QuoteNode(backend))}, args...; kws...) = $(Symbol(:Auto, backend))(
27+
@eval Auto(::Val{$(QuoteNode(backend))}, args...;
28+
kws...) = $(Symbol(:Auto, backend))(
2829
args...; kws...)
2930
end

test/legacy.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,5 @@ end
7171

7272
@testset "AutoTapir" begin
7373
@test_deprecated AutoTapir()
74-
@test_deprecated AutoTapir(; safe_mode=false)
74+
@test_deprecated AutoTapir(; safe_mode = false)
7575
end

test/sparse.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ end
2828
sd = NoSparsityDetector()
2929

3030
for x in (rand(2), rand(2, 3)), f in (f_jac1, f_jac2)
31+
3132
y = f(x)
3233
Js = jacobian_sparsity(f, x, sd)
3334
@test Js isa AbstractMatrix
@@ -36,6 +37,7 @@ end
3637
end
3738

3839
for x in (rand(2), rand(2, 3)), y in (rand(5), rand(5, 6))
40+
3941
Js = jacobian_sparsity(f_jac!, y, x, sd)
4042
@test Js isa AbstractMatrix
4143
@test size(Js) == (length(y), length(x))
@@ -54,6 +56,7 @@ end
5456
@testset "Jacobian sparsity detection" begin
5557
@testset "Out-of-place functions" begin
5658
for sx in ((2,), (2, 3)), f in (f_jac1, f_jac2)
59+
5760
x = rand(sx...)
5861
nx = length(x)
5962
Jref = rand(Bool, 2 * nx, nx)
@@ -66,6 +69,7 @@ end
6669
end
6770
@testset "In-place functions" begin
6871
for sx in ((2,), (2, 3)), sy in ((5,), (5, 6))
72+
6973
x, y = rand(sx...), rand(sy...)
7074
nx, ny = length(x), length(y)
7175
Jref = rand(Bool, ny, nx)
@@ -89,9 +93,11 @@ end
8993
@testset "Exceptions: DimensionMismatch" begin
9094
sd = KnownJacobianSparsityDetector(rand(Bool, 6, 7)) # wrong Jacobian size
9195
for x in (rand(2), rand(2, 3)), f in (f_jac1, f_jac2)
96+
9297
@test_throws DimensionMismatch jacobian_sparsity(f, x, sd)
9398
end
9499
for x in (rand(2), rand(2, 3)), y in (rand(5), rand(5, 6))
100+
95101
@test_throws DimensionMismatch jacobian_sparsity(f_jac!, y, x, sd)
96102
end
97103
end
@@ -114,6 +120,7 @@ end
114120
@testset "Exceptions: Jacobian sparsity detection not supported" begin
115121
@testset "Out-of-place functions" begin
116122
for sx in ((2,), (2, 3)), f in (f_jac1, f_jac2)
123+
117124
x = rand(sx...)
118125
nx = length(x)
119126
Jref = rand(Bool, 2 * nx, nx)
@@ -123,6 +130,7 @@ end
123130
end
124131
@testset "In-place functions" begin
125132
for sx in ((2,), (2, 3)), sy in ((5,), (5, 6))
133+
126134
x, y = rand(sx...), rand(sy...)
127135
nx, ny = length(x), length(y)
128136
Jref = rand(Bool, ny, nx)

0 commit comments

Comments
 (0)