Skip to content

Commit 86e7503

Browse files
committed
rework docs a bit to reduce runtimes
1 parent 635e824 commit 86e7503

19 files changed

+441
-108
lines changed

docs/pages.jl

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
pages = Any[
2-
"Home" => "home.md",
2+
"Home" => "index.md",
33
"Introduction to Catalyst" => Any[
44
"introduction_to_catalyst/catalyst_for_new_julia_users.md",
55
# "introduction_to_catalyst/introduction_to_catalyst.md"
@@ -14,11 +14,11 @@ pages = Any[
1414
# Events.
1515
#"model_creation/parametric_stoichiometry.md",# Distributed parameters, rates, and initial conditions.
1616
# Loading and writing models to files.
17-
# Model visualisation.
17+
"model_creation/model_visualisation.md",
1818
#"model_creation/network_analysis.md",
1919
"model_creation/chemistry_related_functionality.md",
2020
"Model creation examples" => Any[
21-
#"model_creation/examples/basic_CRN_library.md",
21+
"model_creation/examples/basic_CRN_library.md",
2222
"model_creation/examples/programmatic_generative_linear_pathway.md",
2323
#"model_creation/examples/hodgkin_huxley_equation.md",
2424
#"model_creation/examples/smoluchowski_coagulation_equation.md"
@@ -29,20 +29,20 @@ pages = Any[
2929
# Simulation introduction.
3030
"model_simulation/simulation_plotting.md",
3131
"model_simulation/simulation_structure_interfacing.md",
32-
#"model_simulation/ensemble_simulations.md",
32+
"model_simulation/ensemble_simulations.md",
3333
# Stochastic simulation statistical analysis.
34-
# "model_simulation/ode_simulation_performance.md",
35-
# # ODE Performance considerations/advice.
36-
# # SDE Performance considerations/advice.
37-
# # Jump Performance considerations/advice.
38-
# # Finite state projection
34+
"model_simulation/ode_simulation_performance.md",
35+
# ODE Performance considerations/advice.
36+
# SDE Performance considerations/advice.
37+
# Jump Performance considerations/advice.
38+
# Finite state projection
3939
],
4040
"Steady state analysis" => Any[
41-
# "steady_state_functionality/homotopy_continuation.md",
41+
"steady_state_functionality/homotopy_continuation.md",
4242
"steady_state_functionality/nonlinear_solve.md",
4343
"steady_state_functionality/steady_state_stability_computation.md",
44-
# "steady_state_functionality/bifurcation_diagrams.md",
45-
# "steady_state_functionality/dynamical_systems.md"
44+
"steady_state_functionality/bifurcation_diagrams.md",
45+
"steady_state_functionality/dynamical_systems.md"
4646
],
4747
"Inverse Problems" => Any[
4848
# Inverse problems introduction.

docs/src/assets/long_ploting_times/model_creation/mm_kinetics.svg

Lines changed: 128 additions & 0 deletions
Loading

docs/src/assets/long_ploting_times/model_creation/sir_outbreaks.svg

Lines changed: 128 additions & 0 deletions
Loading

docs/src/assets/long_ploting_times/model_simulation/incomplete_brusselator_simulation.svg

Lines changed: 54 additions & 0 deletions
Loading
File renamed without changes.

docs/src/introduction_to_catalyst/catalyst_for_new_julia_users.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,9 @@ using JumpProcesses
137137
```
138138

139139
This time, we will declare a so-called [SIR model for an infectious disease](@ref basic_CRN_library_sir). Note that even if this model does not describe a set of chemical reactions, it can be modelled using the same framework. The model consists of 3 species:
140-
* $S$, the amount of *susceptible* individuals.
141-
* $I$, the amount of *infected* individuals.
142-
* $R$, the amount of *recovered* (or *removed*) individuals.
140+
* *S*, the amount of *susceptible* individuals.
141+
* *I*, the amount of *infected* individuals.
142+
* *R*, the amount of *recovered* (or *removed*) individuals.
143143

144144
It also has 2 reaction events:
145145
* Infection, where a susceptible individual meets an infected individual and also becomes infected.
@@ -171,6 +171,7 @@ Previously we have bundled this information into an `ODEProblem` (denoting a det
171171
using JumpProcesses # hide
172172
dprob = DiscreteProblem(sir_model, u0, tspan, params)
173173
jprob = JumpProblem(sir_model, dprob, Direct())
174+
nothing # hide
174175
```
175176
Again, the order in which the inputs are given to the `DiscreteProblem` and the `JumpProblem` is important. The last argument to the `JumpProblem` (`Direct()`) denotes which simulation method we wish to use. For now, we recommend that users simply use the `Direct()` option, and then consider alternative ones (see the [JumpProcesses.jl docs](https://docs.sciml.ai/JumpProcesses/stable/)) when they are more familiar with modelling in Catalyst and Julia.
176177

@@ -199,7 +200,7 @@ This will:
199200
2. Switch your current Julia session to use the current folder's environment.
200201

201202
!!! note
202-
If you check any folder which has been designated as a Julia environment, it contains a Project.toml and a Manifest.toml file. These store all information regarding the corresponding environment. For non-advanced users, it is recommended to never touch these files directly (and instead do so using various functions from the Pkg package, the important ones which are described in the next two subsections).
203+
If you check any folder which has been designated as a Julia environment, it contains a Project.toml and a Manifest.toml file. These store all information regarding the corresponding environment. For non-advanced users, it is recommended to never touch these files directly (and instead do so using various functions from the Pkg package, the important ones which are described in the next two subsections).
203204

204205
### [Installing and importing packages in Julia](@id catalyst_for_new_julia_users_packages_installing)
205206
Package installation and import have been described [previously](@ref catalyst_for_new_julia_users_packages_intro). However, for the sake of this extended tutorial, let us repeat the description by demonstrating how to install the [Latexify.jl](https://github.com/korsbo/Latexify.jl) package (which enables e.g. displaying Catalyst models in Latex format). First, we import the Julia Package manager ([Pkg](https://github.com/JuliaLang/Pkg.jl)) (which is required to install Julia packages):
@@ -236,15 +237,15 @@ So, why is this required, and why cannot we simply import any package installed
236237
The reason why all this is important is that it is *highly recommended* to, for each project, define a separate environment. To these, only add the required packages. General-purpose environments with a large number of packages often, in the long term, produce package incompatibility issues. While these might not prevent you from installing all desired package, they often mean that you are unable to use the latest version of some packages.
237238

238239
!!! note
239-
A not-infrequent cause for reported errors with Catalyst (typically the inability to replicate code in tutorials) is package incompatibilities in large environments preventing the latest version of Catalyst from being installed. Hence, whenever an issue is encountered, it is useful to run `Pkg.status()` to check whenever the latest version of Catalyst is being used.
240+
A not-infrequent cause for reported errors with Catalyst (typically the inability to replicate code in tutorials) is package incompatibilities in large environments preventing the latest version of Catalyst from being installed. Hence, whenever an issue is encountered, it is useful to run `Pkg.status()` to check whenever the latest version of Catalyst is being used.
240241

241242
Some additional useful Pkg commands are:
242243
- `Pk.rm("PackageName")` removes a package from the current environment.
243244
- `Pkg.update("PackageName")`: updates the designated package.
244245
- `Pkg.update()`: updates all packages.
245246

246247
!!! note
247-
A useful feature of Julia's environment system is that enables the exact definition of what packages and versions were used to execute a script. This supports e.g. reproducibility in academic research. Here, by providing the corresponding Project.toml and Manifest.toml files, you can enable someone to reproduce the exact program used to perform some set of analyses.
248+
A useful feature of Julia's environment system is that enables the exact definition of what packages and versions were used to execute a script. This supports e.g. reproducibility in academic research. Here, by providing the corresponding Project.toml and Manifest.toml files, you can enable someone to reproduce the exact program used to perform some set of analyses.
248249

249250

250251
---

docs/src/inverse_problems/behaviour_optimisation.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ Just like for [parameter fitting](@ref optimization_parameter_fitting), we creat
4747
using Optimization
4848
initial_guess = [1.0, 1.0, 1.0]
4949
opt_prob = OptimizationProblem(pulse_amplitude, initial_guess; lb = [1e-1, 1e-1, 1e-1], ub = [1e1, 1e1, 1e1])
50+
nothing # hide
5051
```
5152
!!! note
5253
As described in a [previous section on Optimization.jl](@ref optimization_parameter_fitting), `OptimizationProblem`s do not support setting parameter values using maps. We must instead set `initial_guess` values using a vector. Next, in the first line of our cost function, we reshape the parameter values to the common form used across Catalyst (e.g. `[:pX => p[1], :pY => p[2], :pZ => p[2]]`, however, here we use a dictionary to easier compute the steady state initial condition). We also note that the order used in this array corresponds to the order we give each parameter's bounds in `lb` and `ub`, and the order in which their values occur in the output solution.
@@ -55,6 +56,7 @@ As [previously described](@ref optimization_parameter_fitting), Optimization.jl
5556
```@example behaviour_optimization
5657
using OptimizationBBO
5758
opt_sol = solve(opt_prob, BBO_adaptive_de_rand_1_bin_radiuslimited())
59+
nothing # hide
5860
```
5961
Finally, we plot a simulation using the found parameter set (stored in `opt_sol.u`):
6062
```@example behaviour_optimization
@@ -78,9 +80,10 @@ Through packages such as [ForwardDiff.jl](https://github.com/JuliaDiff/ForwardDi
7880
```@example behaviour_optimization
7981
opt_func = OptimizationFunction(pulse_amplitude, AutoForwardDiff())
8082
opt_prob = OptimizationProblem(opt_func, initial_guess; lb = [1e-1, 1e-1, 1e-1], ub = [1e1, 1e1, 1e1])
83+
nothing # hide
8184
```
8285
Finally, we can find the optimum using some differentiation-based optimisation methods. Here we will use [Optim.jl](https://github.com/JuliaNLSolvers/Optim.jl)'s `BFGS` method:
83-
```@example behaviour_optimization
86+
```julia
8487
using OptimizationOptimJL
8588
opt_sol = solve(opt_prob, OptimizationOptimJL.BFGS())
8689
```
File renamed without changes.

docs/src/inverse_problems/structural_identifiability.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ To, in a similar manner, indicate that certain initial conditions are known is a
6060
### Providing non-trivial measured quantities
6161
Sometimes, ones may not have measurements of species, but rather some combinations of species (or possibly parameters). To account for this, `measured_quantities` accepts any algebraic expression (and not just single species). To form such expressions, species and parameters have to first be `@unpack`'ed from the model. Say that we have a model where an enzyme ($E$) is converted between an active and inactive form, which in turns activates the production of a product, $P$:
6262
```@example si1
63-
enzyme_activation = @reaction_network begin
63+
rs = @reaction_network begin
6464
(kA,kD), Eᵢ <--> Eₐ
6565
(Eₐ, d), 0 <-->P
6666
end
6767
```
6868
If we can measure the total amount of $E$ ($=Eᵢ+Eₐ$), as well as the amount of $P$, we can use the following to assess identifiability:
69-
```@example si2
70-
@unpack Eᵢ, Eₐ = enzyme_activation
71-
assess_identifiability(enzyme_activation; measured_quantities = [Eᵢ + Eₐ, :P], loglevel = Logging.Error)
69+
```@example si1
70+
@unpack Eᵢ, Eₐ = rs
71+
assess_identifiability(rs; measured_quantities = [Eᵢ + Eₐ, :P], loglevel = Logging.Error)
7272
nothing # hide
7373
```
7474

docs/src/model_creation/chemistry_related_functionality.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ We will first show how to create compound species through [programmatic model co
1212
```@example chem1
1313
using Catalyst
1414
t = default_t()
15-
@species C(t) O(t)
15+
@species C(t) O(t)
16+
nothing # hide
1617
```
1718
Next, we create the `CO2` compound species:
1819
```@example chem1
@@ -84,14 +85,17 @@ as the components `C`, `H`, and `O` are not declared as species anywhere. Please
8485
Just like for normal species, it is possible to designate metadata and default values for compounds. Metadata is provided after the compound name, but separated from it by a `,`:
8586
```@example chem1
8687
@compound (CO2, [unit="mol"]) ~ C + 2O
88+
nothing # hide
8789
```
8890
Default values are designated using `=`, and provided directly after the compound name.:
8991
```@example chem1
9092
@compound (CO2 = 2.0) ~ C + 2O
93+
nothing # hide
9194
```
9295
If both default values and meta data are provided, the metadata is provided after the default value:
9396
```@example chem1
9497
@compound (CO2 = 2.0, [unit="mol"]) ~ C + 2O
98+
nothing # hide
9599
```
96100
In all of these cases, the left-hand side must be enclosed within `()`.
97101

0 commit comments

Comments
 (0)