Skip to content

Commit 8ef7273

Browse files
authored
Merge branch 'master' into record_broken_tests
2 parents a02a8fc + a140f53 commit 8ef7273

37 files changed

+390
-319
lines changed

Project.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ DomainSets = "5b8099bc-c8ec-5219-889f-1d9e522a28bf"
6767
Graphviz_jll = "3c863552-8265-54e4-a6dc-903eb78fde85"
6868
HomotopyContinuation = "f213a82b-91d6-5c5d-acf7-10f1c761b327"
6969
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
70+
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
7071
NonlinearSolve = "8913a72c-1f9b-4ce2-8d82-65094dcecaec"
7172
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
7273
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
@@ -83,4 +84,4 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
8384
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
8485

8586
[targets]
86-
test = ["BifurcationKit", "DiffEqCallbacks", "DomainSets", "Graphviz_jll", "HomotopyContinuation", "NonlinearSolve", "OrdinaryDiffEq", "Plots", "Random", "SafeTestsets", "SciMLBase", "SciMLNLSolve", "StableRNGs", "Statistics", "SteadyStateDiffEq", "StochasticDiffEq", "StructuralIdentifiability", "Test", "Unitful"]
87+
test = ["BifurcationKit", "DiffEqCallbacks", "DomainSets", "Graphviz_jll", "HomotopyContinuation", "Logging", "NonlinearSolve", "OrdinaryDiffEq", "Plots", "Random", "SafeTestsets", "SciMLBase", "SciMLNLSolve", "StableRNGs", "Statistics", "SteadyStateDiffEq", "StochasticDiffEq", "StructuralIdentifiability", "Test", "Unitful"]

docs/make.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ makedocs(sitename = "Catalyst.jl",
4141
clean = true,
4242
pages = pages,
4343
pagesonly = true,
44-
warnonly = [:missing_docs])
44+
warnonly = true)
4545

4646
deploydocs(repo = "github.com/SciML/Catalyst.jl.git";
4747
push_preview = true)

docs/src/assets/Project.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ IncompleteLU = "0.2"
5151
JumpProcesses = "9.11"
5252
Latexify = "0.16"
5353
LinearSolve = "2.30"
54-
ModelingToolkit = "9.15"
54+
ModelingToolkit = "9.16.0"
5555
NonlinearSolve = "3.12"
5656
Optim = "1.9"
5757
Optimization = "3.25"
@@ -68,5 +68,5 @@ SpecialFunctions = "2.4"
6868
StaticArrays = "1.9"
6969
SteadyStateDiffEq = "2.2"
7070
StochasticDiffEq = "6.65"
71-
StructuralIdentifiability = "0.5.7"
72-
Symbolics = "5.28"
71+
StructuralIdentifiability = "0.5.8"
72+
Symbolics = "5.30.1"

docs/src/introduction_to_catalyst/introduction_to_catalyst.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ Gillespie's `Direct` method, and then solve it to generate one realization of
182182
the jump process:
183183

184184
```@example tut1
185-
# imports the JumpProcesses packages
185+
# imports the JumpProcesses packages
186186
using JumpProcesses
187187
188188
# redefine the initial condition to be integer valued
@@ -361,4 +361,4 @@ and the ODE model
361361

362362
---
363363
## References
364-
[^1]: [Torkel E. Loman, Yingbo Ma, Vasily Ilin, Shashi Gowda, Niklas Korsbo, Nikhil Yewale, Chris Rackauckas, Samuel A. Isaacson, *Catalyst: Fast and flexible modeling of reaction networks*, PLOS Computational Biology (2023).](https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1011530)
364+
1. [Torkel E. Loman, Yingbo Ma, Vasily Ilin, Shashi Gowda, Niklas Korsbo, Nikhil Yewale, Chris Rackauckas, Samuel A. Isaacson, *Catalyst: Fast and flexible modeling of reaction networks*, PLOS Computational Biology (2023).](https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1011530)

docs/src/model_creation/dsl_advanced.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# [The Catalyst DSL - Advanced Features and Options](@id dsl_advanced_options)
22
Within the Catalyst DSL, each line can represent either *a reaction* or *an option*. The [previous DSL tutorial](@ref dsl_description) described how to create reactions. This one will focus on options. These are typically used to supply a model with additional information. Examples include the declaration of initial condition/parameter default values, or the creation of observables.
33

4-
All option designations begin with a declaration starting with `@`, followed by its input. E.g. the `@observables` option allows for the generation of observables. Each option can only be used once within each use of `@reaction_network`. A full list of options can be found [here](@ref ref), with most (but not all) being described in more detail below. This tutorial will also describe some additional advanced DSL features that do not involve using an option.
4+
All option designations begin with a declaration starting with `@`, followed by its input. E.g. the `@observables` option allows for the generation of observables. Each option can only be used once within each use of `@reaction_network`. This tutorial will also describe some additional advanced DSL features that do not involve using an option.
55

66
As a first step, we import Catalyst (which is required to run the tutorial):
77
```@example dsl_advanced_explicit_definitions
@@ -130,7 +130,6 @@ oprob = ODEProblem(rn, u0, tspan, p)
130130
sol = solve(oprob)
131131
plot(sol)
132132
```
133-
API for checking the default values of species and parameters can be found [here](@ref ref).
134133

135134
### [Setting parametric initial conditions](@id dsl_advanced_options_parametric_initial_conditions)
136135
In the previous section, we designated default values for initial conditions and parameters. However, the right-hand side of the designation accepts any valid expression (not only numeric values). While this can be used to set up some advanced default values, the most common use case is to designate a species's initial condition as a parameter. E.g. in the following example we represent the initial condition of `X` using the parameter `X₀`.
@@ -198,13 +197,11 @@ two_state_system = @reaction_network begin
198197
end
199198
```
200199

