Skip to content

Commit df73259

Browse files
committed
Merge branch 'master' into docs___proposed_updates___github_readme
2 parents 5e210de + ae7f623 commit df73259

File tree

103 files changed

+5981
-2148
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+5981
-2148
lines changed

.github/workflows/CI.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
group:
1515
- Core
1616
version:
17-
- '1.10.2'
17+
- '1'
1818
steps:
1919
- uses: actions/checkout@v4
2020
- uses: julia-actions/setup-julia@v2
@@ -37,7 +37,7 @@ jobs:
3737
with:
3838
file: lcov.info
3939
token: ${{ secrets.CODECOV_TOKEN }}
40-
fail_ci_if_error: true
40+
fail_ci_if_error: false
4141
- uses: coverallsapp/github-action@master
4242
with:
4343
github-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/Documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ jobs:
2828
with:
2929
file: lcov.info
3030
token: ${{ secrets.CODECOV_TOKEN }}
31-
fail_ci_if_error: true
31+
fail_ci_if_error: false

.github/workflows/FormatCheck.yml

Lines changed: 4 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: format-check
1+
name: "Format Check"
22

33
on:
44
push:
@@ -9,34 +9,6 @@ on:
99
pull_request:
1010

1111
jobs:
12-
build:
13-
runs-on: ${{ matrix.os }}
14-
strategy:
15-
matrix:
16-
julia-version: [1]
17-
julia-arch: [x86]
18-
os: [ubuntu-latest]
19-
steps:
20-
- uses: julia-actions/setup-julia@latest
21-
with:
22-
version: ${{ matrix.julia-version }}
23-
24-
- uses: actions/checkout@v4
25-
- name: Install JuliaFormatter and format
26-
# This will use the latest version by default but you can set the version like so:
27-
#
28-
# julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter", version="0.13.0"))'
29-
run: |
30-
julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter", version="1.0.32"))'
31-
julia -e 'using JuliaFormatter; format(".", verbose=true)'
32-
- name: Format check
33-
run: |
34-
julia -e '
35-
out = Cmd(`git diff --name-only`) |> read |> String
36-
if out == ""
37-
exit(0)
38-
else
39-
@error "Some files have not been formatted !!!"
40-
write(stdout, out)
41-
exit(1)
42-
end'
12+
format-check:
13+
name: "Format Check"
14+
uses: "SciML/.github/.github/workflows/format-check.yml@v1"

.github/workflows/Invalidations.yml

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,10 @@ on:
44
pull_request:
55

66
concurrency:
7-
# Skip intermediate builds: always.
8-
# Cancel intermediate builds: always.
97
group: ${{ github.workflow }}-${{ github.ref }}
108
cancel-in-progress: true
119

1210
jobs:
13-
evaluate:
14-
# Only run on PRs to the default branch.
15-
# In the PR trigger above branches can be specified only explicitly whereas this check should work for master, main, or any other default branch
16-
if: github.base_ref == github.event.repository.default_branch
17-
runs-on: ubuntu-latest
18-
steps:
19-
- uses: julia-actions/setup-julia@v2
20-
with:
21-
version: '1'
22-
- uses: actions/checkout@v4
23-
- uses: julia-actions/julia-buildpkg@v1
24-
- uses: julia-actions/julia-invalidations@v1
25-
id: invs_pr
26-
27-
- uses: actions/checkout@v4
28-
with:
29-
ref: ${{ github.event.repository.default_branch }}
30-
- uses: julia-actions/julia-buildpkg@v1
31-
- uses: julia-actions/julia-invalidations@v1
32-
id: invs_default
33-
34-
- name: Report invalidation counts
35-
run: |
36-
echo "Invalidations on default branch: ${{ steps.invs_default.outputs.total }} (${{ steps.invs_default.outputs.deps }} via deps)" >> $GITHUB_STEP_SUMMARY
37-
echo "This branch: ${{ steps.invs_pr.outputs.total }} (${{ steps.invs_pr.outputs.deps }} via deps)" >> $GITHUB_STEP_SUMMARY
38-
- name: Check if the PR does increase number of invalidations
39-
if: steps.invs_pr.outputs.total > steps.invs_default.outputs.total
40-
run: exit 1
11+
evaluate-invalidations:
12+
name: "Evaluate Invalidations"
13+
uses: "SciML/.github/.github/workflows/invalidations.yml@v1"

