Skip to content

Commit c383597

Browse files
committed
up
1 parent 0aba5f9 commit c383597

File tree

9 files changed

+85
-76
lines changed

9 files changed

+85
-76
lines changed

HISTORY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ rn = @reaction_network begin
2424
@parameters η
2525
k, 2X --> X2, [noise_scaling=η]
2626
end
27-
get_noise_scaling(rn)
27+
getnoisescaling(rn)
2828
```
2929
- `SDEProblem` no longer takes the `noise_scaling` argument (see above for new approach to handle noise scaling).
3030
- Changed fields of internal `Reaction` structure. `ReactionSystems`s saved using `serialize` on previous Catalyst versions cannot be loaded using this (or later) versions.

docs/pages.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@ pages = Any[
88
"Model Creation and Properties" => Any[
99
"model_creation/dsl_basics.md",
1010
"model_creation/dsl_advanced.md",
11-
"model_creation/programmatic_CRN_construction.md",
12-
"model_creation/compositional_modeling.md",
13-
"model_creation/constraint_equations.md",
11+
#"model_creation/programmatic_CRN_construction.md",
12+
#"model_creation/compositional_modeling.md",
13+
#"model_creation/constraint_equations.md",
1414
# Events.
15-
"model_creation/parametric_stoichiometry.md",# Distributed parameters, rates, and initial conditions.
15+
#"model_creation/parametric_stoichiometry.md",# Distributed parameters, rates, and initial conditions.
1616
# Loading and writing models to files.
1717
# Model visualisation.
1818
"model_creation/network_analysis.md",
1919
"model_creation/chemistry_related_functionality.md",
2020
"Model creation examples" => Any[
2121
"model_creation/examples/basic_CRN_library.md",
2222
"model_creation/examples/programmatic_generative_linear_pathway.md",
23-
"model_creation/examples/hodgkin_huxley_equation.md",
24-
"model_creation/examples/smoluchowski_coagulation_equation.md"
23+
#"model_creation/examples/hodgkin_huxley_equation.md",
24+
#"model_creation/examples/smoluchowski_coagulation_equation.md"
2525
]
2626
],
2727
"Model simulation" => Any[
@@ -67,6 +67,6 @@ pages = Any[
6767
# # Contributor's guide.
6868
# # Repository structure.
6969
# ],
70-
"FAQs" => "faqs.md",
71-
"API" => "api.md"
70+
#"FAQs" => "faqs.md",
71+
#"API" => "api.md"
7272
]

docs/src/assets/Project.toml

Lines changed: 33 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
11
[deps]
2+
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
23
BifurcationKit = "0f109fa4-8a5d-4b75-95aa-f515264e7665"
4+
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
35
Catalyst = "479239e8-5488-4da2-87a7-35f2df7eef83"
46
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
57
DiffEqParamEstim = "1130ab10-4a5a-5621-a13d-e4788d82bd4c"
6-
DifferentialEquations = "0c46a032-eb83-5123-abaf-570d42b7fbaa"
78
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
89
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
10+
DynamicalSystems = "61744808-ddfa-5f27-97ff-6e42cc95d634"
11+
GlobalSensitivity = "af5da776-676b-467e-8baf-acd8249e4f0f"
912
HomotopyContinuation = "f213a82b-91d6-5c5d-acf7-10f1c761b327"
13+
IncompleteLU = "40713840-3770-5561-ab4c-a76e7d0d7895"
14+
JumpProcesses = "ccbc3e58-028d-4f4c-8cd5-9ae44345cda5"
1015
Latexify = "23fbe1c1-3f47-55db-b15f-69d7ec21a316"
16+
LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae"
1117
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
1218
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
1319
NonlinearSolve = "8913a72c-1f9b-4ce2-8d82-65094dcecaec"
1420
Optim = "429524aa-4258-5aef-a3af-852621145aeb"
1521
Optimization = "7f7a1694-90dd-40f0-9382-eb1efda571ba"
22+
OptimizationBBO = "3e6eede4-6085-4f62-9a71-46d9bc1eb92b"
1623
OptimizationNLopt = "4e6fcdb7-1186-4e1f-a706-475e75c168bb"
1724
OptimizationOptimJL = "36348300-93cb-4f02-beb5-3c3902f8871e"
1825
OptimizationOptimisers = "42dfb2eb-d2b4-4451-abcd-913932933ac1"
@@ -21,37 +28,39 @@ Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
2128
QuasiMonteCarlo = "8a4e6c94-4038-4cdc-81c3-7e6ffdb2a71b"
2229
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
2330
SciMLSensitivity = "1ed8b502-d754-442c-8d5d-10ac956f44a1"
24-
Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46"
2531
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
2632
SteadyStateDiffEq = "9672c7b4-1e72-59bd-8a11-6ac3964bc41f"
2733
StochasticDiffEq = "789caeaf-c7a9-5a7d-9973-96adeb23e2a0"
2834
StructuralIdentifiability = "220ca800-aa68-49bb-acd8-6037fa93a544"
2935
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
3036

3137
[compat]
38+
BenchmarkTools = "1.5"
3239
BifurcationKit = "0.3"
40+
CairoMakie = "0.12"
3341
Catalyst = "13"
34-
DataFrames = "1"
35-
DiffEqParamEstim = "2.1"
36-
DifferentialEquations = "7.7"
42+
DataFrames = "1.6"
43+
DiffEqParamEstim = "2.2"
3744
Distributions = "0.25"
3845
Documenter = "1.4.1"
39-
HomotopyContinuation = "2.6"
40-
Latexify = "0.15, 0.16"
41-
ModelingToolkit = "9.5"
42-
NonlinearSolve = "3.4.0"
43-
Optim = "1"
44-
Optimization = "3.19"
45-
OptimizationNLopt = "0.1.8"
46-
OptimizationOptimJL = "0.1.14"
47-
OptimizationOptimisers = "0.1.1"
48-
OrdinaryDiffEq = "6"
49-
Plots = "1.36"
50-
SciMLBase = "2.13"
51-
SciMLSensitivity = "7.19"
52-
Setfield = "1.1"
53-
SpecialFunctions = "2.1"
54-
SteadyStateDiffEq = "2.0.1"
55-
StochasticDiffEq = "6"
56-
StructuralIdentifiability = "0.5.1"
57-
Symbolics = "5.14"
46+
DynamicalSystems = "3.3"
47+
GlobalSensitivity = "2.6"
48+
HomotopyContinuation = "2.9"
49+
IncompleteLU = "0.2"
50+
JumpProcesses = "9.11"
51+
Latexify = "0.16"
52+
LinearSolve = "2.30"
53+
ModelingToolkit = "9.15"
54+
NonlinearSolve = "3.12"
55+
Optim = "1.9"
56+
Optimization = "3.25"
57+
OrdinaryDiffEq = "6.80.1"
58+
Plots = "1.40"
59+
QuasiMonteCarlo = "0.3"
60+
SciMLBase = "2.39"
61+
SciMLSensitivity = "7.60"
62+
SpecialFunctions = "2.4"
63+
SteadyStateDiffEq = "2.2"
64+
StochasticDiffEq = "6.65"
65+
StructuralIdentifiability = "0.5.7"
66+
Symbolics = "5.28"

src/Catalyst.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ end
9393
include("reaction.jl")
9494
export isspecies
9595
export Reaction
96-
export get_noise_scaling, has_noise_scaling
9796

9897
# The `ReactionSystem` structure and its functions.
9998
include("reactionsystem.jl")

src/reaction.jl

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -377,8 +377,8 @@ function ModelingToolkit.get_variables!(set, rx::Reaction)
377377
for stoichs in (rx.substoich, rx.prodstoich), stoich in stoichs
378378
(stoich isa BasicSymbolic) && get_variables!(set, stoich)
379379
end
380-
if has_noise_scaling(rx)
381-
get_variables!(set, get_noise_scaling(rx))
380+
if hasnoisescaling(rx)
381+
get_variables!(set, getnoisescaling(rx))
382382
end
383383
return (set isa AbstractVector) ? unique!(set) : set
384384
end
@@ -440,7 +440,7 @@ end
440440

441441

442442
### Reaction Metadata Implementation ###
443-
# These are currently considered internal, but can be used by public accessor functions like get_noise_scaling.
443+
# These are currently considered internal, but can be used by public accessor functions like getnoisescaling.
444444

445445
"""
446446
getmetadata_dict(reaction::Reaction)
@@ -507,7 +507,7 @@ end
507507

508508
# Noise scaling.
509509
"""
510-
has_noise_scaling(reaction::Reaction)
510+
hasnoisescaling(reaction::Reaction)
511511
512512
Returns `true` if the input reaction has the `noise_scaing` metadata field assigned, else `false`.
513513
@@ -517,15 +517,15 @@ Arguments:
517517
Example:
518518
```julia
519519
reaction = @reaction k, 0 --> X, [noise_scaling=0.0]
520-
has_noise_scaling(reaction)
520+
hasnoisescaling(reaction)
521521
```
522522
"""
523-
function has_noise_scaling(reaction::Reaction)
523+
function hasnoisescaling(reaction::Reaction)
524524
return hasmetadata(reaction, :noise_scaling)
525525
end
526526

527527
"""
528-
get_noise_scaling(reaction::Reaction)
528+
getnoisescaling(reaction::Reaction)
529529
530530
Returns `noise_scaing` metadata field for the input reaction.
531531
@@ -535,11 +535,11 @@ Arguments:
535535
Example:
536536
```julia
537537
reaction = @reaction k, 0 --> X, [noise_scaling=0.0]
538-
get_noise_scaling(reaction)
538+
getnoisescaling(reaction)
539539
```
540540
"""
541-
function get_noise_scaling(reaction::Reaction)
542-
if has_noise_scaling(reaction)
541+
function getnoisescaling(reaction::Reaction)
542+
if hasnoisescaling(reaction)
543543
return getmetadata(reaction, :noise_scaling)
544544
else
545545
error("Attempts to access noise_scaling metadata field for a reaction which does not have a value assigned for this metadata.")
@@ -548,7 +548,7 @@ end
548548

549549
# Description.
550550
"""
551-
has_description(reaction::Reaction)
551+
hasdescription(reaction::Reaction)
552552
553553
Returns `true` if the input reaction has the `description` metadata field assigned, else `false`.
554554
@@ -558,15 +558,15 @@ Arguments:
558558
Example:
559559
```julia
560560
reaction = @reaction k, 0 --> X, [description="A reaction"]
561-
has_description(reaction)
561+
hasdescription(reaction)
562562
```
563563
"""
564-
function has_description(reaction::Reaction)
564+
function hasdescription(reaction::Reaction)
565565
return hasmetadata(reaction, :description)
566566
end
567567

568568
"""
569-
get_description(reaction::Reaction)
569+
getdescription(reaction::Reaction)
570570
571571
Returns `description` metadata field for the input reaction.
572572
@@ -576,11 +576,11 @@ Arguments:
576576
Example:
577577
```julia
578578
reaction = @reaction k, 0 --> X, [description="A reaction"]
579-
get_description(reaction)
579+
getdescription(reaction)
580580
```
581581
"""
582-
function get_description(reaction::Reaction)
583-
if has_description(reaction)
582+
function getdescription(reaction::Reaction)
583+
if hasdescription(reaction)
584584
return getmetadata(reaction, :description)
585585
else
586586
error("Attempts to access `description` metadata field for a reaction which does not have a value assigned for this metadata.")
@@ -589,7 +589,7 @@ end
589589

590590
# Misc.
591591
"""
592-
has_misc(reaction::Reaction)
592+
hasmisc(reaction::Reaction)
593593
594594
Returns `true` if the input reaction has the `misc` metadata field assigned, else `false`.
595595
@@ -599,15 +599,15 @@ Arguments:
599599
Example:
600600
```julia
601601
reaction = @reaction k, 0 --> X, [misc="A reaction"]
602-
misc(reaction)
602+
hasmisc(reaction)
603603
```
604604
"""
605-
function has_misc(reaction::Reaction)
605+
function hasmisc(reaction::Reaction)
606606
return hasmetadata(reaction, :misc)
607607
end
608608

609609
"""
610-
get_misc(reaction::Reaction)
610+
getmisc(reaction::Reaction)
611611
612612
Returns `misc` metadata field for the input reaction.
613613
@@ -617,7 +617,7 @@ Arguments:
617617
Example:
618618
```julia
619619
reaction = @reaction k, 0 --> X, [misc="A reaction"]
620-
get_misc(reaction)
620+
getmisc(reaction)
621621
```
622622
623623
Notes:
@@ -629,7 +629,7 @@ creating a `ReactionSystem` programmatically (in which case any symbolic variabl
629629
630630
"""
631631
function get_misc(reaction::Reaction)
632-
if has_misc(reaction)
632+
if hasmisc(reaction)
633633
return getmetadata(reaction, :misc)
634634
else
635635
error("Attempts to access `misc` metadata field for a reaction which does not have a value assigned for this metadata.")

src/reactionsystem.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ function make_ReactionSystem_internal(rxs_and_eqs::Vector, iv, us_in, ps_in; spa
497497
end
498498

499499
# Extract all quantities encountered in relevant `Reaction` metadata.
500-
has_noise_scaling(rx) && findvars!(ps, us, get_noise_scaling(rx), ivs, vars)
500+
hasnoisescaling(rx) && findvars!(ps, us, getnoisescaling(rx), ivs, vars)
501501
end
502502

503503
# Extracts any species, variables, and parameters that occur in (non-reaction) equations.

src/reactionsystem_conversions.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ function assemble_diffusion(rs, sts, ispcs; combinatoric_ratelaws = true,
121121

122122
for (j, rx) in enumerate(get_rxs(rs))
123123
rlsqrt = sqrt(abs(oderatelaw(rx; combinatoric_ratelaw = combinatoric_ratelaws)))
124-
has_noise_scaling(rx) && (rlsqrt *= get_noise_scaling(rx))
124+
hasnoisescaling(rx) && (rlsqrt *= getnoisescaling(rx))
125125
remove_conserved && (rlsqrt = substitute(rlsqrt, depspec_submap))
126126

127127
for (spec, stoich) in rx.netstoich

test/reactionsystem_core/reaction.jl

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,10 @@ let
116116
r1 = Reaction(k, [X], [X2], [2], [1])
117117
r2 = Reaction(k, [X], [X2], [2], [1]; metadata=[:noise_scaling => η])
118118

119-
@test !Catalyst.has_noise_scaling(r1)
120-
@test Catalyst.has_noise_scaling(r2)
121-
@test_throws Exception Catalyst.get_noise_scaling(r1)
122-
@test isequal(Catalyst.get_noise_scaling(r2), η)
119+
@test !Catalyst.hasnoisescaling(r1)
120+
@test Catalyst.hasnoisescaling(r2)
121+
@test_throws Exception Catalyst.getnoisescaling(r1)
122+
@test isequal(Catalyst.getnoisescaling(r2), η)
123123
end
124124

125125
# Tests the description metadata.
@@ -131,10 +131,10 @@ let
131131
r1 = Reaction(k, [X], [X2], [2], [1])
132132
r2 = Reaction(k, [X], [X2], [2], [1]; metadata=[:description => "A reaction"])
133133

134-
@test !Catalyst.has_description(r1)
135-
@test Catalyst.has_description(r2)
136-
@test_throws Exception Catalyst.get_description(r1)
137-
@test isequal(Catalyst.get_description(r2), "A reaction")
134+
@test !Catalyst.hasdescription(r1)
135+
@test Catalyst.hasdescription(r2)
136+
@test_throws Exception Catalyst.getdescription(r1)
137+
@test isequal(Catalyst.getdescription(r2), "A reaction")
138138
end
139139

140140
# Tests the misc metadata.
@@ -146,8 +146,8 @@ let
146146
r1 = Reaction(k, [X], [X2], [2], [1])
147147
r2 = Reaction(k, [X], [X2], [2], [1]; metadata=[:misc => ('M', :M)])
148148

149-
@test !Catalyst.has_misc(r1)
150-
@test Catalyst.has_misc(r2)
151-
@test_throws Exception Catalyst.get_misc(r1)
152-
@test isequal(Catalyst.get_misc(r2), ('M', :M))
149+
@test !Catalyst.hasmisc(r1)
150+
@test Catalyst.hasmisc(r2)
151+
@test_throws Exception Catalyst.getmisc(r1)
152+
@test isequal(Catalyst.getmisc(r2), ('M', :M))
153153
end

test/simulation_and_solving/simulate_SDEs.jl

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

33
# Fetch packages.
44
using Catalyst, Statistics, StochasticDiffEq, Test
5+
using Catalyst: getnoisescaling
56

67
# Sets stable rng number.
78
using StableRNGs
@@ -325,8 +326,8 @@ let
325326
@test issetequal([X, H], species(rs))
326327
@test issetequal([X, H, h], unknowns(rs))
327328
@test issetequal([p, d, η], parameters(rs))
328-
@test isequal(get_noise_scaling(reactions(rs)[1]), η*H + 1)
329-
@test isequal(get_noise_scaling(reactions(rs)[2]), h)
329+
@test isequal(getnoisescaling(reactions(rs)[1]), η*H + 1)
330+
@test isequal(getnoisescaling(reactions(rs)[2]), h)
330331
end
331332

332333
# Tests the `remake_noise_scaling` function.
@@ -369,9 +370,9 @@ let
369370

370371
# Checks that systems have the correct noise scaling terms.
371372
rn = set_default_noise_scaling(rn, 0.5)
372-
rn1_noise_scaling = [get_noise_scaling(rx) for rx in Catalyst.get_rxs(rn)]
373-
rn2_noise_scaling = [get_noise_scaling(rx) for rx in Catalyst.get_rxs(Catalyst.get_systems(rn)[1])]
374-
rn_noise_scaling = [get_noise_scaling(rx) for rx in reactions(rn)]
373+
rn1_noise_scaling = [getnoisescaling(rx) for rx in Catalyst.get_rxs(rn)]
374+
rn2_noise_scaling = [getnoisescaling(rx) for rx in Catalyst.get_rxs(Catalyst.get_systems(rn)[1])]
375+
rn_noise_scaling = [getnoisescaling(rx) for rx in reactions(rn)]
375376
@test issetequal(rn1_noise_scaling, [2.0, 0.5])
376377
@test issetequal(rn2_noise_scaling, [5.0, 0.5])
377378
@test issetequal(rn_noise_scaling, [2.0, 0.5, 5.0, 0.5])

0 commit comments

Comments
 (0)