Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 101 additions & 0 deletions .github/workflows/Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,68 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}

permissions:
actions: write
contents: read

jobs:
prewarm-cache:
name: "Prewarm Cache"
strategy:
fail-fast: false
matrix:
version:
- "1"
- "lts"
- "pre"
runs-on: ubuntu-latest
outputs:
deps-hash: ${{ steps.deps-hash.outputs.hash }}
steps:
- uses: actions/checkout@v6

- name: "Compute dependency hash"
id: deps-hash
run: echo "hash=${{ hashFiles('Project.toml') }}" >> "$GITHUB_OUTPUT"

- name: "Setup Julia ${{ matrix.version }}"
uses: julia-actions/setup-julia@v2
with:
version: "${{ matrix.version }}"
arch: "${{ runner.arch }}"

- name: "Restore Julia cache"
id: cache-restore
uses: actions/cache/restore@v4
with:
path: |
~/.julia/artifacts
~/.julia/packages
~/.julia/registries
~/.julia/compiled
~/.julia/scratchspaces
~/.julia/logs
key: "tests-cache-v2;os=${{ runner.os }};julia=${{ matrix.version }};deps=${{ steps.deps-hash.outputs.hash }}"

- name: "Build package"
uses: julia-actions/julia-buildpkg@v1

- name: "Save Julia cache"
if: steps.cache-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: |
~/.julia/artifacts
~/.julia/packages
~/.julia/registries
~/.julia/compiled
~/.julia/scratchspaces
~/.julia/logs
key: "tests-cache-v2;os=${{ runner.os }};julia=${{ matrix.version }};deps=${{ steps.deps-hash.outputs.hash }}"

tests:
name: "Tests"
needs: prewarm-cache
strategy:
fail-fast: false
matrix:
Expand All @@ -38,3 +97,45 @@ jobs:
group: "${{ matrix.group }}"
coverage: false
secrets: "inherit"

- name: "Setup Julia ${{ matrix.version }}"
uses: julia-actions/setup-julia@v2
with:
version: "${{ matrix.version }}"
arch: "${{ runner.arch }}"

- name: "Restore Julia cache"
uses: actions/cache/restore@v4
with:
path: |
~/.julia/artifacts
~/.julia/packages
~/.julia/registries
~/.julia/compiled
~/.julia/scratchspaces
~/.julia/logs
key: "tests-cache-v2;os=${{ runner.os }};julia=${{ matrix.version }};deps=${{ needs.prewarm-cache.outputs.deps-hash }}"

- name: "Build package"
uses: julia-actions/julia-buildpkg@v1

- name: "Run tests on ubuntu-latest with Julia v${{ matrix.version }} - ${{ matrix.group }}"
uses: julia-actions/julia-runtest@v1
with:
project: "@."
depwarn: "yes"
coverage: "true"
env:
GROUP: "${{ matrix.group }}"

- uses: julia-actions/julia-processcoverage@v1
with:
directories: "src,ext"

- name: "Report Coverage with Codecov"
uses: codecov/codecov-action@v5
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
with:
files: lcov.info
token: "${{ secrets.CODECOV_TOKEN }}"
fail_ci_if_error: true
2 changes: 2 additions & 0 deletions .github/workflows/TestExtensions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ jobs:
- name: "Cache Julia packages"
uses: julia-actions/cache@v2
with:
include-matrix: "false"
cache-name: "extensions-cache;julia=${{ matrix.version }}"
token: "${{ secrets.GITHUB_TOKEN }}"

- name: "Build main package"
Expand Down
153 changes: 67 additions & 86 deletions README.md

Large diffs are not rendered by default.

21 changes: 13 additions & 8 deletions docs/src/api/core_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ of all options currently available.
- [`compounds`](@ref chemistry_functionality_compounds): Allows the designation of compound species.
- [`observables`](@ref dsl_advanced_options_observables): Allows the designation of compound observables.
- [`default_noise_scaling`](@ref simulation_intro_SDEs_noise_saling): Enables the setting of a default noise scaling expression.
- [`differentials`](@ref constraint_equations_coupling_constraints): Allows the designation of differentials.
- [`equations`](@ref constraint_equations_coupling_constraints): Allows the creation of algebraic and/or differential equations.
- [`differentials`](@ref coupled_models_dsl): Allows the designation of differentials.
- [`equations`](@ref coupled_models_dsl): Allows the creation of algebraic and/or differential equations.
- [`continuous_events`](@ref events): Allows the creation of continuous events.
- [`discrete_events`](@ref events): Allows the creation of discrete events.
- `brownians`: Allows the creation of brownian processes that can be used to add noise to non-species variables.
Expand All @@ -103,7 +103,7 @@ A [`ReactionSystem`](@ref) is an instance of a
`ModelingToolkitBase.AbstractSystem`, and has a number of fields that
can be accessed using the Catalyst API and the [ModelingToolkitBase.jl Abstract
System
Interface](https://docs.sciml.ai/ModelingToolkit/stable/basics/AbstractSystem/).
Interface](https://docs.sciml.ai/ModelingToolkit/stable/API/System/).
Below we overview these components.

There are three basic sets of convenience accessors that will return information
Expand Down Expand Up @@ -185,7 +185,7 @@ isautonomous

## Coupled reaction/equation system properties
The following system property accessor functions are primarily relevant to reaction system [coupled
to differential and/or algebraic equations](@ref constraint_equations).
to differential and/or algebraic equations](@ref coupled_models).
```@docs
ModelingToolkitBase.has_alg_equations
ModelingToolkitBase.alg_equations
Expand Down Expand Up @@ -220,6 +220,7 @@ substoichmat
prodstoichmat
netstoichmat
reactionrates
PhysicalScale
```

## [Reaction metadata](@id api_rx_metadata)
Expand Down Expand Up @@ -268,13 +269,12 @@ network's ODE (as generated by the reaction rate equation) or SDE (as generated
by the chemical Langevin equation) form:
```julia
latexify(rn; form=:ode)
latexify(rn; form = :ode, math_delimiters = true) # hide
```
```julia
latexify(rn; form=:sde)
latexify(rn; form = :sde, math_delimiters = true) # hide
```
(As of writing this, an upstream bug causes the SDE form to be erroneously
displayed as the ODE form)

Finally, another optional argument (`expand_functions=true`) automatically expands functions defined by Catalyst (such as `mm`). To disable this, set `expand_functions=false`.

Reaction networks can be plotted using the `GraphMakie` extension, which is loaded whenever all of `Catalyst`, `GraphMakie`, and `NetworkLayout` are loaded (note that a Makie backend, like `CairoMakie`, must be loaded as well). The two functions for plotting networks are `plot_network` and `plot_complexes`, which are two distinct representations.
Expand All @@ -297,8 +297,13 @@ hillr
hillar
```

## Transformations
## Transformations and `ReactionSystem` Conversions
```@docs
ode_model
ss_ode_model
sde_model
jump_model
hybrid_model
ModelingToolkitBase.mtkcompile
set_default_noise_scaling
```
Expand Down
Loading
Loading