Skip to content

Commit dcec735

Browse files
committed
formatting
1 parent 66f1d31 commit dcec735

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

src/systems/callbacks.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,8 @@ function SymbolicDiscreteCallback(
471471
initialize = nothing, finalize = nothing,
472472
reinitializealg = nothing, kwargs...)
473473
# Manual error check (to prevent events like `[X < 5.0] => [X ~ Pre(X) + 10.0]` from being created).
474-
(condition isa Vector) && (eltype(condition) <: Num) && error("Vectors of symbolic conditions are not allowed for `SymbolicDiscreteCallback`.")
474+
(condition isa Vector) && (eltype(condition) <: Num) &&
475+
error("Vectors of symbolic conditions are not allowed for `SymbolicDiscreteCallback`.")
475476

476477
c = is_timed_condition(condition) ? condition : value(scalarize(condition))
477478
if isnothing(reinitializealg)

test/symbolic_events.jl

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1444,7 +1444,14 @@ end
14441444
@testset "Test erroneously created events yields errors" begin
14451445
@parameters p(t) d
14461446
@variables X(t)
1447-
@test_throws "Vectors of symbolic conditions are not allowed" SymbolicDiscreteCallback([X < 5.0] => [X ~ Pre(X) + 10.0])
1448-
@test_throws "Vectors of symbolic conditions are not allowed" SymbolicDiscreteCallback([X < 5.0, X > 10.0] => [X ~ Pre(X) + 10.0])
1449-
@test_throws "MethodError: no method" SymbolicContinuousCallback((X < 5.0) => [X ~ Pre(X) + 10.0])
1450-
end
1447+
@test_throws "Vectors of symbolic conditions are not allowed" SymbolicDiscreteCallback([X <
1448+
5.0] => [X ~
1449+
Pre(X) +
1450+
10.0])
1451+
@test_throws "Vectors of symbolic conditions are not allowed" SymbolicDiscreteCallback([
1452+
X < 5.0, X > 10.0] => [X ~ Pre(X) + 10.0])
1453+
@test_throws "MethodError: no method" SymbolicContinuousCallback((X <
1454+
5.0) => [X ~
1455+
Pre(X) +
1456+
10.0])
1457+
end

0 commit comments

Comments
 (0)