diff --git a/.typos.toml b/.typos.toml index 79b68a4..0d7bd16 100644 --- a/.typos.toml +++ b/.typos.toml @@ -1 +1,3 @@ -[default.extend-words] \ No newline at end of file +[default.extend-words] +# Nd is the Modelica LimPID derivative-gain parameter name in the PID_Controller test fixture +Nd = "Nd" diff --git a/src/evaluator.jl b/src/evaluator.jl index f389079..e8528ca 100644 --- a/src/evaluator.jl +++ b/src/evaluator.jl @@ -376,9 +376,14 @@ function eval_AST(when_eq::BaseModelicaWhenEquation) # Only fire on positive zero-crossing (condition becomes true) → Modelica edge semantics condition_sym = eval_when_rhs(condition_ast; in_body = false) crossing = to_zero_crossing(condition_sym) + # A when-condition is scalar, so `crossing ~ 0` is a single Equation. + # Annotate the literal as Equation[...] so it is always Vector{Equation}: + # without it inference admits a spurious Vector{Vector{Equation}} arm + # (crossing is a Union including a vector case) for which + # SymbolicContinuousCallback has no matching method. push!( callbacks, ModelingToolkit.SymbolicContinuousCallback( - [crossing ~ 0], affects; + Equation[crossing ~ 0], affects; affect_neg = nothing, discrete_parameters = discrete_params_for_cb ) @@ -766,7 +771,7 @@ function eval_AST(model::BaseModelicaModel) modified = (; off = off_sym) ) cb = ModelingToolkit.SymbolicContinuousCallback( - [crossing ~ 0], + Equation[crossing ~ 0], affect; affect_neg = affect_neg, reinitializealg = BrownFullBasicInit(), diff --git a/test/runtests.jl b/test/runtests.jl index f30ce4a..66a23a3 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -23,7 +23,7 @@ run_tests(; @safetestset "ANTLR Parser Tests" include("test_antlr_parser.jl") return @safetestset "Error Message Tests" include("test_error_messages.jl") end, - groups = Dict("QA" => qa_group), + qa = qa_group, umbrellas = Dict("Quality" => ["QA"]), # Original runtests ran QA/Quality only for those explicit GROUPs, never under # "All"; curate "All" to Core only to preserve that.