File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff 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)
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments