Skip to content

Commit 829da0f

Browse files
committed
up
1 parent 11754dc commit 829da0f

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

docs/src/api/catalyst_api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ substoichmat
178178
prodstoichmat
179179
netstoichmat
180180
reactionrates
181-
get_metadata_vec
181+
get_metadata_dict
182182
has_metadata
183183
get_metadata
184184
```

src/Catalyst.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export mm, mmr, hill, hillr, hillar
8080
include("networkapi.jl")
8181
export species, nonspecies, reactionparams, reactions, speciesmap, paramsmap
8282
export numspecies, numreactions, numreactionparams, setdefaults!, symmap_to_varmap
83-
export get_metadata_vec, has_metadata, get_metadata
83+
export get_metadata_dict, has_metadata, get_metadata
8484
export make_empty_network, addspecies!, addparam!, addreaction!, reactionparamsmap
8585
export dependants, dependents, substoichmat, prodstoichmat, netstoichmat
8686
export conservationlaws, conservedquantities, conservedequations, conservationlaw_constants

src/reactionsystem.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,7 @@ end
854854
######################## Other accessors ##############################
855855

856856
"""
857-
get_metadata_vec(reaction::Reaction)
857+
get_metadata_dict(reaction::Reaction)
858858
859859
Retrives the `ImmutableDict` containing all of the metadata associated with a specific reaction.
860860
@@ -864,10 +864,10 @@ Arguments:
864864
Example:
865865
```julia
866866
reaction = @reaction k, 0 --> X, [noise_scaling=0.0]
867-
get_metadata_vec(reaction)
867+
get_metadata_dict(reaction)
868868
```
869869
"""
870-
function get_metadata_vec(reaction::Reaction)
870+
function get_metadata_dict(reaction::Reaction)
871871
return reaction.metadata
872872
end
873873

@@ -887,7 +887,7 @@ has_metadata(reaction, :noise_scaling)
887887
```
888888
"""
889889
function has_metadata(reaction::Reaction, md_key::Symbol)
890-
return any(isequal(md_key, entry[1]) for entry in get_metadata_vec(reaction))
890+
return any(isequal(md_key, entry[1]) for entry in get_metadata_dict(reaction))
891891
end
892892

893893
"""
@@ -907,9 +907,9 @@ get_metadata(reaction, :noise_scaling)
907907
"""
908908
function get_metadata(reaction::Reaction, md_key::Symbol)
909909
if !has_metadata(reaction, md_key)
910-
error("The reaction does not have a metadata field $md_key. It does have the following metadata fields: $(keys(get_metadata_vec(reaction))).")
910+
error("The reaction does not have a metadata field $md_key. It does have the following metadata fields: $(keys(get_metadata_dict(reaction))).")
911911
end
912-
return get_metadata_vec(reaction)[findfirst(isequal(md_key, entry[1]) for entry in get_metadata_vec(reaction))][2]
912+
return get_metadata_dict(reaction)[findfirst(isequal(md_key, entry[1]) for entry in get_metadata_dict(reaction))][2]
913913
end
914914

915915
######################## Conversion to ODEs/SDEs/jump, etc ##############################

test/dsl/dsl_basics.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,9 @@ let
169169
# Checks DSL reactions are correct.
170170
rxs = reactions(rs)
171171
@test isequal([r1, r2, r3], rxs)
172-
@test isequal(get_metadata_vec(r1), get_metadata_vec(rxs[1]))
173-
@test isequal(get_metadata_vec(r2), get_metadata_vec(rxs[2]))
174-
@test isequal(get_metadata_vec(r3), get_metadata_vec(rxs[3]))
172+
@test isequal(get_metadata_dict(r1), get_metadata_dict(rxs[1]))
173+
@test isequal(get_metadata_dict(r2), get_metadata_dict(rxs[2]))
174+
@test isequal(get_metadata_dict(r3), get_metadata_dict(rxs[3]))
175175

176176
# Checks that accessor functions works on the DSL.
177177
@test has_metadata(rxs[1], :noise_scaling)
@@ -190,9 +190,9 @@ let
190190
rx3 = @reaction k, 2X --> X2
191191

192192
@test isequal([rx1, rx2, rx3], rxs)
193-
@test isequal(get_metadata_vec(rx1), get_metadata_vec(rxs[1]))
194-
@test isequal(get_metadata_vec(rx2), get_metadata_vec(rxs[2]))
195-
@test isequal(get_metadata_vec(rx3), get_metadata_vec(rxs[3]))
193+
@test isequal(get_metadata_dict(rx1), get_metadata_dict(rxs[1]))
194+
@test isequal(get_metadata_dict(rx2), get_metadata_dict(rxs[2]))
195+
@test isequal(get_metadata_dict(rx3), get_metadata_dict(rxs[3]))
196196
end
197197

198198
# Checks that repeated metadata throws errors.

test/reactionsystem_structure/reactions.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ let
1616
metadata = [:noise_scaling => 0.0]
1717
r = Reaction(k, [X], [X2], [2], [1]; metadata=metadata)
1818

19-
@test get_metadata_vec(r) == [:noise_scaling => 0.0]
19+
@test get_metadata_dict(r) == [:noise_scaling => 0.0]
2020
@test has_metadata(r, :noise_scaling)
2121
@test !has_metadata(r, :nonexisting_metadata)
2222
@test get_metadata(r, :noise_scaling) == 0.0
@@ -36,7 +36,7 @@ let
3636
r2 = Reaction(k, [X], [X2], [2], [1]; metadata=metadata)
3737

3838
@test isequal(r1, r2)
39-
@test get_metadata_vec(r1) == Pair{Symbol,Any}[]
39+
@test get_metadata_dict(r1) == Pair{Symbol,Any}[]
4040
@test !has_metadata(r1, :md)
4141
end
4242

@@ -57,7 +57,7 @@ let
5757
push!(metadata, :md_6 => (0.1, 2.0))
5858
r = Reaction(k, [X], [X2], [2], [1]; metadata=metadata)
5959

60-
@test get_metadata_vec(r) isa Vector{Pair{Symbol,Any}}
60+
@test get_metadata_dict(r) isa Vector{Pair{Symbol,Any}}
6161
@test has_metadata(r, :md_1)
6262
@test has_metadata(r, :md_2)
6363
@test has_metadata(r, :md_3)

0 commit comments

Comments
 (0)