Skip to content

Commit

Permalink
Fix constructor redefinition issue (attempt the seecond, dispatch to …
Browse files Browse the repository at this point in the history
…the kwargs version edition)
  • Loading branch information
BenChung committed Aug 1, 2024
1 parent 32c7c9f commit 7053b34
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/systems/callbacks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ struct SymbolicContinuousCallback
affect::Union{Vector{Equation}, FunctionalAffect}
affect_neg::Union{Vector{Equation}, FunctionalAffect, Nothing}
rootfind::SciMLBase.RootfindOpt
function SymbolicContinuousCallback(eqs::Vector{Equation}, affect = NULL_AFFECT,
function SymbolicContinuousCallback(; eqs::Vector{Equation}, affect = NULL_AFFECT,
affect_neg = affect, rootfind = SciMLBase.LeftRootFind)
new(eqs, make_affect(affect), make_affect(affect_neg), rootfind)
end # Default affect to nothing
Expand Down Expand Up @@ -148,11 +148,11 @@ SymbolicContinuousCallback(p::Pair) = SymbolicContinuousCallback(p[1], p[2])
SymbolicContinuousCallback(cb::SymbolicContinuousCallback) = cb # passthrough
function SymbolicContinuousCallback(eqs::Equation, affect = NULL_AFFECT;
affect_neg = affect, rootfind = SciMLBase.LeftRootFind)
SymbolicContinuousCallback([eqs], affect, affect_neg, rootfind)
SymbolicContinuousCallback(eqs=[eqs], affect=affect, affect_neg=affect_neg, rootfind=rootfind)
end
function SymbolicContinuousCallback(eqs::Vector{Equation}, affect;
function SymbolicContinuousCallback(eqs::Vector{Equation}, affect = NULL_AFFECT;
affect_neg = affect, rootfind = SciMLBase.LeftRootFind)
SymbolicContinuousCallback(eqs, affect, affect_neg, rootfind)
SymbolicContinuousCallback(eqs=eqs, affect=affect, affect_neg=affect_neg, rootfind=rootfind)
end

SymbolicContinuousCallbacks(cb::SymbolicContinuousCallback) = [cb]
Expand Down

0 comments on commit 7053b34

Please sign in to comment.