Skip to content

Commit fba3f5e

Browse files
committed
Merge branch 'master' into src___refactoring___dsl_file
2 parents 8156eca + 41ce941 commit fba3f5e

File tree

138 files changed

+13217
-5819
lines changed

Some content is hidden

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

138 files changed

+13217
-5819
lines changed

.github/workflows/CI.yml

Lines changed: 0 additions & 44 deletions
This file was deleted.

.github/workflows/DocsCleanup.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Doc Preview Cleanup
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
7+
# Ensure that only one "Doc Preview Cleanup" workflow is force pushing at a time
8+
concurrency:
9+
group: doc-preview-cleanup
10+
cancel-in-progress: false
11+
12+
jobs:
13+
doc-preview-cleanup:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: write
17+
steps:
18+
- name: Checkout gh-pages branch
19+
uses: actions/checkout@v4
20+
with:
21+
ref: gh-pages
22+
- name: Delete preview and history + push changes
23+
run: |
24+
if [ -d "${preview_dir}" ]; then
25+
git config user.name "Documenter.jl"
26+
git config user.email "[email protected]"
27+
git rm -rf "${preview_dir}"
28+
git commit -m "delete preview"
29+
git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree})
30+
git push --force origin gh-pages-new:gh-pages
31+
fi
32+
env:
33+
preview_dir: previews/PR${{ github.event.number }}

.github/workflows/Documentation.yml

Lines changed: 61 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,77 @@ on:
77
tags: '*'
88
pull_request:
99

10+
permissions:
11+
actions: write # Allows the workflow to delete old caches created by previous runs, ensuring efficient cache management and preventing the cache from growing indefinitely. https://github.com/julia-actions/cache?tab=readme-ov-file#cache-retention
12+
contents: read
13+
14+
concurrency:
15+
group: docs-${{ github.ref }} # Group name for concurrency control
16+
cancel-in-progress: true # Ensures only one doc build runs at a time for each branch/ref, regardless of the trigger
17+
1018
jobs:
1119
build:
1220
runs-on: ubuntu-latest
1321
steps:
14-
- uses: actions/checkout@v4
15-
- uses: julia-actions/setup-julia@latest
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
# # Install all required X11 and OpenGL libraries
26+
# # These are needed for GLMakie to work in a headless environment
27+
# - name: Install binary dependencies
28+
# run: |
29+
# sudo apt-get update
30+
# sudo apt-get install -y xvfb libgl1 mesa-utils freeglut3-dev xorg-dev \
31+
# libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev
32+
33+
# # Start Xvfb explicitly instead of using xvfb-run
34+
# # This gives us more control and visibility into the virtual display setup
35+
# - name: Setup virtual framebuffer
36+
# run: |
37+
# # Start Xvfb and wait for it to be ready
38+
# /usr/bin/Xvfb :99 -screen 0 1024x768x24
39+
# echo "DISPLAY=:99" >> $GITHUB_ENV
40+
41+
- name: Install Julia
42+
uses: julia-actions/setup-julia@latest
1643
with:
1744
version: '1'
45+
46+
# Cache to speed up subsequent runs
47+
- uses: julia-actions/cache@v2
48+
with:
49+
cache-name: docs-cache
50+
51+
# Install dependencies with the virtual display already running
1852
- name: Install dependencies
19-
run: julia --project=docs/ -e 'ENV["JULIA_PKG_SERVER"] = ""; using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
53+
run: |
54+
julia --project=docs/ -e '
55+
ENV["JULIA_PKG_SERVER"] = "";
56+
using Pkg;
57+
Pkg.develop(PackageSpec(path=pwd()));
58+
Pkg.instantiate()'
59+
60+
# Build documentation with the stable virtual display
2061
- name: Build and deploy
2162
env:
22-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token
23-
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key
24-
GKSwstype: "100" # https://discourse.julialang.org/t/generation-of-documentation-fails-qt-qpa-xcb-could-not-connect-to-display/60988
25-
run: julia --project=docs/ --code-coverage=user docs/make.jl
63+
GKSwstype: "100"
64+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65+
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
66+
run: xvfb-run julia --project=docs --color=yes --code-coverage=user docs/make.jl
67+
68+
- name: Upload site as artifact
69+
uses: actions/upload-artifact@v4
70+
with:
71+
name: docs-artifact
72+
path: ./docs/build
73+
retention-days: 3
74+
compression-level: 9
75+
overwrite: true
76+
2677
- uses: julia-actions/julia-processcoverage@v1
27-
- uses: codecov/codecov-action@v4
78+
79+
- uses: codecov/codecov-action@v5
2880
with:
29-
file: lcov.info
81+
files: lcov.info
3082
token: ${{ secrets.CODECOV_TOKEN }}
3183
fail_ci_if_error: false

.github/workflows/FormatCheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ on:
1111
jobs:
1212
format-check:
1313
name: "Format Check"
14-
uses: "SciML/.github/.github/workflows/format-check.yml@v1"
14+
uses: "SciML/.github/.github/workflows/format-suggestions-on-pr.yml@v1"