HISTORY.md

Lines changed: 89 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,90 @@
33
## Catalyst unreleased (master branch)
44

55
## Catalyst 14.0
6-
- The `reactionparams`, `numreactionparams`, and `reactionparamsmap` functions have been removed.
6+
7+
#### Breaking changes
8+
Catalyst v14 was prompted by the (breaking) release of ModelingToolkit v9, which introduced several breaking changes to Catalyst. A summary of these (and how to handle them) can be found [here](https://docs.sciml.ai/Catalyst/stable/v14_migration_guide/). These are briefly summarised in the following bullet points:
9+
- `ReactionSystem`s must now be marked *complete* before they are exposed to most forms of simulation and analysis. With the exception of `ReactionSystem`s created through the `@reaction_network` macro, all `ReactionSystem`s are *not* marked complete upon construction. The `complete` function can be used to mark `ReactionSystem`s as complete. To construct a `ReactionSystem` that is not marked complete via the DSL the new `@network_component` macro can be used.
10+
- The `states` function has been replaced with `unknowns`. The `get_states` function has been replaced with `get_unknowns`.
11+
- Support for most units (with the exception of `s`, `m`, `kg`, `A`, `K`, `mol`, and `cd`) has currently been dropped by ModelingToolkit, and hence they are unavailable via Catalyst too. Its is expected that eventually support for relevant chemical units such as molar will return to ModelingToolkit (and should then immediately work in Catalyst too).
12+
- Problem parameter values are now accessed through `prob.ps[p]` (rather than `prob[p]`).
13+
- A significant bug prevents the safe application of the `remake` function on problems for which `remove_conserved = true` was used when updating the values of initial conditions. Instead, the values of each conserved constant must be directly specified.
14+
- The `reactionparams`, `numreactionparams`, and `reactionparamsmap` functions have been deprecated and removed.
715
- 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.
16+
17+
#### General changes
18+
- The `default_t()` and `default_time_deriv()` functions are now the preferred approaches for creating the default time independent variable and its differential. i.e.
19+
```julia
20+
# do
21+
t = default_t()
22+
@species A(t)
23+
24+
# avoid
25+
@variables t
26+
@species A(t)
27+
- It is now possible to add metadata to individual reactions, e.g. using:
28+
```julia
29+
rn = @reaction_network begin
30+
@parameters η
31+
k, 2X --> X2, [description="Dimerisation"]
32+
end
33+
getdescription(rn)
34+
```
35+
a more detailed description can be found [here](https://docs.sciml.ai/Catalyst/dev/model_creation/dsl_advanced/#dsl_advanced_options_reaction_metadata).
36+
- `SDEProblem` no longer takes the `noise_scaling` argument. Noise scaling is now handled through the `noise_scaling` metadata (described in more detail [here](https://docs.sciml.ai/Catalyst/stable/model_simulation/simulation_introduction/#simulation_intro_SDEs_noise_saling))
37+
- Fields of the internal `Reaction` structure have been changed. `ReactionSystems`s saved using `serialize` on previous Catalyst versions cannot be loaded using this (or later) versions.
38+
- A new function, `save_reactionsystem`, which permits the writing of `ReactionSystem` models to files, has been created. A thorough description of this function can be found [here](https://docs.sciml.ai/Catalyst/stable/model_creation/model_file_loading_and_export/#Saving-Catalyst-models-to,-and-loading-them-from,-Julia-files)
39+
- Update how compounds are created. E.g. use
40+
```julia
41+
@variables t C(t) O(t)
42+
@compound CO2 ~ C + 2O
43+
```
44+
to create a compound species `CO2` that consists of `C` and 2 `O`.
45+
- Added documentation for chemistry-related functionality (compound creation and reaction balancing).
46+
- Added function `isautonomous` to check if a `ReactionSystem` is autonomous.
47+
- Added function `steady_state_stability` to compute stability for steady states. Example:
48+
```julia
49+
# Creates model.
50+
rn = @reaction_network begin
51+
(p,d), 0 <--> X
52+
end
53+
p = [:p => 1.0, :d => 0.5]
54+
55+
# Finds (the trivial) steady state, and computes stability.
56+
steady_state = [2.0]
57+
steady_state_stability(steady_state, rn, p)
58+
```
59+
Here, `steady_state_stability` takes an optional argument `tol = 10*sqrt(eps())`, which is used to check that the real part of all eigenvalues are at least `tol` away from zero. Eigenvalues within `tol` of zero indicate that stability may not be reliably calculated.
60+
- Added a DSL option, `@combinatoric_ratelaws`, which can be used to toggle whether to use combinatorial rate laws within the DSL (this feature was already supported for programmatic modelling). Example:
61+
```julia
62+
# Creates model.
63+
rn = @reaction_network begin
64+
@combinatoric_ratelaws false
65+
(kB,kD), 2X <--> X2
66+
end
67+
```
68+
- Added a DSL option, `@observables` for [creating observables](https://docs.sciml.ai/Catalyst/stable/model_creation/dsl_advanced/#dsl_advanced_options_observables) (this feature was already supported for programmatic modelling).
69+
- Added DSL options `@continuous_events` and `@discrete_events` to add events to a model as part of its creation (this feature was already supported for programmatic modelling). Example:
70+
```julia
71+
rn = @reaction_network begin
72+
@continuous_events begin
73+
[X ~ 1.0] => [X ~ X + 1.0]
74+
end
75+
d, X --> 0
76+
end
77+
```
78+
- Added DSL option `@equations` to add (algebraic or differential) equations to a model as part of its creation (this feature was already supported for programmatic modelling). Example:
79+
```julia
80+
rn = @reaction_network begin
81+
@equations begin
82+
D(V) ~ 1 - V
83+
end
84+
(p/V,d/V), 0 <--> X
85+
end
86+
```
87+
- Coupled reaction network + differential equation (or algebraic differential equation) systems can now be converted to `SDESystem`s and `NonlinearSystem`s.
88+
89+
#### Structural identifiability extension
890
- Added CatalystStructuralIdentifiabilityExtension, which permits StructuralIdentifiability.jl function to be applied directly to Catalyst systems. E.g. use
991
```julia
1092
using Catalyst, StructuralIdentifiability
@@ -17,47 +99,9 @@ assess_identifiability(goodwind_oscillator; measured_quantities=[:M])
1799
```
18100
to assess (global) structural identifiability for all parameters and variables of the `goodwind_oscillator` model (under the presumption that we can measure `M` only).
19101
- Automatically handles conservation laws for structural identifiability problems (eliminates these internally to speed up computations).
20-
- Adds a tutorial to illustrate the use of the extension.
21-
- Enable adding metadata to individual reactions, e.g:
22-
```julia
23-
rn = @reaction_network begin
24-
@parameters η
25-
k, 2X --> X2, [noise_scaling=η]
26-
end
27-
get_noise_scaling(rn)
28-
```
29-
- `SDEProblem` no longer takes the `noise_scaling` argument (see above for new approach to handle noise scaling).
30-
- Changed fields of internal `Reaction` structure. `ReactionSystems`s saved using `serialize` on previous Catalyst versions cannot be loaded using this (or later) versions.
31-
- Simulation of spatial ODEs now supported. For full details, please see https://github.com/SciML/Catalyst.jl/pull/644 and upcoming documentation. Note that these methods are currently considered alpha, with the interface and approach changing even in non-breaking Catalyst releases.
32-
- LatticeReactionSystem structure represents a spatial reaction network:
33-
```julia
34-
rn = @reaction_network begin
35-
(p,d), 0 <--> X
36-
end
37-
tr = @transport_reaction D X
38-
lattice = Graphs.grid([5, 5])
39-
lrs = LatticeReactionSystem(rn, [tr], lattice)
40-
```
41-
- Here, if a `u0` or `p` vector is given with scalar values:
42-
```julia
43-
u0 = [:X => 1.0]
44-
p = [:p => 1.0, :d => 0.5, :D => 0.1]
45-
```
46-
this value will be used across the entire system. If their values are instead vectors, different values are used across the spatial system. Here
47-
```julia
48-
X0 = zeros(25)
49-
X0[1] = 1.0
50-
u0 = [:X => X0]
51-
```
52-
X's value will be `1.0` in the first vertex, but `0.0` in the remaining one (the system have 25 vertexes in total). SInce th parameters `p` and `d` are part of the non-spatial reaction network, their values are tied to vertexes. However, if the `D` parameter (which governs diffusion between vertexes) is given several values, these will instead correspond to the specific edges (and transportation along those edges.)
102+
- A more detailed of how this extension works can be found [here](https://docs.sciml.ai/Catalyst/stable/inverse_problems/structural_identifiability/).
53103

54-
- Update how compounds are created. E.g. use
55-
```julia
56-
@variables t C(t) O(t)
57-
@compound CO2 ~ C + 2O
58-
```
59-
to create a compound species `CO2` that consists of `C` and 2 `O`.
60-
- Added documentation for chemistry related functionality (compound creation and reaction balancing).
104+
#### Bifurcation analysis extension
61105
- Add a CatalystBifurcationKitExtension, permitting BifurcationKit's `BifurcationProblem`s to be created from Catalyst reaction networks. Example usage:
62106
```julia
63107
using Catalyst
@@ -74,32 +118,18 @@ bif_par = :k1
74118
u_guess = [:X => 5.0, :Y => 2.0]
75119
p_start = [:k1 => 4.0, :k2 => 1.0, :k3 => 1.0, :k4 => 1.5, :k5 => 1.25]
76120
plot_var = :X
77-
bprob = BifurcationProblem(wilhelm_2009_model, u_guess, p_start, bif_par; plot_var=plot_var)
121+
bprob = BifurcationProblem(wilhelm_2009_model, u_guess, p_start, bif_par; plot_var = plot_var)
78122
79123
p_span = (2.0, 20.0)
80-
opts_br = ContinuationPar(p_min = p_span[1], p_max = p_span[2], max_steps=1000)
124+
opts_br = ContinuationPar(p_min = p_span[1], p_max = p_span[2], max_steps = 1000)
81125
82-
bif_dia = bifurcationdiagram(bprob, PALC(), 2, (args...) -> opts_br; bothside=true)
126+
bif_dia = bifurcationdiagram(bprob, PALC(), 2, (args...) -> opts_br; bothside = true)
83127
84128
using Plots
85-
plot(bif_dia; xguide="k1", yguide="X")
129+
plot(bif_dia; xguide = "k1", guide = "X")
86130
```
87131
- Automatically handles elimination of conservation laws for computing bifurcation diagrams.
88132
- Updated Bifurcation documentation with respect to this new feature.
89-
- Added function `isautonomous` to check if a `ReactionSystem` is autonomous.
90-
- Added function `steady_state_stability` to compute stability for steady states. Example:
91-
```julia
92-
# Creates model.
93-
rn = @reaction_network begin
94-
(p,d), 0 <--> X
95-
end
96-
p = [:p => 1.0, :d => 0.5]
97-
98-
# Finds (the trivial) steady state, and computes stability.
99-
steady_state = [2.0]
100-
steady_state_stability(steady_state, rn, p)
101-
```
102-
Here, `steady_state_stability` take an optional argument `tol = 10*sqrt(eps())`, which is used to determine whether a eigenvalue real part is reliably less that 0.
103133

104134
## Catalyst 13.5
105135
- Added a CatalystHomotopyContinuationExtension extension, which exports the `hc_steady_state` function if HomotopyContinuation is exported. `hc_steady_state` finds the steady states of a reaction system using the homotopy continuation method. This feature is only available for julia versions 1.9+. Example:

Project.toml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
name = "Catalyst"
22
uuid = "479239e8-5488-4da2-87a7-35f2df7eef83"
3-
version = "13.5.1"
3+
version = "14.0.0-DEV"
44

55
[deps]
6+
Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"
67
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
78
DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e"
89
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
@@ -21,7 +22,6 @@ Requires = "ae029012-a4dd-5104-9daa-d747884805df"
2122
RuntimeGeneratedFunctions = "7e49a35a-f44a-4d26-94aa-eba1b4ca6b47"
2223
Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46"
2324
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
24-
SymbolicUtils = "d1185830-fcd6-423d-90d6-eec64667417b"
2525
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
2626
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
2727

@@ -37,27 +37,28 @@ CatalystStructuralIdentifiabilityExtension = "StructuralIdentifiability"
3737

3838
[compat]
3939
BifurcationKit = "0.3"
40+
Combinatorics = "1.0.2"
4041
DataStructures = "0.18"
4142
DiffEqBase = "6.83.0"
4243
DocStringExtensions = "0.8, 0.9"
44+
DynamicPolynomials = "0.5"
4345
DynamicQuantities = "0.13.2"
4446
Graphs = "1.4"
4547
HomotopyContinuation = "2.9"
4648
JumpProcesses = "9.3.2"
4749
LaTeXStrings = "1.3.0"
4850
Latexify = "0.14, 0.15, 0.16"
4951
MacroTools = "0.5.5"
50-
ModelingToolkit = "9.11.0"
52+
ModelingToolkit = "9.16.0"
5153
Parameters = "0.12"
5254
Reexport = "0.2, 1.0"
5355
Requires = "1.0"
5456
RuntimeGeneratedFunctions = "0.5.12"
5557
Setfield = "1"
56-
StructuralIdentifiability = "0.5.1"
57-
SymbolicUtils = "1.0.3"
58-
Symbolics = "5.27"
58+
StructuralIdentifiability = "0.5.8"
59+
Symbolics = "5.30.1"
5960
Unitful = "1.12.4"
60-
julia = "1.9"
61+
julia = "1.10"
6162

6263
[extras]
6364
BifurcationKit = "0f109fa4-8a5d-4b75-95aa-f515264e7665"
@@ -66,6 +67,7 @@ DomainSets = "5b8099bc-c8ec-5219-889f-1d9e522a28bf"
6667
Graphviz_jll = "3c863552-8265-54e4-a6dc-903eb78fde85"
6768
HomotopyContinuation = "f213a82b-91d6-5c5d-acf7-10f1c761b327"
6869
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
70+
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
6971
NonlinearSolve = "8913a72c-1f9b-4ce2-8d82-65094dcecaec"
7072
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
7173
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
@@ -82,4 +84,4 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
8284
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
8385

8486
[targets]
85-
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"]

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ etc).
3535
**NOTE:** Version 14 is a breaking release, prompted by the release of ModelingToolkit.jl version 9.
3636
This caused several breaking changes in how Catalyst models are represented and interfaced with.
3737

38-
Breaking changes and new functionality are summarized in the [HISTORY.md](HISTORY.md) file.
39-
This also includes a special migration guide for version 14.
38+
Breaking changes and new functionality are summarized in the
39+
[HISTORY.md](HISTORY.md) file. Furthermore, a migration guide on how to adapt your workflows to the
40+
the new v14 update can be found [here](https://docs.sciml.ai/Catalyst/stable/v14_migration_guide/).
4041

4142
## Tutorials and documentation
4243

0 commit comments

Comments
 (0)