201-
Each metadata has its own getter functions. E.g. we can get the description of the parameter `kA` using `ModelingToolkit.getdescription` (here we use [system indexing](@ref ref) to access the parameter):
200+
Each metadata has its own getter functions. E.g. we can get the description of the parameter `kA` using `ModelingToolkit.getdescription`:
202201
```@example dsl_advanced_metadata
203202
ModelingToolkit.getdescription(two_state_system.kA)
204203
```
205204

206-
It is not possible for the user to directly designate their own metadata. These have to first be added to Catalyst. Doing so is somewhat involved, and described in detail [here](@ref ref). A full list of metadata that can be used for species and/or parameters can be found [here](@ref ref).
207-
208205
### [Designating constant-valued/fixed species parameters](@id dsl_advanced_options_constant_species)
209206

210207
Catalyst enables the designation of parameters as `constantspecies`. These parameters can be used as species in reactions, however, their values are not changed by the reaction and remain constant throughout the simulation (unless changed by e.g. the [occurrence of an event]@ref constraint_equations_events). Practically, this is done by setting the parameter's `isconstantspecies` metadata to `true`. Here, we create a simple reaction where the species `X` is converted to `Xᴾ` at rate `k`. By designating `X` as a constant species parameter, we ensure that its quantity is unchanged by the occurrence of the reaction.
@@ -391,11 +388,11 @@ Some final notes regarding observables:
391388
- The left-hand side of the observable declaration must contain a single symbol only (with the exception of metadata, which can also be supplied).
392389
- All quantities appearing on the right-hand side must be declared elsewhere within the `@reaction_network` call (either by being part of a reaction, or through the `@species`, `@parameters`, or `@variables` options).
393390
- Observables may not depend on other observables.
394-
- Observables have their [dependent variable(s)](@ref ref) automatically assigned as the union of the dependent variables of the species and variables on which it depends.
391+
- Observables have their dependent variable(s) automatically assigned as the union of the dependent variables of the species and variables on which it depends.
395392

396393
## [Specifying non-time independent variables](@id dsl_advanced_options_ivs)
397394

