Skip to content

Commit 3fb0339

Browse files
committed
save progress
1 parent bc6d339 commit 3fb0339

File tree

9 files changed

+83
-80
lines changed

9 files changed

+83
-80
lines changed

ext/CatalystBifurcationKitExtension/bifurcation_kit_extension.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
function BK.BifurcationProblem(rs::ReactionSystem, u0_bif, ps, bif_par, args...;
55
plot_var = nothing, record_from_solution = BK.record_sol_default, jac = true, u0 = [], kwargs...)
66
if !isautonomous(rs)
7-
error("Attempting to create a `BifurcationProblem` for a non-autonomous system (e.g. where some rate depend on $(rs.iv)). This is not possible.")
7+
error("Attempting to create a `BifurcationProblem` for a non-autonomous system (e.g. where some rate depend on $(get_iv(rs))). This is not possible.")
88
end
99

1010
# Converts symbols to symbolics.

ext/CatalystHomotopyContinuationExtension/homotopy_continuation_extension.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Notes:
3838
function Catalyst.hc_steady_states(rs::ReactionSystem, ps; filter_negative = true,
3939
neg_thres = -1e-20, u0 = [], kwargs...)
4040
if !isautonomous(rs)
41-
error("Attempting to compute steady state for a non-autonomous system (e.g. where some rate depend on $(rs.iv)). This is not possible.")
41+
error("Attempting to compute steady state for a non-autonomous system (e.g. where some rate depend on $(get_iv(rs))). This is not possible.")
4242
end
4343
ss_poly = steady_state_polynomial(rs, ps, u0)
4444
sols = HC.real_solutions(HC.solve(ss_poly; kwargs...))

src/reactionsystem_conversions.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ function Base.convert(::Type{<:NonlinearSystem}, rs::ReactionSystem; name = name
520520
iscomplete(rs) || error(COMPLETENESS_ERROR)
521521
spatial_convert_err(rs::ReactionSystem, NonlinearSystem)
522522
if !isautonomous(rs)
523-
error("Attempting to convert a non-autonomous `ReactionSystem` (e.g. where some rate depend on $(rs.iv)) to a `NonlinearSystem`. This is not possible. if you are intending to compute system steady states, consider creating and solving a `SteadyStateProblem.")
523+
error("Attempting to convert a non-autonomous `ReactionSystem` (e.g. where some rate depend on $(get_iv(rs))) to a `NonlinearSystem`. This is not possible. if you are intending to compute system steady states, consider creating and solving a `SteadyStateProblem.")
524524
end
525525

526526
# Generates system equations.

src/reactionsystem_serialisation/serialise_reactionsystem.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,13 @@ function make_reaction_system_call(
147147
has_connection_type && (@string_append! reaction_system_string ", connection_type")
148148

149149
# Potentially appends a combinatoric_ratelaws statement.
150-
if !Symbolics.unwrap(rs.combinatoric_ratelaws)
150+
if !Symbolics.unwrap(combinatoric_ratelaws(rs))
151151
@string_append! reaction_system_string ", combinatoric_ratelaws = false"
152152
end
153153

154154
# Potentially appends `ReactionSystem` metadata value(s). Weird composite types are not supported.
155-
if !isnothing(rs.metadata)
156-
@string_append! reaction_system_string ", metadata = $(x_2_string(rs.metadata))"
155+
if !isnothing(MT.get_metadata(rs))
156+
@string_append! reaction_system_string ", metadata = $(x_2_string(MT.get_metadata(rs)))"
157157
end
158158

159159
# Finalises the call. Appends potential annotation. If the system is complete, add a call for this.

src/steady_state_stability.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function steady_state_stability(u::Vector, rs::ReactionSystem, ps;
4848
tol = 10 * sqrt(eps(ss_val_type(u))), ss_jac = steady_state_jac(rs; u0 = u))
4949
# Warning checks.
5050
if !isautonomous(rs)
51-
error("Attempting to compute stability for a non-autonomous system (e.g. where some rate depend on $(rs.iv)). This is not possible.")
51+
error("Attempting to compute stability for a non-autonomous system (e.g. where some rate depend on $(get_iv(rs))). This is not possible.")
5252
end
5353

5454
# If `u` is a vector of values, we convert it to a map. Also, if there are conservation laws,

test/dsl/dsl_options.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,8 +574,8 @@ let
574574
end
575575
end
576576
V,W = getfield.(observed(rn), :lhs)
577-
@test isequal(arguments(ModelingToolkit.unwrap(V)), Any[rn.iv, rn.sivs[1], rn.sivs[2]])
578-
@test isequal(arguments(ModelingToolkit.unwrap(W)), Any[rn.iv, rn.sivs[2]])
577+
@test isequal(arguments(ModelingToolkit.unwrap(V)), Any[Catalyst.get_iv(rs), Catalyst.get_sivs(rn)[1], Catalyst.get_sivs(rn)[2]])
578+
@test isequal(arguments(ModelingToolkit.unwrap(W)), Any[Catalyst.get_iv(rs), Catalyst.get_sivs(rn)[2]])
579579
end
580580

581581
# Checks that metadata is written properly.

test/extensions/structural_identifiability.jl

Lines changed: 71 additions & 68 deletions
Large diffs are not rendered by default.

test/miscellaneous_tests/stability_computation.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ let
2929
:d => 0.5 + rand(rng))
3030

3131
# Computes stability using various jacobian options.
32-
sss = hc_steady_states(rn, ps)
32+
sss = hc_steady_states(rn, ps; show_progress=false)
3333
stabs_1 = [steady_state_stability(ss, rn, ps) for ss in sss]
3434
stabs_2 = [steady_state_stability(ss, rn, ps; ss_jac = ss_jac) for ss in sss]
3535

@@ -71,7 +71,7 @@ let
7171
ps_3 = [rn.k1 => 8.0, rn.k2 => 2.0, rn.k3 => 1.0, rn.k4 => 1.5, rn.kD1 => 0.5, rn.kD2 => 4.0]
7272

7373
# Computes stability using various input forms, and checks that the output is correct.
74-
sss = hc_steady_states(rn, ps_1; u0 = u0_1)
74+
sss = hc_steady_states(rn, ps_1; u0 = u0_1, show_progress=false)
7575
for u0 in [u0_1, u0_2, u0_3, u0_4], ps in [ps_1, ps_2, ps_3]
7676
stab_1 = [steady_state_stability(ss, rn, ps) for ss in sss]
7777
ss_jac = steady_state_jac(rn; u0 = u0)

test/reactionsystem_core/parameter_type_designation.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ let
6464
for p in p_alts
6565
oprob = ODEProblem(rs, u0, (0.0, 1000.0), p; abstol = 1e-10, reltol = 1e-10)
6666
sol = solve(oprob, Tsit5())
67-
@test all(sol[end] .≈ 1.0)
67+
@test all(sol.u[end] .≈ 1.0)
6868
end
6969
end
7070

0 commit comments

Comments
 (0)