.github/workflows/Test.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: "Tests"
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
paths-ignore:
8+
- 'docs/**'
9+
push:
10+
branches:
11+
- master
12+
paths-ignore:
13+
- 'docs/**'
14+
15+
concurrency:
16+
# Skip intermediate builds: always, but for the master branch.
17+
# Cancel intermediate builds: always, but for the master branch.
18+
group: ${{ github.workflow }}-${{ github.ref }}
19+
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
20+
21+
jobs:
22+
tests:
23+
name: "Tests"
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
version:
28+
- "1"
29+
- "lts"
30+
- "pre"
31+
group:
32+
- Core
33+
- IO
34+
- Spatial
35+
- Extensions
36+
uses: "SciML/.github/.github/workflows/tests.yml@v1"
37+
with:
38+
julia-version: "${{ matrix.version }}"
39+
group: "${{ matrix.group }}"
40+
secrets: "inherit"

HISTORY.md

Lines changed: 164 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,172 @@
11
# Breaking updates and feature summaries across releases
22

33
## Catalyst unreleased (master branch)
4+
- The Catalyst release process is changing; certain core dependencies of
5+
Catalyst will now be capped to ensure Catalyst releases are only installed
6+
with versions of dependencies for which Catalyst CI and doc build tests pass
7+
(at the time the release is made). If you need a dependency version increased,
8+
please open an issue and we can update it and make a new Catalyst release once
9+
testing against the newer dependency version is complete.
10+
- Array symbolics support is more consistent with ModelingToolkit v9. Parameter
11+
arrays are no longer scalarized by Catalyst, while species and variables
12+
arrays still are (as in ModelingToolkit). As such, parameter arrays should now
13+
be specified as arrays in value mappings, i.e.
14+
```julia
15+
@parameters k[1:4]
16+
pmap = [k => rand(4)]
17+
```
18+
While one can still manually scalarize a parameter array, it is recommended
19+
*not* to do this as it has signifcant performance costs with ModelingToolkit
20+
v9. Note, scalarized parameter arrays passed to the two-argument
21+
`ReactionSystem` constructor may become unscalarized.
22+
- Scoped species/variables/parameters are now treated similar to the latest MTK
23+
releases (≥ 9.49).
24+
- The structural identifiability extension is currently disabled due to issues
25+
StructuralIdentifiability has with Julia 1.10.5 and 1.11.
26+
- A tutorial on making interactive plot displays using Makie has been added.
27+
- The BifurcationKit extension has been updated to v.4.
28+
- There is a new DSL option `@require_declaration` that will turn off automatic inferring for species, parameters, and variables in the DSL. For example, the following will now error:
29+
```julia
30+
rn = @reaction_network begin
31+
@require_declaration
32+
(k1, k2), A <--> B
33+
end
34+
```
35+
When this flag is set, all symbolics must be explicitly declared.
36+
```julia
37+
rn = @reaction_network begin
38+
@species A(t) B(t)
39+
@parameters k1 k2
40+
@require_declaration
41+
(k1, k2), A <--> B
42+
end
43+
```
44+
- Catalyst's network visualization capability has shifted from using Graphviz to [GraphMakie.jl](https://graph.makie.org/stable/). To use this functionality, load the GraphMakie extension by installing `Catalyst` and `GraphMakie`, along with a Makie backend like `GLMakie`. There are two new methods for visualizing graphs: `plot_network` and `plot_complexes`, which respectively display the species-reaction graph and complex graph.
45+
```julia
46+
using Catalyst, GraphMakie, GLMakie
47+
brusselator = @reaction_network begin
48+
A, ∅ --> X
49+
1, 2X + Y --> 3X
50+
B, X --> Y
51+
1, X -->
52+
end
53+
plot_network(brusselator)
54+
```
55+
56+
## Catalyst 14.4.1
57+
- Support for user-defined functions on the RHS when providing coupled equations
58+
for CRNs using the @equations macro. For example, the following now works:
59+
```julia
60+
using Catalyst
61+
f(A, t) = 2*A*t
62+
rn = @reaction_network begin
63+
@equations D(A) ~ f(A,t)
64+
end
65+
```
66+
Note that user-defined functions will not work on the LHS of equations.
67+
68+
## Catalyst 14.4
69+
- Symbolics 6 support.
70+
71+
72+
73+
## Catalyst 14.3
74+
- Support for simulating stochastic chemical kinetics models with explicitly
75+
time-dependent propensities (i.e. where the resulting `JumpSystem` contains
76+
`VariableRateJump`s). As such `JumpProblem`s need to be defined over
77+
`ODEProblem`s or `SDEProblem`s instead of `DiscreteProblem`s we have
78+
introduced a new input struct, `JumpInputs`, that handles selecting via
79+
analysis of the generated `JumpSystem`, i.e. one can now say
80+
```julia
81+
using Catalyst, OrdinaryDiffEq, JumpProcesses, Plots
82+
rn = @reaction_network begin
83+
k*(1 + sin(t)), 0 --> A
84+
end
85+
jinput = JumpInputs(rn, [:A => 0], (0.0, 10.0), [:k => .5])
86+
# note that jinput.prob isa ODEProblem
87+
jprob = JumpProblem(jinput)
88+
sol = solve(jprob, Tsit5())
89+
plot(sol, idxs = :A)
90+
91+
rn = @reaction_network begin
92+
k, 0 --> A
93+
end
94+
jinput = JumpInputs(rn, [:A => 0], (0.0, 10.0), [:k => .5])
95+
# note that jinput.prob isa DiscreteProblem
96+
jprob = JumpProblem(jinput)
97+
sol = solve(jprob)
98+
plot(sol, idxs = :A)
99+
```
100+
When calling solve for problems with explicit time-dependent propensities,
101+
i.e. where `jinput.prob isa ODEProblem`, note that one must currently
102+
explicitly select an ODE solver to handle time-stepping and integrating the
103+
time-dependent propensities.
104+
- Note that solutions to jump problems with explicit time-dependent
105+
propensities, i.e. a `JumpProblem` over an `ODEProblem`, require manual
106+
selection of the variables to plot. That is, currently `plot(sol)` will error
107+
in this case due to limitations in the SciMLBase plot recipe.
108+
109+
## Catalyst 14.2
110+
- Support for auto-algorithm selection in `JumpProblem`s. For systems with only
111+
propensities that do not have an explicit time-dependence (i.e. that are not
112+
`VariableRateJump`s in JumpProcesses), one can now run model simulations via
113+
```julia
114+
using Catalyst, JumpProcesses
115+
model = @reaction_network begin
116+
kB, S + E --> SE
117+
kD, SE --> S + E
118+
kP, SE --> P + E
119+
end
120+
u0 = [:S => 50, :E => 10, :SE => 0, :P => 0]
121+
tspan = (0., 200.)
122+
ps = [:kB => 0.01, :kD => 0.1, :kP => 0.1]
123+
dprob = DiscreteProblem(model, u0, tspan, ps)
124+
jprob = JumpProblem(model, dprob)
125+
sol = solve(jprob)
126+
```
127+
For small systems this will just use Gillespie's `Direct` method, transitioning to using `RSSA` and `RSSACR` as system size increase. Once can still manually select a given SSA, but no longer needs to specify `SSAStepper` when calling `solve`, i.e.
128+
```julia
129+
# use the SortingDirect method instead
130+
jprob = JumpProblem(model, dprob, SortingDirect())
131+
sol = solve(jprob)
132+
```
133+
- Latexify recipe improvements including display fixes for array symbolics.
134+
- Deficiency one and concentration robustness checks.
135+
136+
## Catalyst 14.1.1
137+
The expansion of `ReactionSystem` models to spatial lattices has been enabled. Here follows a
138+
simple example where a Brusselator model is expanded to a 20x20 grid of compartments, with diffusion
139+
for species X, and then simulated using ODEs. Finally, an animation of the simulation is created.
140+
```julia
141+
using Catalyst, CairoMakie, OrdinaryDiffEq
142+
143+
# Create `LatticeReactionSystem` model.
144+
brusselator = @reaction_network begin
145+
A, ∅ --> X
146+
1, 2X + Y --> 3X
147+
B, X --> Y
148+
1, X -->
149+
end
150+
diffusion_rx = @transport_reaction D X
151+
lattice = CartesianGrid((20,20))
152+
lrs = LatticeReactionSystem(brusselator, [diffusion_rx], lattice)
153+
154+
# Create a spatial `ODEProblem`.
155+
u0 = [:X => rand(20, 20), :Y => 10.0]
156+
tspan = (0.0, 40.0)
157+
ps = [:A => 1.0, :B => 4.0, :D => 0.2]
158+
oprob = ODEProblem(lrs, u0, tspan, ps)
159+
160+
# Simulate the ODE and plot the results.
161+
sol = solve(oprob, FBDF())
162+
lattice_animation(sol, :X, lrs, "brusselator.mp4")
163+
```
164+
The addition of spatial modelling in Catalyst contains a large number of new features, all of which are
165+
described in the [corresponding documentation](https://docs.sciml.ai/Catalyst/stable/spatial_modelling/lattice_reaction_systems/).
4166

5167
## Catalyst 14.0.1
6-
Bug fix to address that independent variables, like time, should now be `@parameters`
7-
according to MTKv9. Converted internal time variables to consistently use `default_t()`
168+
Bug fix to address that independent variables, like time, should now be `@parameters`
169+
according to MTKv9. Converted internal time variables to consistently use `default_t()`
8170
to hopefully avoid such issues going forward.
9171

10172
## Catalyst 14.0

0 commit comments

Comments
 (0)