398-
As [described elsewhere](@ref ref), Catalyst's `ReactionSystem` models depend on a *time independent variable*, and potentially one or more *spatial independent variables*. By default, the independent variable `t` is used. We can declare another independent variable (which is automatically used as the default one) using the `@ivs` option. E.g. to use `τ` instead of `t` we can use
395+
Catalyst's `ReactionSystem` models depend on a *time independent variable*, and potentially one or more *spatial independent variables*. By default, the independent variable `t` is used. We can declare another independent variable (which is automatically used as the default one) using the `@ivs` option. E.g. to use `τ` instead of `t` we can use
399396
```@example dsl_advanced_ivs
400397
using Catalyst # hide
401398
rn = @reaction_network begin
@@ -466,5 +463,3 @@ A reaction's metadata can be accessed using specific functions, e.g. `Catalyst.h
466463
rx = @reaction p, 0 --> X, [description="A production reaction"]
467464
Catalyst.getdescription(rx)
468465
```
469-
470-
A list of all available reaction metadata can be found [here](@ref ref).

docs/src/model_creation/dsl_basics.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# [The Catalyst DSL - Introduction](@id dsl_description)
22
In the [introduction to Catalyst](@ref introduction_to_catalyst) we described how the `@reaction_network` [macro](https://docs.julialang.org/en/v1/manual/metaprogramming/#man-macros) can be used to create chemical reaction network (CRN) models. This macro enables a so-called [domain-specific language](https://en.wikipedia.org/wiki/Domain-specific_language) (DSL) for creating CRN models. This tutorial will give a basic introduction on how to create Catalyst models using this macro (from now onwards called "*the Catalyst DSL*"). A [follow-up tutorial](@ref dsl_advanced_options) will describe some of the DSL's more advanced features.
33

4-
The Catalyst DSL generates a [`ReactionSystem`](@ref) (the [julia structure](https://docs.julialang.org/en/v1/manual/types/#Composite-Types) Catalyst uses to represent CRN models). These can be created through alternative methods (e.g. [programmatically](@ref programmatic_CRN_construction) or [compositionally](@ref compositional_modeling)). A summary of the various ways to create `ReactionSystems`s can be found [here](@ref ref). [Previous](@ref introduction_to_catalyst) and [following](@ref simulation_intro) tutorials describe how to simulate models once they have been created using the DSL. This tutorial will solely focus on model creation.
4+
The Catalyst DSL generates a [`ReactionSystem`](@ref) (the [julia structure](https://docs.julialang.org/en/v1/manual/types/#Composite-Types) Catalyst uses to represent CRN models). These can be created through alternative methods (e.g. [programmatically](@ref programmatic_CRN_construction) or [compositionally](@ref compositional_modeling)). [Previous](@ref introduction_to_catalyst) and [following](@ref simulation_intro) tutorials describe how to simulate models once they have been created using the DSL. This tutorial will solely focus on model creation.
55

66
Before we begin, we will first load the Catalyst package (which is required to run the code).
77
```@example dsl_basics_intro
@@ -217,7 +217,7 @@ latexify(rn_13_alt; form=:ode)
217217
```
218218
Here, while these models will generate identical ODE, SDE, and jump simulations, the chemical reaction network models themselves are not equivalent. Generally, as pointed out in the two notes below, using the second form is preferable.
219219
!!! warn
220-
While `rn_13` and `rn_13_alt` will generate equivalent simulations, for jump simulations, the first model will have [reduced performance](@ref ref) (which generally are more performant when rates are constant).
220+
While `rn_13` and `rn_13_alt` will generate equivalent simulations, for jump simulations, the first model will have reduced performance (which generally are more performant when rates are constant).
221221

222222
!!! danger
223223
Catalyst automatically infers whether quantities appearing in the DSL are species or parameters (as described [here](@ref dsl_advanced_options_declaring_species_and_parameters)). Generally, anything that does not appear as a reactant is inferred to be a parameter. This means that if you want to model a reaction activated by a species (e.g. `kp*A, 0 --> P`), but that species does not occur as a reactant, it will be interpreted as a parameter. This can be handled by [manually declaring the system species](@ref dsl_advanced_options_declaring_species_and_parameters).
@@ -282,7 +282,7 @@ end
282282
```
283283

284284
!!! warn
285-
Jump simulations cannot be performed for models with time-dependent rates without additional considerations, which are discussed [here](@ref ref).
285+
Jump simulations cannot be performed for models with time-dependent rates without additional considerations.
286286

287287
## [Non-standard stoichiometries](@id dsl_description_stoichiometries)
288288

@@ -294,7 +294,7 @@ rn_16 = @reaction_network begin
294294
d, X --> 0
295295
end
296296
```
297-
It is also possible to have non-integer stoichiometric coefficients for substrates. However, in this case the [`combinatoric_ratelaw = false`](@ref ref) option must be used. We note that non-integer stoichiometric coefficients do not make sense in most fields, however, this feature is available for use for models where it does make sense.
297+
It is also possible to have non-integer stoichiometric coefficients for substrates. However, in this case the `combinatoric_ratelaw = false` option must be used. We note that non-integer stoichiometric coefficients do not make sense in most fields, however, this feature is available for use for models where it does make sense.
298298

299299
### [Parametric stoichiometries](@id dsl_description_stoichiometries_parameters)
300300
It is possible for stoichiometric coefficients to be parameters. E.g. here we create a generic polymerisation system where `n` copies of `X` bind to form `Xn`:
@@ -368,4 +368,4 @@ It should be noted that the following symbols are *not permitted* to be used as
368368
- `` ([used for production/degradation reactions](@ref dsl_description_symbols_empty_set)).
369369
- `im` (used in Julia to represent [complex numbers](https://docs.julialang.org/en/v1/manual/complex-and-rational-numbers/#Complex-Numbers)).
370370
- `nothing` (used in Julia to denote [nothing](https://docs.julialang.org/en/v1/base/constants/#Core.nothing)).
371-
- `Γ` (used by Catalyst to represent [conserved quantities](@ref ref)).
371+
- `Γ` (used by Catalyst to represent conserved quantities).

docs/src/model_creation/examples/basic_CRN_library.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ oplt = plot(osol; idxs = X₁ + X₂, title = "Reaction rate equation (ODE)")
7979
splt = plot(ssol; idxs = X₁ + X₂, title = "Chemical Langevin equation (SDE)")
8080
plot(oplt, splt; lw = 3, ylimit = (99,101), size = (800,450), layout = (2,1))
8181
```
82-
Catalyst has special methods for working with conserved quantities, which are described [here](@ref ref).
8382

