Skip to content

Commit 77a8967

Browse files
committed
warning fixes
1 parent 521bd4f commit 77a8967

File tree

15 files changed

+67
-64
lines changed

15 files changed

+67
-64
lines changed

HISTORY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ plot(bif_dia; xguide="k1", yguide="X")
5555
- Updated Bifurcation documentation with respect to this new feature.
5656

5757
## Catalyst 13.5
58-
- Added a CatalystHomotopyContinuationExtension extension, which exports the `hc_steady_state` function if HomotopyContinuation is exported. `hc_steady_state` finds the steady states of a reaction system using the homotopy continuation method. This feature is only available for julia versions 1.9+. Example:
58+
- Added a CatalystHomotopyContinuationExtension extension, which exports the `hc_steady_state` function if HomotopyContinuation is exported. `hc_steady_state` finds the steady states of a reaction system using the homotopy continuation method. This feature is only available for julia versions 1.9+. Example:
5959
```julia
6060
wilhelm_2009_model = @reaction_network begin
6161
k1, Y --> 2X
@@ -792,7 +792,7 @@ rn = @reaction_network Reversible_Reaction begin
792792
k1, A --> B
793793
k2, B --> A
794794
end k1 k2
795-
nameof(rn) == :Reversible_Reaction
795+
ModelingToolkit.nameof(rn) == :Reversible_Reaction
796796
```
797797
Note, empty networks can no longer be created with parameters, i.e. only
798798
```julia

docs/src/catalyst_functionality/dsl_description.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ We can now simulate the network without providing any initial conditions:
426426
```@example tut2
427427
u0 = []
428428
tspan = (0.0, 10.0)
429-
p = [:p => 2.0, :d => .1, :X0 => 1.0]
429+
p = [:p => 2.0, :d => .1, :X0 => 1.0]
430430
oprob = ODEProblem(rn, u0, tspan, p)
431431
sol = solve(oprob)
432432
plot(sol)

docs/unpublished/pdes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ parameters in (Kim et al., J. Chem. Phys., 146, 2017).
1212
First we load the packages we'll use
1313
```julia
1414
using Catalyst, MethodOfLines, DomainSets, OrdinaryDiffEq, Plots, Random, Distributions
15-
using ModelingToolkit: scalarize, unwrap, operation, nameof, defaults
15+
using ModelingToolkit: scalarize, unwrap, operation, defaults
1616
```
1717

1818
Next let's specify our default parameter values
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
### Dispatch for BifurcationKit BifurcationProblems ###
22

33
# Creates a BifurcationProblem, using a ReactionSystem as an input.
4-
function BK.BifurcationProblem(rs::ReactionSystem, u0_bif, ps, bif_par, args...;
5-
plot_var=nothing, record_from_solution=BK.record_sol_default, jac=true, u0=[], kwargs...)
4+
function BK.BifurcationProblem(rs::ReactionSystem, u0_bif, ps, bif_par, args...;
5+
plot_var=nothing, record_from_solution=BK.record_sol_default, jac=true, u0=[], kwargs...)
66

