Skip to content

Commit 6563e76

Browse files
committed
extension fixes
1 parent b7b6e8b commit 6563e76

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

ext/CatalystBifurcationKitExtension/bifurcation_kit_extension.jl

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,21 @@ function BK.BifurcationProblem(rs::ReactionSystem, u0_bif, ps, bif_par, args...;
1010
# Converts symbols to symbolics.
1111
(bif_par isa Symbol) && (bif_par = ModelingToolkit.get_var_to_name(rs)[bif_par])
1212
(plot_var isa Symbol) && (plot_var = ModelingToolkit.get_var_to_name(rs)[plot_var])
13-
((u0_bif isa Vector{<:Pair{Symbol, <:Any}}) || (u0_bif isa Dict{Symbol, <:Any})) &&
14-
(u0_bif = symmap_to_varmap(rs, u0_bif))
15-
((ps isa Vector{<:Pair{Symbol, <:Any}}) || (ps isa Dict{Symbol, <:Any})) &&
16-
(ps = symmap_to_varmap(rs, ps))
17-
((u0 isa Vector{<:Pair{Symbol, <:Any}}) || (u0 isa Dict{Symbol, <:Any})) &&
18-
(u0 = symmap_to_varmap(rs, u0))
13+
if (u0_bif isa Vector{<:Pair{Symbol, <:Any}}) || (u0_bif isa Dict{Symbol, <:Any})
14+
u0_bif = symmap_to_varmap(rs, u0_bif)
15+
end
16+
if (ps isa Vector{<:Pair{Symbol, <:Any}}) || (ps isa Dict{Symbol, <:Any})
17+
ps = symmap_to_varmap(rs, ps)
18+
end
19+
if (u0 isa Vector{<:Pair{Symbol, <:Any}}) || (u0 isa Dict{Symbol, <:Any})
20+
u0 = symmap_to_varmap(rs, u0)
21+
end
1922

2023
# Creates NonlinearSystem.
2124
Catalyst.conservationlaw_errorcheck(rs, vcat(ps, u0))
22-
nsys = complete(convert(
23-
NonlinearSystem, rs; remove_conserved = true, defaults = Dict(u0)))
25+
nsys = convert(NonlinearSystem, rs; remove_conserved = true, defaults = Dict(u0))
26+
nsys = complete(nsys)
2427

2528
# Makes BifurcationProblem (this call goes through the ModelingToolkit-based BifurcationKit extension).
26-
return BK.BifurcationProblem(nsys, u0_bif, ps, bif_par, args...; plot_var = plot_var,
27-
record_from_solution = record_from_solution, jac = jac, kwargs...)
29+
return BK.BifurcationProblem(nsys, u0_bif, ps, bif_par, args...; plot_var, record_from_solution, jac, kwargs...)
2830
end

0 commit comments

Comments
 (0)