Skip to content

Commit d4d3411

Browse files
committed
remove functions
1 parent 0e08508 commit d4d3411

File tree

8 files changed

+5
-57
lines changed

8 files changed

+5
-57
lines changed

HISTORY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Catalyst unreleased (master branch)
44

55
## Catalyst 14.0
6-
- Rename `reactionparams`, `numreactionparams`, and `reactionparamsmap` to `reactionsystemparams`, `numreactionsystemparams`, and `reactionsystemparamsmap`, respectively.
6+
- The `reactionparams`, `numreactionparams`, and `reactionparamsmap` functions have been removed.
77
- To be more consistent with ModelingToolkit's immutability requirement for systems, we have removed API functions that mutate `ReactionSystem`s such as `addparam!`, `addreaction!`, `addspecies`, `@add_reactions`, and `merge!`. Please use `ModelingToolkit.extend` and `ModelingToolkit.compose` to generate new merged and/or composed `ReactionSystem`s from multiple component systems.
88
- Added CatalystStructuralIdentifiabilityExtension, which permits StructuralIdentifiability.jl function to be applied directly to Catalyst systems. E.g. use
99
```julia

docs/src/api.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,6 @@ can call:
128128
the system and any sub-systems that are also `ReactionSystems`.
129129
* `ModelingToolkit.parameters(rn)` returns all parameters across the
130130
system, *all sub-systems*, and all constraint systems.
131-
* [`reactionsystemparams(rn)`](@ref) is a vector of all the parameters within the
132-
system and any sub-systems that are also `ReactionSystem`s. These include all
133-
parameters that appear within some `Reaction`.
134131
* `ModelingToolkit.equations(rn)` returns all [`Reaction`](@ref)s and all
135132
`Symbolics.Equations` defined across the system, *all sub-systems*, and all
136133
constraint systems. `Reaction`s are ordered ahead of `Equation`s with the

src/Catalyst.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ export get_noise_scaling, has_noise_scaling
9898
# The `ReactionSystem` structure and its functions.
9999
include("reactionsystem.jl")
100100
export ReactionSystem, isspatial
101-
export species, nonspecies, reactionsystemparams, reactions, nonreactions, speciesmap, paramsmap
102-
export numspecies, numreactions, numreactionsystemparams, setdefaults!
103-
export make_empty_network, reactionsystemparamsmap
101+
export species, nonspecies, reactions, nonreactions, speciesmap, paramsmap
102+
export numspecies, numreactions, setdefaults!
103+
export make_empty_network,
104104
export dependants, dependents, substoichmat, prodstoichmat, netstoichmat
105105
export reactionrates
106106
export isequivalent

src/reactionsystem.jl

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -722,24 +722,6 @@ function get_indep_sts(rs::ReactionSystem, remove_conserved = false)
722722
indepsts, filter(isspecies, indepsts)
723723
end
724724

725-
"""
726-
reactionsystemparams(network)
727-
728-
Given a [`ReactionSystem`](@ref), return a vector of all parameters defined
729-
within the system and any subsystems that are of type `ReactionSystem`. To get
730-
the parameters in the system and all subsystems, including non-`ReactionSystem`
731-
subsystems, use `parameters(network)`.
732-
733-
Notes:
734-
- Allocates and has to calculate these dynamically by comparison for each reaction.
735-
"""
736-
function reactionsystemparams(network)
737-
ps = get_ps(network)
738-
systems = filter_nonrxsys(network)
739-
isempty(systems) && return ps
740-
unique([ps; reduce(vcat, map(sys -> species(sys, reactionsystemparams(sys)), systems))])
741-
end
742-
743725
"""
744726
numparams(network)
745727
@@ -764,16 +746,6 @@ function paramsmap(network)
764746
Dict(p => i for (i, p) in enumerate(parameters(network)))
765747
end
766748

767-
"""
768-
reactionsystemparamsmap(network)
769-
770-
Given a [`ReactionSystem`](@ref), return a Dictionary mapping from parameters that
771-
appear within `Reaction`s to their index within [`reactionsystemparams(network)`](@ref).
772-
"""
773-
function reactionsystemparamsmap(network)
774-
Dict(p => i for (i, p) in enumerate(reactionsystemparams(network)))
775-
end
776-
777749
# used in the next function (`reactions(network)`).
778750
function namespace_reactions(network::ReactionSystem)
779751
rxs = reactions(network)
@@ -823,21 +795,6 @@ function nonreactions(network)
823795
equations(network)[(numreactions(network) + 1):end]
824796
end
825797

826-
"""
827-
numreactionsystemparams(network)
828-
829-
Return the total number of parameters within the given [`ReactionSystem`](@ref)
830-
and subsystems that are `ReactionSystem`s.
831-
832-
Notes
833-
- If there are no subsystems this will be fast.
834-
- As this calls [`reactionsystemparams`](@ref), it can be slow and will allocate if
835-
there are any subsystems.
836-
"""
837-
function numreactionsystemparams(network)
838-
length(reactionsystemparams(network))
839-
end
840-
841798
"""
842799
reactionrates(network)
843800

test/compositional_modelling/component_based_model_creation.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,6 @@ let
297297
# Test API functions for composed model.
298298
@test issetequal(species(rs), [A, B, C])
299299
@test issetequal(unknowns(rs), [A, B, C, ns.D])
300-
@test issetequal(reactionsystemparams(rs), [r₊, r₋])
301300
@test issetequal(parameters(rs), [r₊, r₋, ns.β])
302301
@test issetequal(reactions(rs), union(rxs1, rxs2))
303302
@test issetequal(filter(eq -> eq isa Reaction, equations(rs)), union(rxs1, rxs2))
@@ -340,7 +339,6 @@ let
340339
@test issetequal(unknowns(rs1), [A1, rs2.A2a, ns2.A2b, rs2.rs3.A3a, rs2.ns3.A3b])
341340
@test issetequal(species(rs1), [A1, rs2.A2a, rs2.rs3.A3a])
342341
@test issetequal(parameters(rs1), [p1, rs2.p2a, rs2.p2b, rs2.rs3.p3a, rs2.ns3.p3b])
343-
@test issetequal(reactionsystemparams(rs1), [p1, rs2.p2a, rs2.p2b, rs2.rs3.p3a])
344342
@test issetequal(rxs, reactions(rs1))
345343
@test issetequal(eqs, equations(rs1))
346344
@test Catalyst.combinatoric_ratelaws(rs1)

test/dsl/dsl_advanced_model_construction.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ let
3535
@test ModelingToolkit.nameof(rn) == name
3636
@test numreactions(rn) == 0
3737
@test numspecies(rn) == 0
38-
@test numreactionsystemparams(rn) == 0
3938
end
4039

4140
rn = @reaction_network name begin

test/miscellaneous_tests/api.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,13 @@ let
8383
@test pmat == prodstoichmat(rnmat) == Matrix(prodstoichmat(rnmat, sparse = true))
8484
end
8585

86-
# Tests `reactionsystemparamsmap`, `reactionrates`, and `symmap_to_varmap` getters.
86+
# Tests `reactionrates`, and `symmap_to_varmap` getters.
8787
let
8888
rn = @reaction_network begin
8989
(p,d), 0 <--> X
9090
(kB,kD), 2X <--> X
9191
end
9292
@unpack p, d, kB, kD = rn
93-
isequal(reactionsystemparamsmap(rn), Dict([p => 1, d => 2, kB => 3, kD => 4]))
9493
issetequal(reactionrates(rn), [p, d, kB, kD])
9594
isequal(symmap_to_varmap(rn, [:p => 1.0, :kB => 3.0]), [p => 1.0, kB => 3.0])
9695
end

test/reactionsystem_core/coupled_equation_crn_systems.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,7 @@ let
251251

252252
# Check parameters-related accessors.
253253
@test issetequal(parameters(coupled_rs), [p, d, v])
254-
@test issetequal(reactionsystemparams(coupled_rs), [p, d, v])
255254
@test numparams(coupled_rs) == 3
256-
@test numreactionsystemparams(coupled_rs) == 3
257255

258256
# Check other accessors.
259257
@test !isspatial(coupled_rs)

0 commit comments

Comments
 (0)