Skip to content

Commit 0e08508

Browse files
committed
init
1 parent a649acc commit 0e08508

File tree

8 files changed

+26
-25
lines changed

8 files changed

+26
-25
lines changed

HISTORY.md

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

55
## Catalyst 14.0
6+
- Rename `reactionparams`, `numreactionparams`, and `reactionparamsmap` to `reactionsystemparams`, `numreactionsystemparams`, and `reactionsystemparamsmap`, respectively.
67
- 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.
78
- Added CatalystStructuralIdentifiabilityExtension, which permits StructuralIdentifiability.jl function to be applied directly to Catalyst systems. E.g. use
89
```julia

docs/src/api.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ 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-
* [`reactionparams(rn)`](@ref) is a vector of all the parameters within the
131+
* [`reactionsystemparams(rn)`](@ref) is a vector of all the parameters within the
132132
system and any sub-systems that are also `ReactionSystem`s. These include all
133133
parameters that appear within some `Reaction`.
134134
* `ModelingToolkit.equations(rn)` returns all [`Reaction`](@ref)s and all
@@ -155,16 +155,16 @@ accessor functions.
155155
```@docs
156156
species
157157
nonspecies
158-
reactionparams
158+
reactionsystemparams
159159
reactions
160160
nonreactions
161161
numspecies
162162
numparams
163163
numreactions
164-
numreactionparams
164+
numreactionsystemparams
165165
speciesmap
166166
paramsmap
167-
reactionparamsmap
167+
reactionsystemparamsmap
168168
isspecies
169169
Catalyst.isconstant
170170
Catalyst.isbc

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, reactionparams, reactions, nonreactions, speciesmap, paramsmap
102-
export numspecies, numreactions, numreactionparams, setdefaults!
103-
export make_empty_network, reactionparamsmap
101+
export species, nonspecies, reactionsystemparams, reactions, nonreactions, speciesmap, paramsmap
102+
export numspecies, numreactions, numreactionsystemparams, setdefaults!
103+
export make_empty_network, reactionsystemparamsmap
104104
export dependants, dependents, substoichmat, prodstoichmat, netstoichmat
105105
export reactionrates
106106
export isequivalent

src/reactionsystem.jl

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ function get_indep_sts(rs::ReactionSystem, remove_conserved = false)
723723
end
724724

725725
"""
726-
reactionparams(network)
726+
reactionsystemparams(network)
727727
728728
Given a [`ReactionSystem`](@ref), return a vector of all parameters defined
729729
within the system and any subsystems that are of type `ReactionSystem`. To get
@@ -733,11 +733,11 @@ subsystems, use `parameters(network)`.
733733
Notes:
734734
- Allocates and has to calculate these dynamically by comparison for each reaction.
735735
"""
736-
function reactionparams(network)
736+
function reactionsystemparams(network)
737737
ps = get_ps(network)
738738
systems = filter_nonrxsys(network)
739739
isempty(systems) && return ps
740-
unique([ps; reduce(vcat, map(sys -> species(sys, reactionparams(sys)), systems))])
740+
unique([ps; reduce(vcat, map(sys -> species(sys, reactionsystemparams(sys)), systems))])
741741
end
742742

743743
"""
@@ -765,13 +765,13 @@ function paramsmap(network)
765765
end
766766

767767
"""
768-
reactionparamsmap(network)
768+
reactionsystemparamsmap(network)
769769
770770
Given a [`ReactionSystem`](@ref), return a Dictionary mapping from parameters that
771-
appear within `Reaction`s to their index within [`reactionparams(network)`](@ref).
771+
appear within `Reaction`s to their index within [`reactionsystemparams(network)`](@ref).
772772
"""
773-
function reactionparamsmap(network)
774-
Dict(p => i for (i, p) in enumerate(reactionparams(network)))
773+
function reactionsystemparamsmap(network)
774+
Dict(p => i for (i, p) in enumerate(reactionsystemparams(network)))
775775
end
776776

777777
# used in the next function (`reactions(network)`).
@@ -824,18 +824,18 @@ function nonreactions(network)
824824
end
825825

826826
"""
827-
numreactionparams(network)
827+
numreactionsystemparams(network)
828828
829829
Return the total number of parameters within the given [`ReactionSystem`](@ref)
830830
and subsystems that are `ReactionSystem`s.
831831
832832
Notes
833833
- If there are no subsystems this will be fast.
834-
- As this calls [`reactionparams`](@ref), it can be slow and will allocate if
834+
- As this calls [`reactionsystemparams`](@ref), it can be slow and will allocate if
835835
there are any subsystems.
836836
"""
837-
function numreactionparams(network)
838-
length(reactionparams(network))
837+
function numreactionsystemparams(network)
838+
length(reactionsystemparams(network))
839839
end
840840

841841
"""

test/compositional_modelling/component_based_model_creation.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ 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(reactionparams(rs), [r₊, r₋])
300+
@test issetequal(reactionsystemparams(rs), [r₊, r₋])
301301
@test issetequal(parameters(rs), [r₊, r₋, ns.β])
302302
@test issetequal(reactions(rs), union(rxs1, rxs2))
303303
@test issetequal(filter(eq -> eq isa Reaction, equations(rs)), union(rxs1, rxs2))
@@ -340,7 +340,7 @@ let
340340
@test issetequal(unknowns(rs1), [A1, rs2.A2a, ns2.A2b, rs2.rs3.A3a, rs2.ns3.A3b])
341341
@test issetequal(species(rs1), [A1, rs2.A2a, rs2.rs3.A3a])
342342
@test issetequal(parameters(rs1), [p1, rs2.p2a, rs2.p2b, rs2.rs3.p3a, rs2.ns3.p3b])
343-
@test issetequal(reactionparams(rs1), [p1, rs2.p2a, rs2.p2b, rs2.rs3.p3a])
343+
@test issetequal(reactionsystemparams(rs1), [p1, rs2.p2a, rs2.p2b, rs2.rs3.p3a])
344344
@test issetequal(rxs, reactions(rs1))
345345
@test issetequal(eqs, equations(rs1))
346346
@test Catalyst.combinatoric_ratelaws(rs1)

test/dsl/dsl_advanced_model_construction.jl

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

4141
rn = @reaction_network name begin

test/miscellaneous_tests/api.jl

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

86-
# Tests `reactionparamsmap`, `reactionrates`, and `symmap_to_varmap` getters.
86+
# Tests `reactionsystemparamsmap`, `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(reactionparamsmap(rn), Dict([p => 1, d => 2, kB => 3, kD => 4]))
93+
isequal(reactionsystemparamsmap(rn), Dict([p => 1, d => 2, kB => 3, kD => 4]))
9494
issetequal(reactionrates(rn), [p, d, kB, kD])
9595
isequal(symmap_to_varmap(rn, [:p => 1.0, :kB => 3.0]), [p => 1.0, kB => 3.0])
9696
end

test/reactionsystem_core/coupled_equation_crn_systems.jl

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

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

258258
# Check other accessors.
259259
@test !isspatial(coupled_rs)

0 commit comments

Comments
 (0)