Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/Core/palette.jl
Original file line number Diff line number Diff line change
Expand Up @@ -359,11 +359,11 @@ function show_palette(io::IO=IOContext(stdout, :color => true))
println(io)
println(io, fmt.bold, "Mock describe / show", rst)
println(io)
n = open(p.name);
n = open(p.name)
t = open(p.type)
v = open(p.value);
v = open(p.value)
kw = open(p.keyword)
c = open(p.count);
c = open(p.count)
lb = open(p.label)
mu = open(p.muted)
println(io, " $(n)MyStrategy$(rst) (instance, id=$(kw):gradient$(rst))")
Expand Down Expand Up @@ -391,9 +391,9 @@ function show_palette(io::IO=IOContext(stdout, :color => true))
println(io)
println(io, fmt.bold, "Mock exception", rst)
println(io)
er = open(p.error);
er = open(p.error)
em = open(p.emphasis)
wa = open(p.warning);
wa = open(p.warning)
su = open(p.success)
println(
io,
Expand Down
3 changes: 1 addition & 2 deletions test/suite/core/test_function_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ function test_function_utils()
Test.@testset "to_out_of_place - larger output" begin
big!(r, x) = (
for i in 1:5
;
r[i] = x * i;
r[i] = x * i
end
)
big = Core.to_out_of_place(big!, 5)
Expand Down
28 changes: 14 additions & 14 deletions test/suite/data/test_hamiltonian_vector_field.jl
Original file line number Diff line number Diff line change
Expand Up @@ -445,8 +445,8 @@ function test_hamiltonian_vector_field()
Test.@testset "OOP NonFixed: variable_costate=true on user-built HVF throws PreconditionError" begin
f = (x, p, v) -> (p, -x) # no variable_costate kwarg
hvf = Data.HamiltonianVectorField(f; is_autonomous=true, is_variable=true)
x = [1.0];
p = [0.5];
x = [1.0]
p = [0.5]
v = [0.1]
Test.@test_throws Exception hvf(x, p, v; variable_costate=true)
end
Expand All @@ -456,20 +456,20 @@ function test_hamiltonian_vector_field()
hvf = Data.HamiltonianVectorField(
f; is_autonomous=true, is_variable=true, is_inplace=true
)
x = [1.0];
p = [0.5];
x = [1.0]
p = [0.5]
v = [0.1]
dx = similar(x);
dx = similar(x)
dp = similar(p)
Test.@test_throws Exception hvf(dx, dp, x, p, v; variable_costate=true)
end

Test.@testset "OOP NonAutonomous NonFixed: variable_costate=true on user-built HVF throws PreconditionError" begin
f = (t, x, p, v) -> (p, -x) # no variable_costate kwarg
hvf = Data.HamiltonianVectorField(f; is_autonomous=false, is_variable=true)
t = 0.5;
x = [1.0];
p = [0.5];
t = 0.5
x = [1.0]
p = [0.5]
v = [0.1]
Test.@test_throws Exception hvf(t, x, p, v; variable_costate=true)
end
Expand All @@ -479,20 +479,20 @@ function test_hamiltonian_vector_field()
hvf = Data.HamiltonianVectorField(
f; is_autonomous=false, is_variable=true, is_inplace=true
)
t = 0.5;
x = [1.0];
p = [0.5];
t = 0.5
x = [1.0]
p = [0.5]
v = [0.1]
dx = similar(x);
dx = similar(x)
dp = similar(p)
Test.@test_throws Exception hvf(dx, dp, t, x, p, v; variable_costate=true)
end

Test.@testset "OOP NonFixed: variable_costate=false (default) on user-built HVF works" begin
f = (x, p, v) -> (p, -x)
hvf = Data.HamiltonianVectorField(f; is_autonomous=true, is_variable=true)
x = [1.0];
p = [0.5];
x = [1.0]
p = [0.5]
v = [0.1]
result = hvf(x, p, v)
Test.@test result == (p, -x)
Expand Down
38 changes: 19 additions & 19 deletions test/suite/data/test_pseudo_hamiltonian_vector_field.jl
Original file line number Diff line number Diff line change
Expand Up @@ -467,9 +467,9 @@ function test_pseudo_hamiltonian_vector_field()
phvf = Data.PseudoHamiltonianVectorField(
f; is_autonomous=true, is_variable=true
)
x = [1.0];
p = [0.5];
u = [0.2];
x = [1.0]
p = [0.5]
u = [0.2]
v = [0.1]
Test.@test_throws Exception phvf(x, p, u, v; variable_costate=true)
end
Expand All @@ -479,11 +479,11 @@ function test_pseudo_hamiltonian_vector_field()
phvf = Data.PseudoHamiltonianVectorField(
f; is_autonomous=true, is_variable=true, is_inplace=true
)
x = [1.0];
p = [0.5];
u = [0.2];
x = [1.0]
p = [0.5]
u = [0.2]
v = [0.1]
dx = similar(x);
dx = similar(x)
dp = similar(p)
Test.@test_throws Exception phvf(dx, dp, x, p, u, v; variable_costate=true)
end
Expand All @@ -493,10 +493,10 @@ function test_pseudo_hamiltonian_vector_field()
phvf = Data.PseudoHamiltonianVectorField(
f; is_autonomous=false, is_variable=true
)
t = 0.5;
x = [1.0];
p = [0.5];
u = [0.2];
t = 0.5
x = [1.0]
p = [0.5]
u = [0.2]
v = [0.1]
Test.@test_throws Exception phvf(t, x, p, u, v; variable_costate=true)
end
Expand All @@ -506,12 +506,12 @@ function test_pseudo_hamiltonian_vector_field()
phvf = Data.PseudoHamiltonianVectorField(
f; is_autonomous=false, is_variable=true, is_inplace=true
)
t = 0.5;
x = [1.0];
p = [0.5];
u = [0.2];
t = 0.5
x = [1.0]
p = [0.5]
u = [0.2]
v = [0.1]
dx = similar(x);
dx = similar(x)
dp = similar(p)
Test.@test_throws Exception phvf(
dx, dp, t, x, p, u, v; variable_costate=true
Expand All @@ -523,9 +523,9 @@ function test_pseudo_hamiltonian_vector_field()
phvf = Data.PseudoHamiltonianVectorField(
f; is_autonomous=true, is_variable=true
)
x = [1.0];
p = [0.5];
u = [0.2];
x = [1.0]
p = [0.5]
u = [0.2]
v = [0.1]
result = phvf(x, p, u, v)
Test.@test result == (p, -x)
Expand Down
6 changes: 3 additions & 3 deletions test/suite/differentiation/test_arg_placement.jl
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ function test_arg_placement()
b = _default_backend()
# H(t, x, p, v) = t*v + ½‖p‖² + ‖x‖²
H(t, x, p, v) = t * v + 0.5 * sum(p .^ 2) + sum(x .^ 2)
t = 1.0;
x = [1.0, 2.0];
p = [3.0, 4.0];
t = 1.0
x = [1.0, 2.0]
p = [3.0, 4.0]
v = 5.0
# ∂H/∂x = 2x (slot 2), consts in order t,p,v
gx = Differentiation.differentiate(b, H, Val(2), x, t, p, v)
Expand Down