8483
## [Michaelis-Menten enzyme kinetics](@id basic_CRN_library_mm)
8584
[Michaelis-Menten enzyme kinetics](https://en.wikipedia.org/wiki/Michaelis%E2%80%93Menten_kinetics) is a simple description of an enzyme ($E$) transforming a substrate ($S$) into a product ($P$). Under certain assumptions, it can be simplified to a single function (a Michaelis-Menten function) and used as a reaction rate. Here we instead present the full system model:

docs/src/model_creation/examples/programmatic_generative_linear_pathway.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ plot!(sol_n10; idxs = :X10, label = "n = 10")
7777
## [Modelling linear pathways using programmatic, generative, modelling](@id programmatic_generative_linear_pathway_generative)
7878
Above, we investigated the impact of linear pathways' lengths on their behaviours. Since the models were implemented using the DSL, we had to implement a new model for each pathway (in each case writing out all reactions). Here, we will instead show how [programmatic modelling](@ref programmatic_CRN_construction) can be used to generate pathways of arbitrary lengths.
7979

80-
First, we create a function, `generate_lp`, which creates a linear pathway model of length `n`. It utilises [*vector variables*](@ref ref) to create an arbitrary number of species, and also creates an [observable](@ref ref) for the final species of the chain.
80+
First, we create a function, `generate_lp`, which creates a linear pathway model of length `n`. It utilises *vector variables* to create an arbitrary number of species, and also creates an observable for the final species of the chain.
8181
```@example programmatic_generative_linear_pathway_generative
8282
using Catalyst # hide
8383
t = default_t()

docs/src/model_creation/examples/smoluchowski_coagulation_equation.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,6 @@ plot!(ϕ, sol[3,:] / Nₒ, line = (:dot, 4, :purple), label = "Analytical sol--X
147147

148148
---
149149
## References
150-
[^1]: [https://en.wikipedia.org/wiki/Smoluchowski\_coagulation\_equation](https://en.wikipedia.org/wiki/Smoluchowski_coagulation_equation)
151-
[^2]: Scott, W. T. (1968). Analytic Studies of Cloud Droplet Coalescence I, Journal of Atmospheric Sciences, 25(1), 54-65. Retrieved Feb 18, 2021, from https://journals.ametsoc.org/view/journals/atsc/25/1/1520-0469\_1968\_025\_0054\_asocdc\_2\_0\_co\_2.xml
152-
[^3]: Ian J. Laurenzi, John D. Bartels, Scott L. Diamond, A General Algorithm for Exact Simulation of Multicomponent Aggregation Processes, Journal of Computational Physics, Volume 177, Issue 2, 2002, Pages 418-449, ISSN 0021-9991, https://doi.org/10.1006/jcph.2002.7017.
150+
1. [https://en.wikipedia.org/wiki/Smoluchowski\_coagulation\_equation](https://en.wikipedia.org/wiki/Smoluchowski_coagulation_equation)
151+
2. Scott, W. T. (1968). Analytic Studies of Cloud Droplet Coalescence I, Journal of Atmospheric Sciences, 25(1), 54-65. Retrieved Feb 18, 2021, from https://journals.ametsoc.org/view/journals/atsc/25/1/1520-0469\_1968\_025\_0054\_asocdc\_2\_0\_co\_2.xml
152+
3. Ian J. Laurenzi, John D. Bartels, Scott L. Diamond, A General Algorithm for Exact Simulation of Multicomponent Aggregation Processes, Journal of Computational Physics, Volume 177, Issue 2, 2002, Pages 418-449, ISSN 0021-9991, https://doi.org/10.1006/jcph.2002.7017.

docs/src/model_creation/model_visualisation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Here, we note that the output of `latexify(brusselator)` is identical to how a m
2424
latexify(brusselator; form = :ode)
2525
```
2626
!!! note
27-
Internally, `latexify(brusselator; form = :ode)` calls `latexify(convert(ODESystem, brusselator))`. Hence, if you have already [generated the `ODESystem` corresponding to your model](@ref ref), it can be used directly as input to `latexify`.
27+
Internally, `latexify(brusselator; form = :ode)` calls `latexify(convert(ODESystem, brusselator))`. Hence, if you have already generated the `ODESystem` corresponding to your model, it can be used directly as input to `latexify`.
2828

2929
!!! note
3030
It should be possible to also generate SDEs through the `form = :sde` input. This feature is, however, currently broken.

0 commit comments

Comments
 (0)