Skip to content

Commit 2c5cb05

Browse files
ocotsgithub-actions[bot]
authored andcommitted
Format .jl files
1 parent cb52064 commit 2c5cb05

5 files changed

Lines changed: 42 additions & 43 deletions

File tree

src/Core/palette.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -359,11 +359,11 @@ function show_palette(io::IO=IOContext(stdout, :color => true))
359359
println(io)
360360
println(io, fmt.bold, "Mock describe / show", rst)
361361
println(io)
362-
n = open(p.name);
362+
n = open(p.name)
363363
t = open(p.type)
364-
v = open(p.value);
364+
v = open(p.value)
365365
kw = open(p.keyword)
366-
c = open(p.count);
366+
c = open(p.count)
367367
lb = open(p.label)
368368
mu = open(p.muted)
369369
println(io, " $(n)MyStrategy$(rst) (instance, id=$(kw):gradient$(rst))")
@@ -391,9 +391,9 @@ function show_palette(io::IO=IOContext(stdout, :color => true))
391391
println(io)
392392
println(io, fmt.bold, "Mock exception", rst)
393393
println(io)
394-
er = open(p.error);
394+
er = open(p.error)
395395
em = open(p.emphasis)
396-
wa = open(p.warning);
396+
wa = open(p.warning)
397397
su = open(p.success)
398398
println(
399399
io,

test/suite/core/test_function_utils.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ function test_function_utils()
6060
Test.@testset "to_out_of_place - larger output" begin
6161
big!(r, x) = (
6262
for i in 1:5
63-
;
64-
r[i] = x * i;
63+
r[i] = x * i
6564
end
6665
)
6766
big = Core.to_out_of_place(big!, 5)

test/suite/data/test_hamiltonian_vector_field.jl

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -445,8 +445,8 @@ function test_hamiltonian_vector_field()
445445
Test.@testset "OOP NonFixed: variable_costate=true on user-built HVF throws PreconditionError" begin
446446
f = (x, p, v) -> (p, -x) # no variable_costate kwarg
447447
hvf = Data.HamiltonianVectorField(f; is_autonomous=true, is_variable=true)
448-
x = [1.0];
449-
p = [0.5];
448+
x = [1.0]
449+
p = [0.5]
450450
v = [0.1]
451451
Test.@test_throws Exception hvf(x, p, v; variable_costate=true)
452452
end
@@ -456,20 +456,20 @@ function test_hamiltonian_vector_field()
456456
hvf = Data.HamiltonianVectorField(
457457
f; is_autonomous=true, is_variable=true, is_inplace=true
458458
)
459-
x = [1.0];
460-
p = [0.5];
459+
x = [1.0]
460+
p = [0.5]
461461
v = [0.1]
462-
dx = similar(x);
462+
dx = similar(x)
463463
dp = similar(p)
464464
Test.@test_throws Exception hvf(dx, dp, x, p, v; variable_costate=true)
465465
end
466466

467467
Test.@testset "OOP NonAutonomous NonFixed: variable_costate=true on user-built HVF throws PreconditionError" begin
468468
f = (t, x, p, v) -> (p, -x) # no variable_costate kwarg
469469
hvf = Data.HamiltonianVectorField(f; is_autonomous=false, is_variable=true)
470-
t = 0.5;
471-
x = [1.0];
472-
p = [0.5];
470+
t = 0.5
471+
x = [1.0]
472+
p = [0.5]
473473
v = [0.1]
474474
Test.@test_throws Exception hvf(t, x, p, v; variable_costate=true)
475475
end
@@ -479,20 +479,20 @@ function test_hamiltonian_vector_field()
479479
hvf = Data.HamiltonianVectorField(
480480
f; is_autonomous=false, is_variable=true, is_inplace=true
481481
)
482-
t = 0.5;
483-
x = [1.0];
484-
p = [0.5];
482+
t = 0.5
483+
x = [1.0]
484+
p = [0.5]
485485
v = [0.1]
486-
dx = similar(x);
486+
dx = similar(x)
487487
dp = similar(p)
488488
Test.@test_throws Exception hvf(dx, dp, t, x, p, v; variable_costate=true)
489489
end
490490

491491
Test.@testset "OOP NonFixed: variable_costate=false (default) on user-built HVF works" begin
492492
f = (x, p, v) -> (p, -x)
493493
hvf = Data.HamiltonianVectorField(f; is_autonomous=true, is_variable=true)
494-
x = [1.0];
495-
p = [0.5];
494+
x = [1.0]
495+
p = [0.5]
496496
v = [0.1]
497497
result = hvf(x, p, v)
498498
Test.@test result == (p, -x)

test/suite/data/test_pseudo_hamiltonian_vector_field.jl

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -467,9 +467,9 @@ function test_pseudo_hamiltonian_vector_field()
467467
phvf = Data.PseudoHamiltonianVectorField(
468468
f; is_autonomous=true, is_variable=true
469469
)
470-
x = [1.0];
471-
p = [0.5];
472-
u = [0.2];
470+
x = [1.0]
471+
p = [0.5]
472+
u = [0.2]
473473
v = [0.1]
474474
Test.@test_throws Exception phvf(x, p, u, v; variable_costate=true)
475475
end
@@ -479,11 +479,11 @@ function test_pseudo_hamiltonian_vector_field()
479479
phvf = Data.PseudoHamiltonianVectorField(
480480
f; is_autonomous=true, is_variable=true, is_inplace=true
481481
)
482-
x = [1.0];
483-
p = [0.5];
484-
u = [0.2];
482+
x = [1.0]
483+
p = [0.5]
484+
u = [0.2]
485485
v = [0.1]
486-
dx = similar(x);
486+
dx = similar(x)
487487
dp = similar(p)
488488
Test.@test_throws Exception phvf(dx, dp, x, p, u, v; variable_costate=true)
489489
end
@@ -493,10 +493,10 @@ function test_pseudo_hamiltonian_vector_field()
493493
phvf = Data.PseudoHamiltonianVectorField(
494494
f; is_autonomous=false, is_variable=true
495495
)
496-
t = 0.5;
497-
x = [1.0];
498-
p = [0.5];
499-
u = [0.2];
496+
t = 0.5
497+
x = [1.0]
498+
p = [0.5]
499+
u = [0.2]
500500
v = [0.1]
501501
Test.@test_throws Exception phvf(t, x, p, u, v; variable_costate=true)
502502
end
@@ -506,12 +506,12 @@ function test_pseudo_hamiltonian_vector_field()
506506
phvf = Data.PseudoHamiltonianVectorField(
507507
f; is_autonomous=false, is_variable=true, is_inplace=true
508508
)
509-
t = 0.5;
510-
x = [1.0];
511-
p = [0.5];
512-
u = [0.2];
509+
t = 0.5
510+
x = [1.0]
511+
p = [0.5]
512+
u = [0.2]
513513
v = [0.1]
514-
dx = similar(x);
514+
dx = similar(x)
515515
dp = similar(p)
516516
Test.@test_throws Exception phvf(
517517
dx, dp, t, x, p, u, v; variable_costate=true
@@ -523,9 +523,9 @@ function test_pseudo_hamiltonian_vector_field()
523523
phvf = Data.PseudoHamiltonianVectorField(
524524
f; is_autonomous=true, is_variable=true
525525
)
526-
x = [1.0];
527-
p = [0.5];
528-
u = [0.2];
526+
x = [1.0]
527+
p = [0.5]
528+
u = [0.2]
529529
v = [0.1]
530530
result = phvf(x, p, u, v)
531531
Test.@test result == (p, -x)

test/suite/differentiation/test_arg_placement.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ function test_arg_placement()
9090
b = _default_backend()
9191
# H(t, x, p, v) = t*v + ½‖p‖² + ‖x‖²
9292
H(t, x, p, v) = t * v + 0.5 * sum(p .^ 2) + sum(x .^ 2)
93-
t = 1.0;
94-
x = [1.0, 2.0];
95-
p = [3.0, 4.0];
93+
t = 1.0
94+
x = [1.0, 2.0]
95+
p = [3.0, 4.0]
9696
v = 5.0
9797
# ∂H/∂x = 2x (slot 2), consts in order t,p,v
9898
gx = Differentiation.differentiate(b, H, Val(2), x, t, p, v)

0 commit comments

Comments
 (0)