77
# Converts symbols to symbolics.
8-
(bif_par isa Symbol) && (bif_par = rs.var_to_name[bif_par])
9-
(plot_var isa Symbol) && (plot_var = rs.var_to_name[plot_var])
8+
(bif_par isa Symbol) && (bif_par = ModelingToolkit.get_var_to_name(rs)[bif_par])
9+
(plot_var isa Symbol) && (plot_var = ModelingToolkit.get_var_to_name(rs)[plot_var])
1010
((u0_bif isa Vector{<:Pair{Symbol,<:Any}}) || (u0_bif isa Dict{Symbol, <:Any})) && (u0_bif = symmap_to_varmap(rs, u0_bif))
1111
((ps isa Vector{<:Pair{Symbol,<:Any}}) || (ps isa Dict{Symbol, <:Any})) && (ps = symmap_to_varmap(rs, ps))
1212
((u0 isa Vector{<:Pair{Symbol,<:Any}}) || (u0 isa Dict{Symbol, <:Any})) && (u0 = symmap_to_varmap(rs, u0))
@@ -16,6 +16,6 @@ function BK.BifurcationProblem(rs::ReactionSystem, u0_bif, ps, bif_par, args...;
1616
nsys = convert(NonlinearSystem, rs; remove_conserved=true, defaults=Dict(u0))
1717

1818
# Makes BifurcationProblem (this call goes through the ModelingToolkit-based BifurcationKit extension).
19-
return BK.BifurcationProblem(nsys, u0_bif, ps, bif_par, args...; plot_var=plot_var,
19+
return BK.BifurcationProblem(nsys, u0_bif, ps, bif_par, args...; plot_var=plot_var,
2020
record_from_solution=record_from_solution, jac=jac, kwargs...)
2121
end

src/graphs.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#######################################################################
22
# Contains code from Catlab.jl:
33
# https://raw.githubusercontent.com/AlgebraicJulia/Catlab.jl/master/src/graphics/Graphviz.jl
4-
#
4+
#
55
# That license for that code is:
66
#
77
# The MIT License
@@ -275,7 +275,7 @@ const edge_attrs = Attributes(:splines => "splines")
275275
function edgify(δ, i, reverse::Bool)
276276
attr = Attributes()
277277
return map(δ) do p
278-
val = String(p[1].f.name)
278+
val = String(getname(p[1]))
279279
weight = "$(p[2])"
280280
attr = Attributes(:label => weight, :labelfontsize => "6")
281281
return Edge(reverse ? ["rx_$i", "$val"] :
@@ -289,7 +289,7 @@ function edgifyrates(rxs, specs)
289289
for (i, rx) in enumerate(rxs)
290290
deps = rx.rate isa Number ? Any[] : get_variables(rx.rate, specs)
291291
for dep in deps
292-
val = String(dep.f.name)
292+
val = String(getname(dep))
293293
attr = Attributes(:color => "#d91111", :style => "dashed")
294294
e = Edge(["$val", "rx_$i"], attr)
295295
push!(es, e)
@@ -324,7 +324,7 @@ end
324324
complexgraph(rn::ReactionSystem; complexdata=reactioncomplexes(rn))
325325
326326
Creates a Graphviz graph of the [`ReactionComplex`](@ref)s in `rn`. Reactions
327-
correspond to arrows and reaction complexes to blue circles.
327+
correspond to arrows and reaction complexes to blue circles.
328328
329329
Notes:
330330
- Black arrows from complexes to complexes indicate reactions whose rate is a
@@ -389,7 +389,7 @@ Notes:
389389
function Graph(rn::ReactionSystem)
390390
rxs = reactions(rn)
391391
specs = species(rn)
392-
statenodes = [Node(string(s.f.name),
392+
statenodes = [Node(string(getname(s)),
393393
Attributes(:shape => "circle", :color => "#6C9AC3")) for s in specs]
394394
transnodes = [Node(string("rx_$i"),
395395
Attributes(:shape => "point", :color => "#E28F41", :width => ".1"))

src/latexify_recipes.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ function chemical_arrows(rn::ReactionSystem; expand = true,
118118
rxs = reactions(rn)
119119
nonrxs = filter(eq -> eq isa Equation, equations(rn))
120120
if isempty(rxs) && isempty(nonrxs)
121-
latexstr = Latexify.LaTeXString("ReactionSystem $(nameof(rn)) has no reactions or equations.")
121+
latexstr = Latexify.LaTeXString("ReactionSystem $(ModelingToolkit.nameof(rn)) has no reactions or equations.")
122122
Latexify.COPY_TO_CLIPBOARD && clipboard(latexstr)
123123
return latexstr
124124
end

src/networkapi.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1285,7 +1285,7 @@ conservedquantities(state, cons_laws) = cons_laws * state
12851285
function conservationlaw_errorcheck(rs, pre_varmap)
12861286
vars_with_vals = Set(p[1] for p in pre_varmap)
12871287
any(s -> s in vars_with_vals, species(rs)) && return
1288-
isempty(conservedequations(Catalyst.flatten(rs))) ||
1288+
isempty(conservedequations(Catalyst.flatten(rs))) ||
12891289
error("The system has conservation laws but initial conditions were not provided for some species.")
12901290
end
12911291

src/reactionsystem.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1438,7 +1438,7 @@ Notes:
14381438
"""
14391439
function Base.convert(::Type{<:JumpSystem}, rs::ReactionSystem; name = nameof(rs),
14401440
combinatoric_ratelaws = get_combinatoric_ratelaws(rs),
1441-
remove_conserved = nothing, checks = false,
1441+
remove_conserved = nothing, checks = false,
14421442
default_u0 = Dict(), default_p = Dict(), defaults = _merge(Dict(default_u0), Dict(default_p)),
14431443
kwargs...)
14441444
spatial_convert_err(rs::ReactionSystem, JumpSystem)

src/registered_functions.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ function expand_registered_functions(eq::Equation)
142142
end
143143
# If applied to a ReactionSystem, applied function to all Reactions and other Equations, and return updated system.
144144
function expand_registered_functions(rs::ReactionSystem)
145-
rs = @set rs.eqs = [Catalyst.expand_registered_functions(eq) for eq in rs.eqs]
146-
return @set rs.rxs = [Catalyst.expand_registered_functions(rx) for rx in rs.rxs]
145+
@set! rs.eqs = [Catalyst.expand_registered_functions(eq) for eq in get_eqs(rs)]
146+
@set! rs.rxs = [Catalyst.expand_registered_functions(rx) for rx in get_rxs(rs)]
147+
return rs
147148
end

test/dsl/dsl_basics.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
### Fetch Packages and Set Global Variables ###
44

5-
using Catalyst
5+
using Catalyst, ModelingToolkit
66
@variables t
77

88
### Naming Tests ###
@@ -12,14 +12,14 @@ let
1212
@species A(t)
1313
rx = Reaction(k, [A], nothing)
1414
function rntest(rn, name)
15-
@test nameof(rn) == name
15+
@test ModelingToolkit.nameof(rn) == name
1616
@test isequal(species(rn)[1], ModelingToolkit.unwrap(A))
1717
@test isequal(parameters(rn)[1], ModelingToolkit.unwrap(k))
1818
@test reactions(rn)[1] == rx
1919
end
2020

2121
function emptyrntest(rn, name)
22-
@test nameof(rn) == name
22+
@test ModelingToolkit.nameof(rn) == name
2323
@test numreactions(rn) == 0
2424
@test numspecies(rn) == 0
2525
@test numreactionparams(rn) == 0
@@ -42,7 +42,7 @@ let
4242
@parameters k
4343
k, A --> 0
4444
end
45-
rntest(rn, nameof(rn))
45+
rntest(rn, ModelingToolkit.nameof(rn))
4646

4747
function makern(; name)
4848
@reaction_network $name begin

0 commit comments

Comments
 (0)