From 913434c97cc450bed1bfa4c00fea00b1ffce01ac Mon Sep 17 00:00:00 2001 From: ArnoStrouwen Date: Sun, 12 Feb 2023 17:06:07 +0100 Subject: [PATCH 01/35] Upgrade SymbolicUtils --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index a33d067..e086aca 100644 --- a/Project.toml +++ b/Project.toml @@ -19,7 +19,7 @@ MathML = "0.1.9" Memoize = "0.4" ModelingToolkit = "7, 8" Setfield = "0.8, 1" -SymbolicUtils = "0.16, 0.18, 0.19" +SymbolicUtils = "0.16, 0.18, 0.19, 1" julia = "1.6" [extras] From 46c66545cf6ba7f2000f46d8703aeb3813c1b7b0 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sun, 12 Feb 2023 11:34:59 -0500 Subject: [PATCH 02/35] Update Project.toml --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index e086aca..7b82f74 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "CellMLToolkit" uuid = "03cb29e0-1ef4-4721-aa24-cf58a006576f" authors = ["Shahriar Iravanian "] -version = "2.9.2" +version = "2.10.0" [deps] EzXML = "8f5d6c58-4d21-5cfd-889c-e3ad7ee6a615" From ab17a24db65018864cd37ce0667c387018ec9981 Mon Sep 17 00:00:00 2001 From: ArnoStrouwen Date: Tue, 14 Feb 2023 23:31:42 +0100 Subject: [PATCH 03/35] various doc and style improvements --- .JuliaFormatter.toml | 3 ++- .gitignore | 1 + README.md | 17 +++++++------- docs/make.jl | 5 +++- docs/src/index.md | 56 +++++++++++++++++++++++++++++++++++--------- docs/src/tutorial.md | 20 ++++++++-------- 6 files changed, 71 insertions(+), 31 deletions(-) diff --git a/.JuliaFormatter.toml b/.JuliaFormatter.toml index 453925c..9c79359 100644 --- a/.JuliaFormatter.toml +++ b/.JuliaFormatter.toml @@ -1 +1,2 @@ -style = "sciml" \ No newline at end of file +style = "sciml" +format_markdown = true \ No newline at end of file diff --git a/.gitignore b/.gitignore index 3f02ca7..da5a720 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ *.jl.*.cov *.jl.mem Manifest.toml +docs/build \ No newline at end of file diff --git a/README.md b/README.md index bad391d..70d0081 100644 --- a/README.md +++ b/README.md @@ -6,10 +6,10 @@ [![codecov](https://codecov.io/gh/SciML/CellMLToolkit.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/SciML/CellMLToolkit.jl) [![Build Status](https://github.com/SciML/CellMLToolkit.jl/workflows/CI/badge.svg)](https://github.com/SciML/CellMLToolkit.jl/actions?query=workflow%3ACI) -[![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor's%20Guide-blueviolet)](https://github.com/SciML/ColPrac) +[![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor%27s%20Guide-blueviolet)](https://github.com/SciML/ColPrac) [![SciML Code Style](https://img.shields.io/static/v1?label=code%20style&message=SciML&color=9558b2&labelColor=389826)](https://github.com/SciML/SciMLStyle) -CellMLToolkit.jl is a Julia library that connects [CellML](http://cellml.org) models to [SciML](http://github.com/SciML), the Scientific Julia ecosystem. CellMLToolkit.jl acts as a bridge between CellML and ModelingToolkit.jl. It imports a CellML model (in XML) and emits a ModelingToolkit.jl intermediate representation (IR), which can then enter the SciML ecosystem. +CellMLToolkit.jl is a Julia library that connects [CellML](https://cellml.org/) models to [SciML](http://github.com/SciML/), the Scientific Julia ecosystem. CellMLToolkit.jl acts as a bridge between CellML and ModelingToolkit.jl. It imports a CellML model (in XML) and emits a ModelingToolkit.jl intermediate representation (IR), which can then enter the SciML ecosystem. ## Tutorials and Documentation @@ -55,8 +55,8 @@ Note that `model` is a directory of the CellMLToolkit package. You can find its and then ```julia - model_path = joinpath(model_root, "lorenz.cellml.xml") - ml = CellModel(model_path) +model_path = joinpath(model_root, "lorenz.cellml.xml") +ml = CellModel(model_path) ``` ## Tutorial @@ -76,6 +76,7 @@ The next step is to convert `ml` into an `ODEProblem`, ready to be solved. ```Julia prob = ODEProblem(ml, (0,100.0)) ``` + Here, `(0,100.0)` is the `tspan` parameter, describing the integration range of the independent variable. In addition to the model equations, the initial conditions and parameters are also read from the XML file(s) and are available as `prob.u0` and `prob.ps`, respectively. We can solve and visualize `prob` as @@ -174,9 +175,9 @@ For the next example, we chose a complex model to stress the ODE solvers: [the O CellML specification allows for models spanning multiple XML files. In these models, the top level CellML XML file imports components from other CellML files, which in turn may import from other files. CellMLToolkit supports this functionality. It assumes that *the top-level file and all the imported files reside in the same directory*. `models/noble_1962` contained one such example: ```julia - ml = CellModel("models/noble_1962/Noble_1962.cellml") - prob = ODEProblem(ml, tspan) - sol = solve(prob, TRBDF2(), dtmax=0.5) +ml = CellModel("models/noble_1962/Noble_1962.cellml") +prob = ODEProblem(ml, tspan) +sol = solve(prob, TRBDF2(), dtmax = 0.5) ``` Note that the syntax is exactly the same as before. However, the list of the imported files are printed during `CellModel` generation: @@ -196,7 +197,7 @@ Note that the syntax is exactly the same as before. However, the list of the imp Same as before, we can plot the output as ```julia - plot(sol, vars=2) +plot(sol, vars = 2) ``` ![](figures/noble_1962.png) diff --git a/docs/make.jl b/docs/make.jl index b1a31df..f5b2b80 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -16,7 +16,10 @@ mathengine = MathJax3(Dict(:loader => Dict("load" => ["[tex]/require", "[tex]/ma makedocs(sitename = "CellMLToolkit.jl", authors = "Chris Rackauckas", modules = Module[], - clean = true, doctest = false, + clean = true, doctest = false, linkcheck = true, + linkcheck_ignore = [ + "https://journals.physiology.org/doi/full/10.1152/ajpheart.00794.2003", + ], strict = [ :doctest, :linkcheck, diff --git a/docs/src/index.md b/docs/src/index.md index c3a12ed..7cc5ab6 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -10,14 +10,31 @@ CellMLToolkit.jl is a Julia library that connects CellML models to the Scientifi [SciML](http://github.com/SciML) is a collection of Julia libraries for open source scientific computing and machine learning. The centerpiece of SciML is [DifferentialEquations.jl](https://github.com/SciML/DifferentialEquations.jl), which provides a rich set of ordinary differential equations (ODE) solvers. One major peripheral component of SciML is [ModelingToolkit.jl](https://github.com/SciML/ModelingToolkit.jl). It is a modeling framework for high-performance symbolic-numeric computation in scientific computing and scientific machine learning. The core of ModelingToolkit.jl is an IR language to code the scientific problems of interest in a high level. Automatic code generation and differentiation allow for the generation of a usable model for the other components of SciML, such as DifferentialEquations.jl. -## Install +## Installation -To install, run +To install CellMLToolkit.jl, use the Julia package manager: ```julia - Pkg.add("CellMLToolkit") +using Pkg +Pkg.add("CellMLToolkit") ``` +## Contributing + + - Please refer to the + [SciML ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://github.com/SciML/ColPrac/blob/master/README.md) + for guidance on PRs, issues, and other matters relating to contributing to SciML. + + - See the [SciML Style Guide](https://github.com/SciML/SciMLStyle) for common coding practices and other style decisions. + - There are a few community forums: + + + The #diffeq-bridged and #sciml-bridged channels in the + [Julia Slack](https://julialang.org/slack/) + + The #diffeq-bridged and #sciml-bridged channels in the + [Julia Zulip](https://julialang.zulipchat.com/#narrow/stream/279055-sciml-bridged) + + On the [Julia Discourse forums](https://discourse.julialang.org) + + See also [SciML Community page](https://sciml.ai/community/) + ## Example ```Julia @@ -32,57 +49,74 @@ To install, run Z = map(x -> x[3], sol.u) plot(X, Z) ``` + ## Reproducibility + ```@raw html
The documentation of this SciML package was built using these direct dependencies, ``` + ```@example using Pkg # hide Pkg.status() # hide ``` + ```@raw html
``` + ```@raw html
and using this machine and Julia version. ``` + ```@example using InteractiveUtils # hide versioninfo() # hide ``` + ```@raw html
``` + ```@raw html
A more complete overview of all dependencies and their versions is also provided. ``` + ```@example using Pkg # hide -Pkg.status(;mode = PKGMODE_MANIFEST) # hide +Pkg.status(; mode = PKGMODE_MANIFEST) # hide ``` + ```@raw html
``` + ```@raw html You can also download the manifest file and the project file. -``` \ No newline at end of file +``` diff --git a/docs/src/tutorial.md b/docs/src/tutorial.md index 12f29c9..3b4a8cc 100644 --- a/docs/src/tutorial.md +++ b/docs/src/tutorial.md @@ -67,14 +67,14 @@ There are three `list` functions: `list_states`, `list_params`, and `list_initia Here, we are interested in `list_params`. Let's go back to the ten Tusscher-Noble-Noble-Panfilov model and list its params: ```julia - ml = CellModel("models/tentusscher_noble_noble_panfilov_2004_a.cellml.xml") - p = list_params(ml) - display(p) +ml = CellModel("models/tentusscher_noble_noble_panfilov_2004_a.cellml.xml") +p = list_params(ml) +display(p) ``` We get a list of the 45 parameters: -```julia +``` 45-element Array{Pair{Operation,Float64},1}: stim_start => 10.0 g_pK => 0.0146 @@ -92,17 +92,17 @@ We get a list of the 45 parameters: To modify a parameter, we use `update_list!` function. For example, the following code changes the stimulation period (`stim_period`) from its default of 1000 ms to 400 ms ```julia - update_list!(p, "stim_period", 400.0) +update_list!(p, "stim_period", 400.0) ``` We need to pass the new `p` to `ODEProblem` constructor as a keyword parameter. The rest of the code remains the same. ```julia - tspan = (0, 5000.0) - prob = ODEProblem(ml, tspan; p=p) - sol = solve(prob, TRBDF2(), dtmax=1.0) - V = map(x -> x[1], sol.u) - plot(sol.t, V) +tspan = (0, 5000.0) +prob = ODEProblem(ml, tspan; p = p) +sol = solve(prob, TRBDF2(), dtmax = 1.0) +V = map(x -> x[1], sol.u) +plot(sol.t, V) ``` ![](../../../figures/ten_400.png) From fd0f28b9d6d9de2091fad096f9c5148cc9bc3b88 Mon Sep 17 00:00:00 2001 From: Hendrik Ranocha Date: Mon, 13 Mar 2023 08:24:40 +0100 Subject: [PATCH 04/35] enable dependabot for GitHub actions --- .github/dependabot.yml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..700707c --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" # Location of package manifests + schedule: + interval: "weekly" From 921aa3d83d497ed65b94ec4278498c6d33e7c8e7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 09:51:42 +0000 Subject: [PATCH 05/35] Bump actions/checkout from 1 to 3 Bumps [actions/checkout](https://github.com/actions/checkout) from 1 to 3. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v1...v3) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/Documentation.yml | 2 +- .github/workflows/FormatCheck.yml | 2 +- .github/workflows/ci.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml index 5bc7093..bfd9807 100644 --- a/.github/workflows/Documentation.yml +++ b/.github/workflows/Documentation.yml @@ -11,7 +11,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: julia-actions/setup-julia@latest with: version: '1.6' diff --git a/.github/workflows/FormatCheck.yml b/.github/workflows/FormatCheck.yml index 2a3517a..f80d0b1 100644 --- a/.github/workflows/FormatCheck.yml +++ b/.github/workflows/FormatCheck.yml @@ -21,7 +21,7 @@ jobs: with: version: ${{ matrix.julia-version }} - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 - name: Install JuliaFormatter and format # This will use the latest version by default but you can set the version like so: # diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e315b04..4c2e68b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: - '1' - '1.6' steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: julia-actions/setup-julia@v1 with: version: ${{ matrix.version }} From 337284b7917f0149870132bd68b5724dbc86242e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 09:51:44 +0000 Subject: [PATCH 06/35] Bump codecov/codecov-action from 1 to 3 Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 1 to 3. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v1...v3) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/Documentation.yml | 2 +- .github/workflows/ci.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml index 5bc7093..cdab474 100644 --- a/.github/workflows/Documentation.yml +++ b/.github/workflows/Documentation.yml @@ -23,6 +23,6 @@ jobs: DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key run: julia --project=docs/ --code-coverage=user docs/make.jl - uses: julia-actions/julia-processcoverage@v1 - - uses: codecov/codecov-action@v1 + - uses: codecov/codecov-action@v3 with: file: lcov.info diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e315b04..08af3c7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,6 +28,6 @@ jobs: - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 - uses: julia-actions/julia-processcoverage@v1 - - uses: codecov/codecov-action@v1 + - uses: codecov/codecov-action@v3 with: file: lcov.info From 940550b091f2ae11e7b9a6db379e53232ed8bfea Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 09:51:46 +0000 Subject: [PATCH 07/35] Bump actions/cache from 1 to 3 Bumps [actions/cache](https://github.com/actions/cache) from 1 to 3. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v1...v3) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e315b04..0415462 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: - uses: julia-actions/setup-julia@v1 with: version: ${{ matrix.version }} - - uses: actions/cache@v1 + - uses: actions/cache@v3 env: cache-name: cache-artifacts with: From e3c07bd514854cb3b533aa772be3af6aab248237 Mon Sep 17 00:00:00 2001 From: Shahriar Iravanian Date: Sat, 1 Apr 2023 11:27:01 -0400 Subject: [PATCH 08/35] Update README.md --- README.md | 186 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 185 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 70d0081..3fd5d76 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,191 @@ [![codecov](https://codecov.io/gh/SciML/CellMLToolkit.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/SciML/CellMLToolkit.jl) [![Build Status](https://github.com/SciML/CellMLToolkit.jl/workflows/CI/badge.svg)](https://github.com/SciML/CellMLToolkit.jl/actions?query=workflow%3ACI) -[![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor%27s%20Guide-blueviolet)](https://github.com/SciML/ColPrac) +[![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.sh# CellMLToolkit.jl + +CellMLToolkit.jl is a Julia library that connects [CellML](http://cellml.org) models to [SciML](http://github.com/SciML), the Scientific Julia ecosystem. CellMLToolkit.jl acts as a bridge between CellML and ModelingToolkit.jl. It imports a CellML model (in XML) and emits a ModelingToolkit.jl intermediate representation (IR), which can then enter the SciML ecosystem. + +## CellML + +[CellML](http://cellml.org) is an XML-based open-standard for the exchange of mathematical models. CellML originally started in 1998 by the Auckland Bioengineering Institute at the University of Auckland and affiliated research groups. Since then, its [repository](https://models.physiomeproject.org/welcome) has grown to more than a thousand models. While CellML is not domain-specific, its focus has been on biomedical models. Currently, the active categories in the repository are *Calcium Dynamics*, *Cardiovascular Circulation*, *Cell Cycle*, *Cell Migration*, *Circadian Rhythms*, *Electrophysiology*, *Endocrine*, *Excitation-Contraction Coupling*, *Gene Regulation*, *Hepatology*, *Immunology*, *Ion Transport*, *Mechanical Constitutive Laws*, *Metabolism*, *Myofilament Mechanics*, *Neurobiology*, *pH Regulation*, *PKPD*, *Protein Modules*, *Signal Transduction*, and *Synthetic Biology*. There are many software tools to import, process and run CellML models; however, these tools are not Julia-specific. + +## SciML + +[SciML](http://github.com/SciML) is a collection of Julia libraries for open source scientific computing and machine learning. The centerpiece of SciML is [DifferentialEquations.jl](https://github.com/SciML/DifferentialEquations.jl), which provides a rich set of ordinary differential equations (ODE) solvers. One major peripheral component of SciML is [ModelingToolkit.jl](https://github.com/SciML/ModelingToolkit.jl). It is a modeling framework for high-performance symbolic-numeric computation in scientific computing and scientific machine learning. The core of ModelingToolkit.jl is an IR language to code the scientific problems of interest in a high level. Automatic code generation and differentiation allow for the generation of a usable model for the other components of SciML, such as DifferentialEquations.jl. + +## Install + +To install, run + +```julia + ] add CellMLToolkit +``` + +## Simple Example + +```Julia + using CellMLToolkit, OrdinaryDiffEq, Plots + + ml = CellModel("models/lorenz.cellml.xml") + prob = ODEProblem(ml, (0,100.0)) + sol = solve(prob, RK4()) # fourth-order Runge-Kutta method + plot(sol, idxs=(1,3)) # idxs keyword has superceded vars keyword +``` + +Note that `model` is a directory of the CellMLToolkit package. You can find its path as + +```Julia + model_root = joinpath(splitdir(pathof(CellMLToolkit))[1], "..", "models") +``` + +and then + +```julia + model_path = joinpath(model_root, "lorenz.cellml.xml") + ml = CellModel(model_path) +``` + +## Tutorial + +The models directory contains a few CellML model examples. Let's start with a simple one, the famous Lorenz equations. + +```Julia + using CellMLToolkit + + ml = CellModel("models/lorenz.cellml.xml") +``` + +Now, `ml` is a `CellModel` structure that contains both a list of the loaded XML files and their components (accessible as `ml.doc`) and a ModelingToolkit `ODESystem` that defines variables and dynamics and can be accessed as `getsys(ml)`. + +The next step is to convert `ml` into an `ODEProblem`, ready to be solved. + +```Julia + prob = ODEProblem(ml, (0,100.0)) +``` +Here, `(0,100.0)` is the `tspan` parameter, describing the integration range of the independent variable. +In addition to the model equations, the initial conditions and parameters are also read from the XML file(s) and are available as `prob.u0` and `prob.ps`, respectively. We can solve and visualize `prob` as + +```Julia + using DifferentialEquations, Plots + + sol = solve(prob, RK4()) # fourth-order Runge-Kutta method + plot(sol, idxs=(1,3)) # idxs keyword has superceded vars keyword +``` + +As expected, + +![](figures/lorenz.png) + +Let's look at more complicated examples. The next one is the [ten Tusscher-Noble-Noble-Panfilov human left ventricular action potential model](https://journals.physiology.org/doi/full/10.1152/ajpheart.00794.2003). This is a mid-range electrophysiology model with 17 states variables and relatively good numerical stability. + +```Julia + ml = CellModel("models/tentusscher_noble_noble_panfilov_2004_a.cellml.xml") + prob = ODEProblem(ml, (0, 10000.0)) + sol = solve(prob, TRBDF2(), dtmax=1.0) # it is a stiff system requiring an implcit solver (TRBDF2 instead of RK4) + plot(sol, idxs=12) +``` + +![](figures/ten.png) + +We can tell which variable to plot (idxs=12, here) by looking at the output of `list_states(ml)` (see below). + +Let's see how we can modify the initial values and parameters. We will use the Beeler-Reuter model with 8 state variables as an example: + +```Julia + ml = CellModel("models/beeler_reuter_1977.cellml.xml") +``` + +The model parameters are listed as `list_params(ml)`: + +```Julia + sodium_current₊g_Na => 0.04 + sodium_current₊E_Na => 50.0 + sodium_current₊g_Nac => 3.0e-5 + stimulus_protocol₊IstimStart => 10.0 + stimulus_protocol₊IstimEnd => 50000.0 + stimulus_protocol₊IstimAmplitude => 0.5 + stimulus_protocol₊IstimPeriod => 1000.0 + stimulus_protocol₊IstimPulseDuration => 1.0 + slow_inward_current₊g_s => 0.0009 + membrane₊C => 0.01 +``` + +Note the form of the parameter and variable names. They are composed of two names joined by a ₊ sign. The first name is the +component name in CellML models (e.g., sodium_current, stimulus_protocol) and the second name is the actual variable name. + +Similarly, we can list the state variables by calling `list_states(ml)`: + +```Julia + slow_inward_current_d_gate₊d(time) => 0.003 + slow_inward_current_f_gate₊f(time) => 0.994 + sodium_current_j_gate₊j(time) => 0.975 + slow_inward_current₊Cai(time) => 0.0001 + time_dependent_outward_current_x1_gate₊x1(time) => 0.0001 + sodium_current_m_gate₊m(time) => 0.011 + sodium_current_h_gate₊h(time) => 0.988 + membrane₊V(time) => -84.624 +``` + +Assume we want to change `IstimPeriod`. We can easily do this with the help of `update_list!` utility function provided: + +```Julia + params = list_params(ml) + update_list!(params, :stimulus_protocol₊IstimPeriod, 250.0) + prob = ODEProblem(ml, (0, 10000.0); p=last.(params)) +``` + +The rest is the same as before. + +```Julia + sol = solve(prob, TRBDF2(), dtmax=1.0) + plot(sol, idxs=8) # 8 is the index of membrane₊V +``` + +For the next example, we chose a complex model to stress the ODE solvers: [the O'Hara-Rudy left ventricular model](https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1002061). This model has 49 state variables, is very stiff, and is prone to oscillation. The best solver for this model is `CVODE_BDF` from the Sundial suite. + +```Julia + using Sundials + + ml = CellModel("models/ohara_rudy_cipa_v1_2017.cellml.xml") + tspan = (0, 5000.0) + prob = ODEProblem(ml, tspan); + sol = solve(prob, CVODE_BDF(), dtmax=0.5) + plot(sol, idxs=49) # membrane₊v +``` + +![](figures/ohara_rudy.png) + +## Multi-file Models (Import) + +CellML specification allows for models spanning multiple XML files. In these models, the top level CellML XML file imports components from other CellML files, which in turn may import from other files. CellMLToolkit supports this functionality. It assumes that *the top-level file and all the imported files reside in the same directory*. `models/noble_1962` contained one such example: + +```julia + ml = CellModel("models/noble_1962/Noble_1962.cellml") + prob = ODEProblem(ml, tspan) + sol = solve(prob, TRBDF2(), dtmax=0.5) +``` + +Note that the syntax is exactly the same as before. However, the list of the imported files are printed during `CellModel` generation: + +``` +[ Info: importing Noble62_Na_channel.cellml +[ Info: importing Noble62_units.cellml +[ Info: importing Noble62_K_channel.cellml +[ Info: importing Noble62_units.cellml +[ Info: importing Noble62_L_channel.cellml +[ Info: importing Noble62_units.cellml +[ Info: importing Noble62_units.cellml +[ Info: importing Noble62_parameters.cellml +[ Info: importing Noble62_units.cellml +``` + +Same as before, we can plot the output as + +```julia + plot(sol, idxs=2) +``` + +![](figures/noble_1962.png)ields.io/badge/ColPrac-Contributor%27s%20Guide-blueviolet)](https://github.com/SciML/ColPrac) [![SciML Code Style](https://img.shields.io/static/v1?label=code%20style&message=SciML&color=9558b2&labelColor=389826)](https://github.com/SciML/SciMLStyle) CellMLToolkit.jl is a Julia library that connects [CellML](https://cellml.org/) models to [SciML](http://github.com/SciML/), the Scientific Julia ecosystem. CellMLToolkit.jl acts as a bridge between CellML and ModelingToolkit.jl. It imports a CellML model (in XML) and emits a ModelingToolkit.jl intermediate representation (IR), which can then enter the SciML ecosystem. From 4957a5da548454e4f5fb051d85731c1bbe59d43c Mon Sep 17 00:00:00 2001 From: Shahriar Iravanian Date: Sat, 1 Apr 2023 11:27:51 -0400 Subject: [PATCH 09/35] Update README.md --- README.md | 202 ------------------------------------------------------ 1 file changed, 202 deletions(-) diff --git a/README.md b/README.md index 3fd5d76..4d35f05 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,5 @@ # CellMLToolkit.jl -[![Join the chat at https://julialang.zulipchat.com #sciml-bridged](https://img.shields.io/static/v1?label=Zulip&message=chat&color=9558b2&labelColor=389826)](https://julialang.zulipchat.com/#narrow/stream/279055-sciml-bridged) -[![Global Docs](https://img.shields.io/badge/docs-SciML-blue.svg)](https://docs.sciml.ai/CellMLToolkit/stable/) - -[![codecov](https://codecov.io/gh/SciML/CellMLToolkit.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/SciML/CellMLToolkit.jl) -[![Build Status](https://github.com/SciML/CellMLToolkit.jl/workflows/CI/badge.svg)](https://github.com/SciML/CellMLToolkit.jl/actions?query=workflow%3ACI) - -[![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.sh# CellMLToolkit.jl - CellMLToolkit.jl is a Julia library that connects [CellML](http://cellml.org) models to [SciML](http://github.com/SciML), the Scientific Julia ecosystem. CellMLToolkit.jl acts as a bridge between CellML and ModelingToolkit.jl. It imports a CellML model (in XML) and emits a ModelingToolkit.jl intermediate representation (IR), which can then enter the SciML ecosystem. ## CellML @@ -190,198 +182,4 @@ Same as before, we can plot the output as plot(sol, idxs=2) ``` -![](figures/noble_1962.png)ields.io/badge/ColPrac-Contributor%27s%20Guide-blueviolet)](https://github.com/SciML/ColPrac) -[![SciML Code Style](https://img.shields.io/static/v1?label=code%20style&message=SciML&color=9558b2&labelColor=389826)](https://github.com/SciML/SciMLStyle) - -CellMLToolkit.jl is a Julia library that connects [CellML](https://cellml.org/) models to [SciML](http://github.com/SciML/), the Scientific Julia ecosystem. CellMLToolkit.jl acts as a bridge between CellML and ModelingToolkit.jl. It imports a CellML model (in XML) and emits a ModelingToolkit.jl intermediate representation (IR), which can then enter the SciML ecosystem. - -## Tutorials and Documentation - -For information on using the package, -[see the stable documentation](https://docs.sciml.ai/CellMLToolkit/stable/). Use the -[in-development documentation](https://docs.sciml.ai/CellMLToolkit/dev/) for the version of -the documentation, which contains the unreleased features. - -## CellML - -[CellML](http://cellml.org) is an XML-based open-standard for the exchange of mathematical models. CellML originally started in 1998 by the Auckland Bioengineering Institute at the University of Auckland and affiliated research groups. Since then, its [repository](https://models.physiomeproject.org/welcome) has grown to more than a thousand models. While CellML is not domain-specific, its focus has been on biomedical models. Currently, the active categories in the repository are *Calcium Dynamics*, *Cardiovascular Circulation*, *Cell Cycle*, *Cell Migration*, *Circadian Rhythms*, *Electrophysiology*, *Endocrine*, *Excitation-Contraction Coupling*, *Gene Regulation*, *Hepatology*, *Immunology*, *Ion Transport*, *Mechanical Constitutive Laws*, *Metabolism*, *Myofilament Mechanics*, *Neurobiology*, *pH Regulation*, *PKPD*, *Protein Modules*, *Signal Transduction*, and *Synthetic Biology*. There are many software tools to import, process and run CellML models; however, these tools are not Julia-specific. - -## SciML - -[SciML](http://github.com/SciML) is a collection of Julia libraries for open source scientific computing and machine learning. The centerpiece of SciML is [DifferentialEquations.jl](https://github.com/SciML/DifferentialEquations.jl), which provides a rich set of ordinary differential equations (ODE) solvers. One major peripheral component of SciML is [ModelingToolkit.jl](https://github.com/SciML/ModelingToolkit.jl). It is a modeling framework for high-performance symbolic-numeric computation in scientific computing and scientific machine learning. The core of ModelingToolkit.jl is an IR language to code the scientific problems of interest in a high level. Automatic code generation and differentiation allow for the generation of a usable model for the other components of SciML, such as DifferentialEquations.jl. - -## Installation - -To install CellMLToolkit.jl, use the Julia package manager: - -```julia -using Pkg -Pkg.add("CellMLToolkit") -``` - -## Simple Example - -```Julia - using CellMLToolkit, OrdinaryDiffEq, Plots - - ml = CellModel("models/lorenz.cellml.xml") - prob = ODEProblem(ml, (0,100.0)) - sol = solve(prob) - plot(sol, vars=(1,3)) -``` - -Note that `model` is a directory of the CellMLToolkit package. You can find its path as - -```Julia - model_root = joinpath(splitdir(pathof(CellMLToolkit))[1], "..", "models") -``` - -and then - -```julia -model_path = joinpath(model_root, "lorenz.cellml.xml") -ml = CellModel(model_path) -``` - -## Tutorial - -The models directory contains a few CellML model examples. Let's start with a simple one, the famous Lorenz equations. - -```Julia - using CellMLToolkit - - ml = CellModel("models/lorenz.cellml.xml") -``` - -Now, `ml` is a `CellModel` structure that contains both a list of the loaded XML files and their components (accessible as `ml.doc`) and a ModelingToolkit `ODESystem` that defines variables and dynamics and can be accessed as `getsys(ml)`. - -The next step is to convert `ml` into an `ODEProblem`, ready to be solved. - -```Julia - prob = ODEProblem(ml, (0,100.0)) -``` - -Here, `(0,100.0)` is the `tspan` parameter, describing the integration range of the independent variable. -In addition to the model equations, the initial conditions and parameters are also read from the XML file(s) and are available as `prob.u0` and `prob.ps`, respectively. We can solve and visualize `prob` as - -```Julia - using DifferentialEquations, Plots - - sol = solve(prob) - plot(sol, vars=(1,3)) -``` - -As expected, - -![](figures/lorenz.png) - -Let's look at more complicated examples. The next one is the [ten Tusscher-Noble-Noble-Panfilov human left ventricular action potential model](https://journals.physiology.org/doi/full/10.1152/ajpheart.00794.2003). This is a mid-range electrophysiology model with 17 states variables and relatively good numerical stability. - -```Julia - ml = CellModel("models/tentusscher_noble_noble_panfilov_2004_a.cellml.xml") - prob = ODEProblem(ml, (0, 10000.0)) - sol = solve(prob, TRBDF2(), dtmax=1.0) - plot(sol, vars=12) -``` - -![](figures/ten.png) - -We can tell which variable to plot (vars=12, here) by looking at the output of `list_states(ml)` (see below). - -Let's see how we can modify the initial values and parameters. We will use the Beeler-Reuter model with 8 state variables as an example: - -```Julia - ml = CellModel("models/beeler_reuter_1977.cellml.xml") -``` - -The model parameters are listed as `list_params(ml)`: - -```Julia - sodium_current₊g_Na => 0.04 - sodium_current₊E_Na => 50.0 - sodium_current₊g_Nac => 3.0e-5 - stimulus_protocol₊IstimStart => 10.0 - stimulus_protocol₊IstimEnd => 50000.0 - stimulus_protocol₊IstimAmplitude => 0.5 - stimulus_protocol₊IstimPeriod => 1000.0 - stimulus_protocol₊IstimPulseDuration => 1.0 - slow_inward_current₊g_s => 0.0009 - membrane₊C => 0.01 -``` - -Note the form of the parameter and variable names. They are composed of two names joined by a ₊ sign. The first name is the -component name in CellML models (e.g., sodium_current, stimulus_protocol) and the second name is the actual variable name. - -Similarly, we can list the state variables by calling `list_states(ml)`: - -```Julia - slow_inward_current_d_gate₊d(time) => 0.003 - slow_inward_current_f_gate₊f(time) => 0.994 - sodium_current_j_gate₊j(time) => 0.975 - slow_inward_current₊Cai(time) => 0.0001 - time_dependent_outward_current_x1_gate₊x1(time) => 0.0001 - sodium_current_m_gate₊m(time) => 0.011 - sodium_current_h_gate₊h(time) => 0.988 - membrane₊V(time) => -84.624 -``` - -Assume we want to change `IstimPeriod`. We can easily do this with the help of `update_list!` utility function provided: - -```Julia - p = list_params(ml) - update_list!(p, :stimulus_protocol₊IstimPeriod, 250.0) - prob = ODEProblem(ml, (0, 10000.0); p=p) -``` - -The rest is the same as before. - -```Julia - sol = solve(prob, TRBDF2(), dtmax=1.0) - plot(sol, vars=8) # 8 is the index of membrane₊V -``` - -For the next example, we chose a complex model to stress the ODE solvers: [the O'Hara-Rudy left ventricular model](https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1002061). This model has 49 state variables, is very stiff, and is prone to oscillation. The best solver for this model is `CVODE_BDF` from the Sundial suite. - -```Julia - using Sundials - - ml = CellModel("models/ohara_rudy_cipa_v1_2017.cellml.xml") - tspan = (0, 5000.0) - prob = ODEProblem(ml, tspan); - sol = solve(prob, CVODE_BDF(), dtmax=0.5) - plot(sol, vars=49) # membrane₊v -``` - -![](figures/ohara_rudy.png) - -## Multi-file Models (Import) - -CellML specification allows for models spanning multiple XML files. In these models, the top level CellML XML file imports components from other CellML files, which in turn may import from other files. CellMLToolkit supports this functionality. It assumes that *the top-level file and all the imported files reside in the same directory*. `models/noble_1962` contained one such example: - -```julia -ml = CellModel("models/noble_1962/Noble_1962.cellml") -prob = ODEProblem(ml, tspan) -sol = solve(prob, TRBDF2(), dtmax = 0.5) -``` - -Note that the syntax is exactly the same as before. However, the list of the imported files are printed during `CellModel` generation: - -``` -[ Info: importing Noble62_Na_channel.cellml -[ Info: importing Noble62_units.cellml -[ Info: importing Noble62_K_channel.cellml -[ Info: importing Noble62_units.cellml -[ Info: importing Noble62_L_channel.cellml -[ Info: importing Noble62_units.cellml -[ Info: importing Noble62_units.cellml -[ Info: importing Noble62_parameters.cellml -[ Info: importing Noble62_units.cellml -``` - -Same as before, we can plot the output as - -```julia -plot(sol, vars = 2) -``` - ![](figures/noble_1962.png) From 528188da955ffe07f80fe73404d84b4272668058 Mon Sep 17 00:00:00 2001 From: Shahriar Iravanian Date: Sat, 1 Apr 2023 11:31:32 -0400 Subject: [PATCH 10/35] Update Project.toml README updated to apply new changes to the api. --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 7b82f74..0c513b3 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "CellMLToolkit" uuid = "03cb29e0-1ef4-4721-aa24-cf58a006576f" authors = ["Shahriar Iravanian "] -version = "2.10.0" +version = "2.11.0" [deps] EzXML = "8f5d6c58-4d21-5cfd-889c-e3ad7ee6a615" From d21004539f9c7b53e15181885089505418855e11 Mon Sep 17 00:00:00 2001 From: Shahriar Iravanian Date: Sat, 1 Apr 2023 11:46:48 -0400 Subject: [PATCH 11/35] Update README.md README is updated to reflect changes in the OrdinaryDiffEq interface. --- README.md | 52 +++++++++++++++++++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 4d35f05..310e1bb 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,22 @@ # CellMLToolkit.jl -CellMLToolkit.jl is a Julia library that connects [CellML](http://cellml.org) models to [SciML](http://github.com/SciML), the Scientific Julia ecosystem. CellMLToolkit.jl acts as a bridge between CellML and ModelingToolkit.jl. It imports a CellML model (in XML) and emits a ModelingToolkit.jl intermediate representation (IR), which can then enter the SciML ecosystem. +[![Join the chat at https://julialang.zulipchat.com #sciml-bridged](https://img.shields.io/static/v1?label=Zulip&message=chat&color=9558b2&labelColor=389826)](https://julialang.zulipchat.com/#narrow/stream/279055-sciml-bridged) +[![Global Docs](https://img.shields.io/badge/docs-SciML-blue.svg)](https://docs.sciml.ai/CellMLToolkit/stable/) + +[![codecov](https://codecov.io/gh/SciML/CellMLToolkit.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/SciML/CellMLToolkit.jl) +[![Build Status](https://github.com/SciML/CellMLToolkit.jl/workflows/CI/badge.svg)](https://github.com/SciML/CellMLToolkit.jl/actions?query=workflow%3ACI) + +[![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor%27s%20Guide-blueviolet)](https://github.com/SciML/ColPrac) +[![SciML Code Style](https://img.shields.io/static/v1?label=code%20style&message=SciML&color=9558b2&labelColor=389826)](https://github.com/SciML/SciMLStyle) + +CellMLToolkit.jl is a Julia library that connects [CellML](https://cellml.org/) models to [SciML](http://github.com/SciML/), the Scientific Julia ecosystem. CellMLToolkit.jl acts as a bridge between CellML and ModelingToolkit.jl. It imports a CellML model (in XML) and emits a ModelingToolkit.jl intermediate representation (IR), which can then enter the SciML ecosystem. + +## Tutorials and Documentation + +For information on using the package, +[see the stable documentation](https://docs.sciml.ai/CellMLToolkit/stable/). Use the +[in-development documentation](https://docs.sciml.ai/CellMLToolkit/dev/) for the version of +the documentation, which contains the unreleased features. ## CellML @@ -10,12 +26,13 @@ CellMLToolkit.jl is a Julia library that connects [CellML](http://cellml.org) mo [SciML](http://github.com/SciML) is a collection of Julia libraries for open source scientific computing and machine learning. The centerpiece of SciML is [DifferentialEquations.jl](https://github.com/SciML/DifferentialEquations.jl), which provides a rich set of ordinary differential equations (ODE) solvers. One major peripheral component of SciML is [ModelingToolkit.jl](https://github.com/SciML/ModelingToolkit.jl). It is a modeling framework for high-performance symbolic-numeric computation in scientific computing and scientific machine learning. The core of ModelingToolkit.jl is an IR language to code the scientific problems of interest in a high level. Automatic code generation and differentiation allow for the generation of a usable model for the other components of SciML, such as DifferentialEquations.jl. -## Install +## Installation -To install, run +To install CellMLToolkit.jl, use the Julia package manager: ```julia - ] add CellMLToolkit +using Pkg +Pkg.add("CellMLToolkit") ``` ## Simple Example @@ -25,8 +42,8 @@ To install, run ml = CellModel("models/lorenz.cellml.xml") prob = ODEProblem(ml, (0,100.0)) - sol = solve(prob, RK4()) # fourth-order Runge-Kutta method - plot(sol, idxs=(1,3)) # idxs keyword has superceded vars keyword + sol = solve(prob, RK4()) # fourth-order Runge-Kutta method + plot(sol, idxs=(1,3)) # idxs keyword has superceded vars keyword ``` Note that `model` is a directory of the CellMLToolkit package. You can find its path as @@ -38,8 +55,8 @@ Note that `model` is a directory of the CellMLToolkit package. You can find its and then ```julia - model_path = joinpath(model_root, "lorenz.cellml.xml") - ml = CellModel(model_path) +model_path = joinpath(model_root, "lorenz.cellml.xml") +ml = CellModel(model_path) ``` ## Tutorial @@ -59,14 +76,15 @@ The next step is to convert `ml` into an `ODEProblem`, ready to be solved. ```Julia prob = ODEProblem(ml, (0,100.0)) ``` + Here, `(0,100.0)` is the `tspan` parameter, describing the integration range of the independent variable. In addition to the model equations, the initial conditions and parameters are also read from the XML file(s) and are available as `prob.u0` and `prob.ps`, respectively. We can solve and visualize `prob` as ```Julia using DifferentialEquations, Plots - sol = solve(prob, RK4()) # fourth-order Runge-Kutta method - plot(sol, idxs=(1,3)) # idxs keyword has superceded vars keyword + sol = solve(prob, RK4()) # fourth-order Runge-Kutta method + plot(sol, idxs=(1,3)) # idxs keyword has superceded vars keyword ``` As expected, @@ -78,13 +96,13 @@ Let's look at more complicated examples. The next one is the [ten Tusscher-Noble ```Julia ml = CellModel("models/tentusscher_noble_noble_panfilov_2004_a.cellml.xml") prob = ODEProblem(ml, (0, 10000.0)) - sol = solve(prob, TRBDF2(), dtmax=1.0) # it is a stiff system requiring an implcit solver (TRBDF2 instead of RK4) + sol = solve(prob, TRBDF2(), dtmax=1.0) # it is a stiff system requiring an implcit solver (TRBDF2 instead of RK4) plot(sol, idxs=12) ``` ![](figures/ten.png) -We can tell which variable to plot (idxs=12, here) by looking at the output of `list_states(ml)` (see below). +We can tell which variable to plot (`idxs=12` here) by looking at the output of `list_states(ml)` (see below). Let's see how we can modify the initial values and parameters. We will use the Beeler-Reuter model with 8 state variables as an example: @@ -128,7 +146,7 @@ Assume we want to change `IstimPeriod`. We can easily do this with the help of ` ```Julia params = list_params(ml) update_list!(params, :stimulus_protocol₊IstimPeriod, 250.0) - prob = ODEProblem(ml, (0, 10000.0); p=last.(params)) + prob = ODEProblem(ml, (0, 10000.0); p=last.(params)) # note that you need to pass last.(params) and not params itself to ODEProblem ``` The rest is the same as before. @@ -157,9 +175,9 @@ For the next example, we chose a complex model to stress the ODE solvers: [the O CellML specification allows for models spanning multiple XML files. In these models, the top level CellML XML file imports components from other CellML files, which in turn may import from other files. CellMLToolkit supports this functionality. It assumes that *the top-level file and all the imported files reside in the same directory*. `models/noble_1962` contained one such example: ```julia - ml = CellModel("models/noble_1962/Noble_1962.cellml") - prob = ODEProblem(ml, tspan) - sol = solve(prob, TRBDF2(), dtmax=0.5) +ml = CellModel("models/noble_1962/Noble_1962.cellml") +prob = ODEProblem(ml, tspan) +sol = solve(prob, TRBDF2(), dtmax = 0.5) ``` Note that the syntax is exactly the same as before. However, the list of the imported files are printed during `CellModel` generation: @@ -179,7 +197,7 @@ Note that the syntax is exactly the same as before. However, the list of the imp Same as before, we can plot the output as ```julia - plot(sol, idxs=2) +plot(sol, idxs = 2) ``` ![](figures/noble_1962.png) From cd69737179a8ec1bc151a9169c8a76f53f24f638 Mon Sep 17 00:00:00 2001 From: Shahriar Iravanian Date: Sat, 1 Apr 2023 16:49:02 -0400 Subject: [PATCH 12/35] Update README.md README updated by using DifferentialEquations.jl and automatic algorithm selection --- README.md | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 310e1bb..d38b215 100644 --- a/README.md +++ b/README.md @@ -38,11 +38,11 @@ Pkg.add("CellMLToolkit") ## Simple Example ```Julia - using CellMLToolkit, OrdinaryDiffEq, Plots + using CellMLToolkit, DifferentialEquations, Plots ml = CellModel("models/lorenz.cellml.xml") prob = ODEProblem(ml, (0,100.0)) - sol = solve(prob, RK4()) # fourth-order Runge-Kutta method + sol = solve(prob) plot(sol, idxs=(1,3)) # idxs keyword has superceded vars keyword ``` @@ -83,7 +83,7 @@ In addition to the model equations, the initial conditions and parameters are al ```Julia using DifferentialEquations, Plots - sol = solve(prob, RK4()) # fourth-order Runge-Kutta method + sol = solve(prob) plot(sol, idxs=(1,3)) # idxs keyword has superceded vars keyword ``` @@ -96,7 +96,7 @@ Let's look at more complicated examples. The next one is the [ten Tusscher-Noble ```Julia ml = CellModel("models/tentusscher_noble_noble_panfilov_2004_a.cellml.xml") prob = ODEProblem(ml, (0, 10000.0)) - sol = solve(prob, TRBDF2(), dtmax=1.0) # it is a stiff system requiring an implcit solver (TRBDF2 instead of RK4) + sol = solve(prob, dtmax=1.0) # we need to set dtmax to allow for on-time stimulation plot(sol, idxs=12) ``` @@ -133,12 +133,12 @@ Similarly, we can list the state variables by calling `list_states(ml)`: ```Julia slow_inward_current_d_gate₊d(time) => 0.003 slow_inward_current_f_gate₊f(time) => 0.994 - sodium_current_j_gate₊j(time) => 0.975 slow_inward_current₊Cai(time) => 0.0001 - time_dependent_outward_current_x1_gate₊x1(time) => 0.0001 + time_dependent_outward_current_x1_gate₊x1(time) => 0.0001 sodium_current_m_gate₊m(time) => 0.011 sodium_current_h_gate₊h(time) => 0.988 membrane₊V(time) => -84.624 + sodium_current_j_gate₊j(time) => 0.975 ``` Assume we want to change `IstimPeriod`. We can easily do this with the help of `update_list!` utility function provided: @@ -152,19 +152,17 @@ Assume we want to change `IstimPeriod`. We can easily do this with the help of ` The rest is the same as before. ```Julia - sol = solve(prob, TRBDF2(), dtmax=1.0) + sol = solve(prob, dtmax=1.0) plot(sol, idxs=8) # 8 is the index of membrane₊V ``` -For the next example, we chose a complex model to stress the ODE solvers: [the O'Hara-Rudy left ventricular model](https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1002061). This model has 49 state variables, is very stiff, and is prone to oscillation. The best solver for this model is `CVODE_BDF` from the Sundial suite. +For the next example, we chose a complex model to stress the ODE solvers: [the O'Hara-Rudy left ventricular model](https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1002061). This model has 49 state variables, is very stiff, and is prone to oscillation. In the previous versions of this document, we used `CVODE_BDF` from the Sundial suite (`using Sundials`) to solve this problem. Fortunatelly, DifferentialEquations.jl has advanced signigficantly such that an efficient and pure Julia solution to the O'Hara-Rudy model is possible. ```Julia - using Sundials - ml = CellModel("models/ohara_rudy_cipa_v1_2017.cellml.xml") tspan = (0, 5000.0) prob = ODEProblem(ml, tspan); - sol = solve(prob, CVODE_BDF(), dtmax=0.5) + sol = solve(prob, dtmax=1.0) plot(sol, idxs=49) # membrane₊v ``` From f196fae3f1b11e017228b4808eda916b0ef13f87 Mon Sep 17 00:00:00 2001 From: Shahriar Iravanian Date: Sat, 1 Apr 2023 16:56:05 -0400 Subject: [PATCH 13/35] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d38b215..9903dd2 100644 --- a/README.md +++ b/README.md @@ -153,7 +153,7 @@ The rest is the same as before. ```Julia sol = solve(prob, dtmax=1.0) - plot(sol, idxs=8) # 8 is the index of membrane₊V + plot(sol, idxs=7) # 7 is the index of membrane₊V ``` For the next example, we chose a complex model to stress the ODE solvers: [the O'Hara-Rudy left ventricular model](https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1002061). This model has 49 state variables, is very stiff, and is prone to oscillation. In the previous versions of this document, we used `CVODE_BDF` from the Sundial suite (`using Sundials`) to solve this problem. Fortunatelly, DifferentialEquations.jl has advanced signigficantly such that an efficient and pure Julia solution to the O'Hara-Rudy model is possible. @@ -175,7 +175,7 @@ CellML specification allows for models spanning multiple XML files. In these mod ```julia ml = CellModel("models/noble_1962/Noble_1962.cellml") prob = ODEProblem(ml, tspan) -sol = solve(prob, TRBDF2(), dtmax = 0.5) +sol = solve(prob, dtmax=0.5) ``` Note that the syntax is exactly the same as before. However, the list of the imported files are printed during `CellModel` generation: @@ -195,7 +195,7 @@ Note that the syntax is exactly the same as before. However, the list of the imp Same as before, we can plot the output as ```julia -plot(sol, idxs = 2) +plot(sol, idxs=2) ``` ![](figures/noble_1962.png) From a4e0582e12f45f5dc7e0e544dba82fda369e7c9a Mon Sep 17 00:00:00 2001 From: Shahriar Iravanian Date: Sat, 1 Apr 2023 16:57:05 -0400 Subject: [PATCH 14/35] Update Project.toml --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 0c513b3..9644d81 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "CellMLToolkit" uuid = "03cb29e0-1ef4-4721-aa24-cf58a006576f" authors = ["Shahriar Iravanian "] -version = "2.11.0" +version = "2.11.1" [deps] EzXML = "8f5d6c58-4d21-5cfd-889c-e3ad7ee6a615" From 5a637030b2807263b6545187b9d6117537c095f4 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Tue, 4 Apr 2023 17:51:42 -0400 Subject: [PATCH 15/35] Update Project.toml --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 9644d81..0c513b3 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "CellMLToolkit" uuid = "03cb29e0-1ef4-4721-aa24-cf58a006576f" authors = ["Shahriar Iravanian "] -version = "2.11.1" +version = "2.11.0" [deps] EzXML = "8f5d6c58-4d21-5cfd-889c-e3ad7ee6a615" From b3a93b913647ffe5aba8d1c7bafb7918b798fa65 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Sep 2023 12:01:29 +0000 Subject: [PATCH 16/35] Bump actions/checkout from 3 to 4 Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/Documentation.yml | 2 +- .github/workflows/FormatCheck.yml | 2 +- .github/workflows/Invalidations.yml | 4 ++-- .github/workflows/ci.yml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml index fcd9280..c6952b5 100644 --- a/.github/workflows/Documentation.yml +++ b/.github/workflows/Documentation.yml @@ -11,7 +11,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@latest with: version: '1.6' diff --git a/.github/workflows/FormatCheck.yml b/.github/workflows/FormatCheck.yml index f80d0b1..dd55150 100644 --- a/.github/workflows/FormatCheck.yml +++ b/.github/workflows/FormatCheck.yml @@ -21,7 +21,7 @@ jobs: with: version: ${{ matrix.julia-version }} - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install JuliaFormatter and format # This will use the latest version by default but you can set the version like so: # diff --git a/.github/workflows/Invalidations.yml b/.github/workflows/Invalidations.yml index 4d0004e..28b9ce2 100644 --- a/.github/workflows/Invalidations.yml +++ b/.github/workflows/Invalidations.yml @@ -19,12 +19,12 @@ jobs: - uses: julia-actions/setup-julia@v1 with: version: '1' - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-invalidations@v1 id: invs_pr - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{ github.event.repository.default_branch }} - uses: julia-actions/julia-buildpkg@v1 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 37b1571..56c5cda 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: - '1' - '1.6' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@v1 with: version: ${{ matrix.version }} From ee66a5b4d7bbc03b4ef38d0a75595c0777d9a133 Mon Sep 17 00:00:00 2001 From: Arno Strouwen Date: Mon, 25 Sep 2023 18:49:55 +0200 Subject: [PATCH 17/35] Documenter 1.0 upgrade --- .github/workflows/ci.yml | 12 +++++- README.md | 14 +++---- docs/Project.toml | 2 +- docs/make.jl | 11 +----- {figures => docs/src/assets}/lorenz.png | Bin {figures => docs/src/assets}/noble_1962.png | Bin {figures => docs/src/assets}/ohara_rudy.png | Bin {figures => docs/src/assets}/ten.png | Bin {figures => docs/src/assets}/ten_400.png | Bin docs/src/index.md | 41 +++++++------------- docs/src/tutorial.md | 8 ++-- 11 files changed, 38 insertions(+), 50 deletions(-) rename {figures => docs/src/assets}/lorenz.png (100%) rename {figures => docs/src/assets}/noble_1962.png (100%) rename {figures => docs/src/assets}/ohara_rudy.png (100%) rename {figures => docs/src/assets}/ten.png (100%) rename {figures => docs/src/assets}/ten_400.png (100%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 56c5cda..f77e29f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,5 +1,15 @@ name: CI -on: [push, pull_request] +on: + pull_request: + branches: + - master + paths-ignore: + - 'docs/**' + push: + branches: + - master + paths-ignore: + - 'docs/**' jobs: test: runs-on: ubuntu-latest diff --git a/README.md b/README.md index 9903dd2..1f48de5 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ [![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor%27s%20Guide-blueviolet)](https://github.com/SciML/ColPrac) [![SciML Code Style](https://img.shields.io/static/v1?label=code%20style&message=SciML&color=9558b2&labelColor=389826)](https://github.com/SciML/SciMLStyle) -CellMLToolkit.jl is a Julia library that connects [CellML](https://cellml.org/) models to [SciML](http://github.com/SciML/), the Scientific Julia ecosystem. CellMLToolkit.jl acts as a bridge between CellML and ModelingToolkit.jl. It imports a CellML model (in XML) and emits a ModelingToolkit.jl intermediate representation (IR), which can then enter the SciML ecosystem. +CellMLToolkit.jl is a Julia library that connects [CellML](https://cellml.org/) models to [SciML](https://github.com/SciML/), the Scientific Julia ecosystem. CellMLToolkit.jl acts as a bridge between CellML and ModelingToolkit.jl. It imports a CellML model (in XML) and emits a ModelingToolkit.jl intermediate representation (IR), which can then enter the SciML ecosystem. ## Tutorials and Documentation @@ -20,11 +20,11 @@ the documentation, which contains the unreleased features. ## CellML -[CellML](http://cellml.org) is an XML-based open-standard for the exchange of mathematical models. CellML originally started in 1998 by the Auckland Bioengineering Institute at the University of Auckland and affiliated research groups. Since then, its [repository](https://models.physiomeproject.org/welcome) has grown to more than a thousand models. While CellML is not domain-specific, its focus has been on biomedical models. Currently, the active categories in the repository are *Calcium Dynamics*, *Cardiovascular Circulation*, *Cell Cycle*, *Cell Migration*, *Circadian Rhythms*, *Electrophysiology*, *Endocrine*, *Excitation-Contraction Coupling*, *Gene Regulation*, *Hepatology*, *Immunology*, *Ion Transport*, *Mechanical Constitutive Laws*, *Metabolism*, *Myofilament Mechanics*, *Neurobiology*, *pH Regulation*, *PKPD*, *Protein Modules*, *Signal Transduction*, and *Synthetic Biology*. There are many software tools to import, process and run CellML models; however, these tools are not Julia-specific. +[CellML](https://cellml.org) is an XML-based open-standard for the exchange of mathematical models. CellML originally started in 1998 by the Auckland Bioengineering Institute at the University of Auckland and affiliated research groups. Since then, its [repository](https://models.physiomeproject.org/welcome) has grown to more than a thousand models. While CellML is not domain-specific, its focus has been on biomedical models. Currently, the active categories in the repository are *Calcium Dynamics*, *Cardiovascular Circulation*, *Cell Cycle*, *Cell Migration*, *Circadian Rhythms*, *Electrophysiology*, *Endocrine*, *Excitation-Contraction Coupling*, *Gene Regulation*, *Hepatology*, *Immunology*, *Ion Transport*, *Mechanical Constitutive Laws*, *Metabolism*, *Myofilament Mechanics*, *Neurobiology*, *pH Regulation*, *PKPD*, *Protein Modules*, *Signal Transduction*, and *Synthetic Biology*. There are many software tools to import, process and run CellML models; however, these tools are not Julia-specific. ## SciML -[SciML](http://github.com/SciML) is a collection of Julia libraries for open source scientific computing and machine learning. The centerpiece of SciML is [DifferentialEquations.jl](https://github.com/SciML/DifferentialEquations.jl), which provides a rich set of ordinary differential equations (ODE) solvers. One major peripheral component of SciML is [ModelingToolkit.jl](https://github.com/SciML/ModelingToolkit.jl). It is a modeling framework for high-performance symbolic-numeric computation in scientific computing and scientific machine learning. The core of ModelingToolkit.jl is an IR language to code the scientific problems of interest in a high level. Automatic code generation and differentiation allow for the generation of a usable model for the other components of SciML, such as DifferentialEquations.jl. +[SciML](https://github.com/SciML) is a collection of Julia libraries for open source scientific computing and machine learning. The centerpiece of SciML is [DifferentialEquations.jl](https://github.com/SciML/DifferentialEquations.jl), which provides a rich set of ordinary differential equations (ODE) solvers. One major peripheral component of SciML is [ModelingToolkit.jl](https://github.com/SciML/ModelingToolkit.jl). It is a modeling framework for high-performance symbolic-numeric computation in scientific computing and scientific machine learning. The core of ModelingToolkit.jl is an IR language to code the scientific problems of interest in a high level. Automatic code generation and differentiation allow for the generation of a usable model for the other components of SciML, such as DifferentialEquations.jl. ## Installation @@ -89,7 +89,7 @@ In addition to the model equations, the initial conditions and parameters are al As expected, -![](figures/lorenz.png) +![](docs/src/assets/lorenz.png) Let's look at more complicated examples. The next one is the [ten Tusscher-Noble-Noble-Panfilov human left ventricular action potential model](https://journals.physiology.org/doi/full/10.1152/ajpheart.00794.2003). This is a mid-range electrophysiology model with 17 states variables and relatively good numerical stability. @@ -100,7 +100,7 @@ Let's look at more complicated examples. The next one is the [ten Tusscher-Noble plot(sol, idxs=12) ``` -![](figures/ten.png) +![](docs/src/assets/ten.png) We can tell which variable to plot (`idxs=12` here) by looking at the output of `list_states(ml)` (see below). @@ -166,7 +166,7 @@ For the next example, we chose a complex model to stress the ODE solvers: [the O plot(sol, idxs=49) # membrane₊v ``` -![](figures/ohara_rudy.png) +![](docs/src/assets/ohara_rudy.png) ## Multi-file Models (Import) @@ -198,4 +198,4 @@ Same as before, we can plot the output as plot(sol, idxs=2) ``` -![](figures/noble_1962.png) +![](docs/src/assets/noble_1962.png) diff --git a/docs/Project.toml b/docs/Project.toml index 2e4c9c0..818e13e 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -4,4 +4,4 @@ Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" [compat] CellMLToolkit = "2.9" -Documenter = "0.27" \ No newline at end of file +Documenter = "1" \ No newline at end of file diff --git a/docs/make.jl b/docs/make.jl index f5b2b80..a82845f 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -20,16 +20,7 @@ makedocs(sitename = "CellMLToolkit.jl", linkcheck_ignore = [ "https://journals.physiology.org/doi/full/10.1152/ajpheart.00794.2003", ], - strict = [ - :doctest, - :linkcheck, - :parse_error, - :example_block, - # Other available options are - # :autodocs_block, :cross_references, :docs_block, :eval_block, :example_block, :footnote, :meta_block, :missing_docs, :setup_block - ], - format = Documenter.HTML(; analytics = "UA-90474609-3", - assets = ["assets/favicon.ico"], + format = Documenter.HTML(;assets = ["assets/favicon.ico"], mathengine, canonical = "https://docs.sciml.ai/CellMLToolkit/stable/", prettyurls = (get(ENV, "CI", nothing) == "true")), diff --git a/figures/lorenz.png b/docs/src/assets/lorenz.png similarity index 100% rename from figures/lorenz.png rename to docs/src/assets/lorenz.png diff --git a/figures/noble_1962.png b/docs/src/assets/noble_1962.png similarity index 100% rename from figures/noble_1962.png rename to docs/src/assets/noble_1962.png diff --git a/figures/ohara_rudy.png b/docs/src/assets/ohara_rudy.png similarity index 100% rename from figures/ohara_rudy.png rename to docs/src/assets/ohara_rudy.png diff --git a/figures/ten.png b/docs/src/assets/ten.png similarity index 100% rename from figures/ten.png rename to docs/src/assets/ten.png diff --git a/figures/ten_400.png b/docs/src/assets/ten_400.png similarity index 100% rename from figures/ten_400.png rename to docs/src/assets/ten_400.png diff --git a/docs/src/index.md b/docs/src/index.md index 7cc5ab6..19cd0f3 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -4,11 +4,11 @@ CellMLToolkit.jl is a Julia library that connects CellML models to the Scientifi ## CellML -[CellML](http://cellml.org) is an XML-based open-standard for the exchange of mathematical models. CellML originally started in 1998 by the Auckland Bioengineering Institute at the University of Auckland and affiliated research groups. Since then, its [repository](https://models.physiomeproject.org/welcome) has grown to more than a thousand models. While CellML is not domain-specific, its focus has been on biomedical models. Currently, the active categories in the repository are *Calcium Dynamics*, *Cardiovascular Circulation*, *Cell Cycle*, *Cell Migration*, *Circadian Rhythms*, *Electrophysiology*, *Endocrine*, *Excitation-Contraction Coupling*, *Gene Regulation*, *Hepatology*, *Immunology*, *Ion Transport*, *Mechanical Constitutive Laws*, *Metabolism*, *Myofilament Mechanics*, *Neurobiology*, *pH Regulation*, *PKPD*, *Protein Modules*, *Signal Transduction*, and *Synthetic Biology*. There are many software tools to import, process and run CellML models; however, these tools are not Julia-specific. +[CellML](https://cellml.org) is an XML-based open-standard for the exchange of mathematical models. CellML originally started in 1998 by the Auckland Bioengineering Institute at the University of Auckland and affiliated research groups. Since then, its [repository](https://models.physiomeproject.org/welcome) has grown to more than a thousand models. While CellML is not domain-specific, its focus has been on biomedical models. Currently, the active categories in the repository are *Calcium Dynamics*, *Cardiovascular Circulation*, *Cell Cycle*, *Cell Migration*, *Circadian Rhythms*, *Electrophysiology*, *Endocrine*, *Excitation-Contraction Coupling*, *Gene Regulation*, *Hepatology*, *Immunology*, *Ion Transport*, *Mechanical Constitutive Laws*, *Metabolism*, *Myofilament Mechanics*, *Neurobiology*, *pH Regulation*, *PKPD*, *Protein Modules*, *Signal Transduction*, and *Synthetic Biology*. There are many software tools to import, process and run CellML models; however, these tools are not Julia-specific. ## SciML -[SciML](http://github.com/SciML) is a collection of Julia libraries for open source scientific computing and machine learning. The centerpiece of SciML is [DifferentialEquations.jl](https://github.com/SciML/DifferentialEquations.jl), which provides a rich set of ordinary differential equations (ODE) solvers. One major peripheral component of SciML is [ModelingToolkit.jl](https://github.com/SciML/ModelingToolkit.jl). It is a modeling framework for high-performance symbolic-numeric computation in scientific computing and scientific machine learning. The core of ModelingToolkit.jl is an IR language to code the scientific problems of interest in a high level. Automatic code generation and differentiation allow for the generation of a usable model for the other components of SciML, such as DifferentialEquations.jl. +[SciML](https://github.com/SciML) is a collection of Julia libraries for open source scientific computing and machine learning. The centerpiece of SciML is [DifferentialEquations.jl](https://github.com/SciML/DifferentialEquations.jl), which provides a rich set of ordinary differential equations (ODE) solvers. One major peripheral component of SciML is [ModelingToolkit.jl](https://github.com/SciML/ModelingToolkit.jl). It is a modeling framework for high-performance symbolic-numeric computation in scientific computing and scientific machine learning. The core of ModelingToolkit.jl is an IR language to code the scientific problems of interest in a high level. Automatic code generation and differentiation allow for the generation of a usable model for the other components of SciML, such as DifferentialEquations.jl. ## Installation @@ -91,32 +91,19 @@ Pkg.status(; mode = PKGMODE_MANIFEST) # hide ``` -```@raw html -You can also download the -manifest file and the -project file. -``` +link_manifest = "https://github.com/SciML/" * name * ".jl/tree/gh-pages/v" * version * + "/assets/Manifest.toml" +link_project = "https://github.com/SciML/" * name * ".jl/tree/gh-pages/v" * version * + "/assets/Project.toml" +Markdown.parse("""You can also download the +[manifest]($link_manifest) +file and the +[project]($link_project) +file. +""") +``` \ No newline at end of file diff --git a/docs/src/tutorial.md b/docs/src/tutorial.md index 3b4a8cc..0e638b7 100644 --- a/docs/src/tutorial.md +++ b/docs/src/tutorial.md @@ -24,7 +24,7 @@ Now, `ml` points to a `CellModel` struct that contains the details of the model As expected, -![](../../../figures/lorenz.png) +![](assets/lorenz.png) Let's look at more complicated examples. The next one is the [ten Tusscher-Noble-Noble-Panfilov human left ventricular action potential model](https://journals.physiology.org/doi/full/10.1152/ajpheart.00794.2003). This is a mid-range electrophysiology model with 17 states variables and relatively good numerical stability. @@ -37,7 +37,7 @@ Let's look at more complicated examples. The next one is the [ten Tusscher-Noble plot(sol.t, V) ``` -![](../../../figures/ten.png) +![](assets/ten.png) We can also enhance the model by asking ModelingToolkit.jl to generate a Jacobian by passing `jac=true` to the `ODEProblem` constructor. @@ -56,7 +56,7 @@ The rest remains the same. For the last example, we chose a complex model to str plot(sol.t, V) ``` -![](../../../figures/ohara_rudy.png) +![](assets/ohara_rudy.png) ## Changing Parameters @@ -105,6 +105,6 @@ V = map(x -> x[1], sol.u) plot(sol.t, V) ``` -![](../../../figures/ten_400.png) +![](assets/ten_400.png) `ODEProblem` also accepts a `u0` parameter to change the initial conditions (remember `u0 = list_initial_conditions(ml)`). From d2f69d226840de5faf2edba86e8d8ce1fc28256d Mon Sep 17 00:00:00 2001 From: Arno Strouwen Date: Mon, 25 Sep 2023 18:54:29 +0200 Subject: [PATCH 18/35] LanguageTool --- README.md | 2 +- docs/src/index.md | 2 +- docs/src/tutorial.md | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 1f48de5..9d92177 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ the documentation, which contains the unreleased features. ## SciML -[SciML](https://github.com/SciML) is a collection of Julia libraries for open source scientific computing and machine learning. The centerpiece of SciML is [DifferentialEquations.jl](https://github.com/SciML/DifferentialEquations.jl), which provides a rich set of ordinary differential equations (ODE) solvers. One major peripheral component of SciML is [ModelingToolkit.jl](https://github.com/SciML/ModelingToolkit.jl). It is a modeling framework for high-performance symbolic-numeric computation in scientific computing and scientific machine learning. The core of ModelingToolkit.jl is an IR language to code the scientific problems of interest in a high level. Automatic code generation and differentiation allow for the generation of a usable model for the other components of SciML, such as DifferentialEquations.jl. +[SciML](https://github.com/SciML) is a collection of Julia libraries for open source scientific computing and machine learning. The centerpiece of SciML is [DifferentialEquations.jl](https://github.com/SciML/DifferentialEquations.jl), which provides a rich set of ordinary differential equations (ODE) solvers. One major peripheral component of SciML is [ModelingToolkit.jl](https://github.com/SciML/ModelingToolkit.jl). It is a modeling framework for high-performance symbolic-numeric computation in scientific computing and scientific machine learning. The core of ModelingToolkit.jl is an IR language to code the scientific problems of interest at a high level. Automatic code generation and differentiation allow for the generation of a usable model for the other components of SciML, such as DifferentialEquations.jl. ## Installation diff --git a/docs/src/index.md b/docs/src/index.md index 19cd0f3..5f7b8ad 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -8,7 +8,7 @@ CellMLToolkit.jl is a Julia library that connects CellML models to the Scientifi ## SciML -[SciML](https://github.com/SciML) is a collection of Julia libraries for open source scientific computing and machine learning. The centerpiece of SciML is [DifferentialEquations.jl](https://github.com/SciML/DifferentialEquations.jl), which provides a rich set of ordinary differential equations (ODE) solvers. One major peripheral component of SciML is [ModelingToolkit.jl](https://github.com/SciML/ModelingToolkit.jl). It is a modeling framework for high-performance symbolic-numeric computation in scientific computing and scientific machine learning. The core of ModelingToolkit.jl is an IR language to code the scientific problems of interest in a high level. Automatic code generation and differentiation allow for the generation of a usable model for the other components of SciML, such as DifferentialEquations.jl. +[SciML](https://github.com/SciML) is a collection of Julia libraries for open source scientific computing and machine learning. The centerpiece of SciML is [DifferentialEquations.jl](https://github.com/SciML/DifferentialEquations.jl), which provides a rich set of ordinary differential equations (ODE) solvers. One major peripheral component of SciML is [ModelingToolkit.jl](https://github.com/SciML/ModelingToolkit.jl). It is a modeling framework for high-performance symbolic-numeric computation in scientific computing and scientific machine learning. The core of ModelingToolkit.jl is an IR language to code the scientific problems of interest at a high level. Automatic code generation and differentiation allow for the generation of a usable model for the other components of SciML, such as DifferentialEquations.jl. ## Installation diff --git a/docs/src/tutorial.md b/docs/src/tutorial.md index 0e638b7..17a1099 100644 --- a/docs/src/tutorial.md +++ b/docs/src/tutorial.md @@ -1,6 +1,6 @@ # Tutorial -The models directory contains few CellML model examples. Let's start with a simple one, the famous Lorenz equations! +The models directory contains a few CellML model examples. Let's start with a simple one, the famous Lorenz equations! ```Julia using CellMLToolkit @@ -11,7 +11,7 @@ The models directory contains few CellML model examples. Let's start with a simp prob = ODEProblem(ml, tspan) ``` -Now, `ml` points to a `CellModel` struct that contains the details of the model and `prob` is an `ODEProblem` ready for integration. We can solve and visualize `prob` as +Now, `ml` points to a `CellModel` struct that contains the details of the model, and `prob` is an `ODEProblem` ready for integration. We can solve and visualize `prob` as ```Julia using DifferentialEquations, Plots @@ -26,7 +26,7 @@ As expected, ![](assets/lorenz.png) -Let's look at more complicated examples. The next one is the [ten Tusscher-Noble-Noble-Panfilov human left ventricular action potential model](https://journals.physiology.org/doi/full/10.1152/ajpheart.00794.2003). This is a mid-range electrophysiology model with 17 states variables and relatively good numerical stability. +Let's look at more complicated examples. The next one is the [ten Tusscher-Noble-Noble-Panfilov human left ventricular action potential model](https://journals.physiology.org/doi/full/10.1152/ajpheart.00794.2003). This is a mid-range electrophysiology model with 17 state variables and relatively good numerical stability. ```Julia ml = CellModel("models/tentusscher_noble_noble_panfilov_2004_a.cellml.xml") From 056715698ede200b2a4c3975cc64d5af8fb905a8 Mon Sep 17 00:00:00 2001 From: Arno Strouwen Date: Wed, 13 Dec 2023 19:47:39 +0100 Subject: [PATCH 19/35] typos CI --- .github/dependabot.yml | 3 +++ .github/workflows/SpellCheck.yml | 13 +++++++++++++ .typos.toml | 5 +++++ README.md | 6 +++--- models/beeler_reuter_1977.cellml.xml | 2 +- src/components.jl | 4 ++-- src/import.jl | 4 ++-- 7 files changed, 29 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/SpellCheck.yml create mode 100644 .typos.toml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 700707c..1e8a051 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,3 +5,6 @@ updates: directory: "/" # Location of package manifests schedule: interval: "weekly" + ignore: + - dependency-name: "crate-ci/typos" + update-types: ["version-update:semver-patch"] diff --git a/.github/workflows/SpellCheck.yml b/.github/workflows/SpellCheck.yml new file mode 100644 index 0000000..599253c --- /dev/null +++ b/.github/workflows/SpellCheck.yml @@ -0,0 +1,13 @@ +name: Spell Check + +on: [pull_request] + +jobs: + typos-check: + name: Spell Check with Typos + runs-on: ubuntu-latest + steps: + - name: Checkout Actions Repository + uses: actions/checkout@v3 + - name: Check spelling + uses: crate-ci/typos@v1.16.23 \ No newline at end of file diff --git a/.typos.toml b/.typos.toml new file mode 100644 index 0000000..6f62306 --- /dev/null +++ b/.typos.toml @@ -0,0 +1,5 @@ +[default.extend-words] +ba = "ba" +caf = "caf" +ths = "ths" +allo = "allo" \ No newline at end of file diff --git a/README.md b/README.md index 9d92177..29c04ae 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Pkg.add("CellMLToolkit") ml = CellModel("models/lorenz.cellml.xml") prob = ODEProblem(ml, (0,100.0)) sol = solve(prob) - plot(sol, idxs=(1,3)) # idxs keyword has superceded vars keyword + plot(sol, idxs=(1,3)) # idxs keyword has superseded vars keyword ``` Note that `model` is a directory of the CellMLToolkit package. You can find its path as @@ -84,7 +84,7 @@ In addition to the model equations, the initial conditions and parameters are al using DifferentialEquations, Plots sol = solve(prob) - plot(sol, idxs=(1,3)) # idxs keyword has superceded vars keyword + plot(sol, idxs=(1,3)) # idxs keyword has superseded vars keyword ``` As expected, @@ -156,7 +156,7 @@ The rest is the same as before. plot(sol, idxs=7) # 7 is the index of membrane₊V ``` -For the next example, we chose a complex model to stress the ODE solvers: [the O'Hara-Rudy left ventricular model](https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1002061). This model has 49 state variables, is very stiff, and is prone to oscillation. In the previous versions of this document, we used `CVODE_BDF` from the Sundial suite (`using Sundials`) to solve this problem. Fortunatelly, DifferentialEquations.jl has advanced signigficantly such that an efficient and pure Julia solution to the O'Hara-Rudy model is possible. +For the next example, we chose a complex model to stress the ODE solvers: [the O'Hara-Rudy left ventricular model](https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1002061). This model has 49 state variables, is very stiff, and is prone to oscillation. In the previous versions of this document, we used `CVODE_BDF` from the Sundial suite (`using Sundials`) to solve this problem. Fortunately, DifferentialEquations.jl has advanced signigficantly such that an efficient and pure Julia solution to the O'Hara-Rudy model is possible. ```Julia ml = CellModel("models/ohara_rudy_cipa_v1_2017.cellml.xml") diff --git a/models/beeler_reuter_1977.cellml.xml b/models/beeler_reuter_1977.cellml.xml index 8b4e970..d11c288 100644 --- a/models/beeler_reuter_1977.cellml.xml +++ b/models/beeler_reuter_1977.cellml.xml @@ -1347,7 +1347,7 @@ The breakdown of the model into components and the definition of encapsulation a - Added an intial value for X1 to enable the model to run. + Added an initial value for X1 to enable the model to run. diff --git a/src/components.jl b/src/components.jl index 41d99e2..0289631 100644 --- a/src/components.jl +++ b/src/components.jl @@ -102,7 +102,7 @@ list_all_lhs(doc::Document) = ∪([list_component_lhs(c) for c in components(doc """ find_equivalence_groups categorizes all the variables in the doc document - based on the connections into equivalnce groups + based on the connections into equivalence groups it returns a Dictionary of Var to groups (Set of Vars) """ @memoize function find_equivalence_groups(doc::Document) @@ -197,7 +197,7 @@ end post_substitution generates the substitution rules to be applied to the merged system after structural_simplify is applied - if changes the names of the indepedent variable (iv) in each system + if changes the names of the independent variable (iv) in each system to the global iv name TODO: this function assumes the basic iv name is the same among all systems diff --git a/src/import.jl b/src/import.jl index 0d2ddd7..d4a1999 100644 --- a/src/import.jl +++ b/src/import.jl @@ -62,7 +62,7 @@ find_component(doc::Document, name) = find_component(doc.comps, name) implicit_name(sym) = Symbol("$(string(sym))") """ - resolve_imports recursivelly resolves the imported components of doc. + resolve_imports recursively resolves the imported components of doc. """ function resolve_imports!(doc::Document) for ϵ in list_imports(doc) # εισαγωγή == import @@ -113,7 +113,7 @@ function resolve_imports!(doc::Document) end """ - find_closure finds the transitive closure of a list of componenets (l) minus + find_closure finds the transitive closure of a list of components (l) minus the list itself, i.e., it returns the list of components in doc which are reachable through a chain of connections starting from any component in l. """ From 504680442252816c38fc82a5ed2d37c1f61e41eb Mon Sep 17 00:00:00 2001 From: Arno Strouwen Date: Wed, 13 Dec 2023 20:15:43 +0100 Subject: [PATCH 20/35] Aqua CI --- Project.toml | 7 ++++++- src/CellMLToolkit.jl | 4 ++-- test/qa.jl | 12 ++++++++++++ test/runtests.jl | 1 + 4 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 test/qa.jl diff --git a/Project.toml b/Project.toml index 0c513b3..0d662b9 100644 --- a/Project.toml +++ b/Project.toml @@ -14,18 +14,23 @@ SymbolicUtils = "d1185830-fcd6-423d-90d6-eec64667417b" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [compat] +Aqua = "0.8" EzXML = "1.1" MathML = "0.1.9" Memoize = "0.4" ModelingToolkit = "7, 8" +Random = "1" Setfield = "0.8, 1" SymbolicUtils = "0.16, 0.18, 0.19, 1" +OrdinaryDiffEq = "6" +Test = "1" julia = "1.6" [extras] +Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78" OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["Test", "ModelingToolkit", "OrdinaryDiffEq"] +test = ["Aqua", "Test", "ModelingToolkit", "OrdinaryDiffEq"] diff --git a/src/CellMLToolkit.jl b/src/CellMLToolkit.jl index 227bd0e..b4898c3 100644 --- a/src/CellMLToolkit.jl +++ b/src/CellMLToolkit.jl @@ -21,9 +21,9 @@ end ############################################################################## export CellModel, ODEProblem -export read_cellml, parse_cellml +export read_cellml export list_params, list_states -export readxml, getxml, getsys +export readxml, getsys export update_list! getsys(ml::CellModel) = ml.sys diff --git a/test/qa.jl b/test/qa.jl new file mode 100644 index 0000000..c024507 --- /dev/null +++ b/test/qa.jl @@ -0,0 +1,12 @@ +using CellMLToolkit, Aqua +@testset "Aqua" begin + Aqua.find_persistent_tasks_deps(CellMLToolkit) + Aqua.test_ambiguities(CellMLToolkit, recursive = false) + Aqua.test_deps_compat(CellMLToolkit) + Aqua.test_piracies(CellMLToolkit, + treat_as_own = []) + Aqua.test_project_extras(CellMLToolkit) + Aqua.test_stale_deps(CellMLToolkit) + Aqua.test_unbound_args(CellMLToolkit) + Aqua.test_undefined_exports(CellMLToolkit) +end diff --git a/test/runtests.jl b/test/runtests.jl index dc7ac5e..07de834 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -4,6 +4,7 @@ using OrdinaryDiffEq using ModelingToolkit @testset "CellMLToolkit.jl" begin + @testset "Quality Assurance" begin include("qa.jl") end @testset "beeler.jl" begin include("beeler.jl") end @testset "noble_1962.jl" begin include("noble_1962.jl") end end From 4e10a1e33d342f140bbed083c67bb7bca1a4ff2b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Dec 2023 03:18:24 +0000 Subject: [PATCH 21/35] Bump actions/checkout from 3 to 4 Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/SpellCheck.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/SpellCheck.yml b/.github/workflows/SpellCheck.yml index 599253c..74af4ef 100644 --- a/.github/workflows/SpellCheck.yml +++ b/.github/workflows/SpellCheck.yml @@ -8,6 +8,6 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Actions Repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Check spelling uses: crate-ci/typos@v1.16.23 \ No newline at end of file From ede862919cb4ab627a912624783a1a162ee5dc0d Mon Sep 17 00:00:00 2001 From: ArnoStrouwen Date: Tue, 2 Jan 2024 05:55:13 +0100 Subject: [PATCH 22/35] Downgrade CI --- .github/workflows/Documentation.yml | 2 +- .github/workflows/Downgrade.yml | 29 +++++++++++++++++++++++++++++ .github/workflows/ci.yml | 1 - Project.toml | 16 ++++++++-------- 4 files changed, 38 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/Downgrade.yml diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml index c6952b5..adc1628 100644 --- a/.github/workflows/Documentation.yml +++ b/.github/workflows/Documentation.yml @@ -14,7 +14,7 @@ jobs: - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@latest with: - version: '1.6' + version: '1' - name: Install dependencies run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' - name: Build and deploy diff --git a/.github/workflows/Downgrade.yml b/.github/workflows/Downgrade.yml new file mode 100644 index 0000000..01ff8ca --- /dev/null +++ b/.github/workflows/Downgrade.yml @@ -0,0 +1,29 @@ +name: Downgrade +on: + pull_request: + branches: + - master + paths-ignore: + - 'docs/**' + push: + branches: + - master + paths-ignore: + - 'docs/**' +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + version: ['1'] + steps: + - uses: actions/checkout@v4 + - uses: julia-actions/setup-julia@v1 + with: + version: ${{ matrix.version }} + - uses: cjdoris/julia-downgrade-compat-action@v1 +# if: ${{ matrix.version == '1.6' }} + with: + skip: Pkg,TOML + - uses: julia-actions/julia-buildpkg@v1 + - uses: julia-actions/julia-runtest@v1 \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f77e29f..c53fecd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,6 @@ jobs: - Core version: - '1' - - '1.6' steps: - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@v1 diff --git a/Project.toml b/Project.toml index 0d662b9..c873f2a 100644 --- a/Project.toml +++ b/Project.toml @@ -16,15 +16,15 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [compat] Aqua = "0.8" EzXML = "1.1" -MathML = "0.1.9" -Memoize = "0.4" -ModelingToolkit = "7, 8" -Random = "1" +MathML = "0.1.14" +Memoize = "0.4.2" +ModelingToolkit = "8.71" +Random = "1.10" Setfield = "0.8, 1" -SymbolicUtils = "0.16, 0.18, 0.19, 1" -OrdinaryDiffEq = "6" -Test = "1" -julia = "1.6" +SymbolicUtils = "1.2" +OrdinaryDiffEq = "6.56" +Test = "1.10" +julia = "1.10" [extras] Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" From 48eb845a79eadb0bd93cdad3b51562ac057e10ca Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Jan 2024 12:00:18 +0000 Subject: [PATCH 23/35] Bump crate-ci/typos from 1.16.23 to 1.17.0 Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.16.23 to 1.17.0. - [Release notes](https://github.com/crate-ci/typos/releases) - [Changelog](https://github.com/crate-ci/typos/blob/master/CHANGELOG.md) - [Commits](https://github.com/crate-ci/typos/compare/v1.16.23...v1.17.0) --- updated-dependencies: - dependency-name: crate-ci/typos dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/SpellCheck.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/SpellCheck.yml b/.github/workflows/SpellCheck.yml index 74af4ef..0decc88 100644 --- a/.github/workflows/SpellCheck.yml +++ b/.github/workflows/SpellCheck.yml @@ -10,4 +10,4 @@ jobs: - name: Checkout Actions Repository uses: actions/checkout@v4 - name: Check spelling - uses: crate-ci/typos@v1.16.23 \ No newline at end of file + uses: crate-ci/typos@v1.17.0 \ No newline at end of file From 9e37954a994f5c55274a871d8951f4049bc88e94 Mon Sep 17 00:00:00 2001 From: Arno Strouwen Date: Thu, 11 Jan 2024 18:39:30 +0100 Subject: [PATCH 24/35] more CI --- .github/workflows/Documentation.yml | 3 ++- .github/workflows/Downgrade.yml | 18 +++++++++++++++--- .github/workflows/ci.yml | 24 +++++++++++++----------- Project.toml | 6 ++++-- test/beeler.jl | 4 ++++ test/noble_1962.jl | 3 +++ test/runtests.jl | 13 ++++--------- 7 files changed, 45 insertions(+), 26 deletions(-) diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml index adc1628..a951a30 100644 --- a/.github/workflows/Documentation.yml +++ b/.github/workflows/Documentation.yml @@ -6,7 +6,8 @@ on: - master tags: '*' pull_request: - + schedule: + - cron: '48 8 * * 5' jobs: build: runs-on: ubuntu-latest diff --git a/.github/workflows/Downgrade.yml b/.github/workflows/Downgrade.yml index 01ff8ca..65114e9 100644 --- a/.github/workflows/Downgrade.yml +++ b/.github/workflows/Downgrade.yml @@ -10,20 +10,32 @@ on: - master paths-ignore: - 'docs/**' + schedule: + - cron: '48 8 * * 5' jobs: test: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: - version: ['1'] + group: + - Core + version: + - '1' + os: + - ubuntu-latest + - macos-latest + - windows-latest steps: - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@v1 with: version: ${{ matrix.version }} - uses: cjdoris/julia-downgrade-compat-action@v1 -# if: ${{ matrix.version == '1.6' }} with: skip: Pkg,TOML + - uses: julia-actions/cache@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c53fecd..1f9dc44 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,33 +10,35 @@ on: - master paths-ignore: - 'docs/**' + schedule: + - cron: '48 8 * * 5' jobs: test: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: group: - Core version: - '1' + os: + - ubuntu-latest + - macos-latest + - windows-latest steps: - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@v1 with: version: ${{ matrix.version }} - - uses: actions/cache@v3 - env: - cache-name: cache-artifacts + - uses: julia-actions/cache@v1 with: - path: ~/.julia/artifacts - key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} - restore-keys: | - ${{ runner.os }}-test-${{ env.cache-name }}- - ${{ runner.os }}-test- - ${{ runner.os }}- + token: ${{ secrets.GITHUB_TOKEN }} - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 + with: + depwarn: error - uses: julia-actions/julia-processcoverage@v1 - uses: codecov/codecov-action@v3 with: - file: lcov.info + file: lcov.info \ No newline at end of file diff --git a/Project.toml b/Project.toml index c873f2a..0caa4a8 100644 --- a/Project.toml +++ b/Project.toml @@ -19,10 +19,11 @@ EzXML = "1.1" MathML = "0.1.14" Memoize = "0.4.2" ModelingToolkit = "8.71" +OrdinaryDiffEq = "6.56" Random = "1.10" +SafeTestsets = "0.1" Setfield = "0.8, 1" SymbolicUtils = "1.2" -OrdinaryDiffEq = "6.56" Test = "1.10" julia = "1.10" @@ -30,7 +31,8 @@ julia = "1.10" Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78" OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed" +SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["Aqua", "Test", "ModelingToolkit", "OrdinaryDiffEq"] +test = ["Aqua", "Test", "ModelingToolkit", "OrdinaryDiffEq", "SafeTestsets"] diff --git a/test/beeler.jl b/test/beeler.jl index aa41bca..e3af958 100644 --- a/test/beeler.jl +++ b/test/beeler.jl @@ -1,3 +1,7 @@ +using CellMLToolkit +using OrdinaryDiffEq +using ModelingToolkit + path = @__DIR__ ml = CellModel(path * "/../models/beeler_reuter_1977.cellml.xml") diff --git a/test/noble_1962.jl b/test/noble_1962.jl index 0620914..e194898 100644 --- a/test/noble_1962.jl +++ b/test/noble_1962.jl @@ -1,3 +1,6 @@ +using CellMLToolkit +using OrdinaryDiffEq +using ModelingToolkit path = @__DIR__ ml = CellModel(path * "/../models/noble_1962/Noble_1962.cellml") diff --git a/test/runtests.jl b/test/runtests.jl index 07de834..1fa9ed1 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,10 +1,5 @@ -using Test -using CellMLToolkit -using OrdinaryDiffEq -using ModelingToolkit +using SafeTestsets, Test -@testset "CellMLToolkit.jl" begin - @testset "Quality Assurance" begin include("qa.jl") end - @testset "beeler.jl" begin include("beeler.jl") end - @testset "noble_1962.jl" begin include("noble_1962.jl") end -end +@time @safetestset "Quality Assurance" include("qa.jl") +@time @safetestset "beeler.jl" include("beeler.jl") +@time @safetestset "noble_1962.jl" include("noble_1962.jl") From 9166c0f8a45b61a556086b29237a1b262293de84 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 11:28:26 +0000 Subject: [PATCH 25/35] Bump crate-ci/typos from 1.17.0 to 1.18.0 Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.17.0 to 1.18.0. - [Release notes](https://github.com/crate-ci/typos/releases) - [Changelog](https://github.com/crate-ci/typos/blob/master/CHANGELOG.md) - [Commits](https://github.com/crate-ci/typos/compare/v1.17.0...v1.18.0) --- updated-dependencies: - dependency-name: crate-ci/typos dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/SpellCheck.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/SpellCheck.yml b/.github/workflows/SpellCheck.yml index 0decc88..9246edd 100644 --- a/.github/workflows/SpellCheck.yml +++ b/.github/workflows/SpellCheck.yml @@ -10,4 +10,4 @@ jobs: - name: Checkout Actions Repository uses: actions/checkout@v4 - name: Check spelling - uses: crate-ci/typos@v1.17.0 \ No newline at end of file + uses: crate-ci/typos@v1.18.0 \ No newline at end of file From a1cee5b1327cc591935385a385f37a390177e83d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 11:28:34 +0000 Subject: [PATCH 26/35] Bump codecov/codecov-action from 3 to 4 Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3 to 4. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v3...v4) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/Documentation.yml | 2 +- .github/workflows/ci.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml index a951a30..e7b99fc 100644 --- a/.github/workflows/Documentation.yml +++ b/.github/workflows/Documentation.yml @@ -24,6 +24,6 @@ jobs: DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key run: julia --project=docs/ --code-coverage=user docs/make.jl - uses: julia-actions/julia-processcoverage@v1 - - uses: codecov/codecov-action@v3 + - uses: codecov/codecov-action@v4 with: file: lcov.info diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1f9dc44..49e4e53 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,6 +39,6 @@ jobs: with: depwarn: error - uses: julia-actions/julia-processcoverage@v1 - - uses: codecov/codecov-action@v3 + - uses: codecov/codecov-action@v4 with: file: lcov.info \ No newline at end of file From c2513dd82524f114f903fac287235b12b6ff71fc Mon Sep 17 00:00:00 2001 From: Arno Strouwen Date: Tue, 6 Feb 2024 04:50:36 +0100 Subject: [PATCH 27/35] [skip ci] Update dependabot.yml --- .github/dependabot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 1e8a051..ec3b005 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -7,4 +7,4 @@ updates: interval: "weekly" ignore: - dependency-name: "crate-ci/typos" - update-types: ["version-update:semver-patch"] + update-types: ["version-update:semver-patch", "version-update:semver-minor"] From 18c78a5b891e91b2f4798e43222cfabf0093334b Mon Sep 17 00:00:00 2001 From: Anant Thazhemadam <47104651+thazhemadam@users.noreply.github.com> Date: Fri, 9 Feb 2024 23:11:36 +0530 Subject: [PATCH 28/35] ci: explicitly specify token for codecov Explicitly specify the codecov token to be used (i.e., `CODECOV_TOKEN`), given that the latest v4 release of the codecov action requires it to be able to generate coverage reports. Additionally, fail CI if coverage reporting fails, since coverage is an important enough metric for us to ensure that it's tracked consistently. --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 49e4e53..5691133 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,4 +41,6 @@ jobs: - uses: julia-actions/julia-processcoverage@v1 - uses: codecov/codecov-action@v4 with: - file: lcov.info \ No newline at end of file + file: lcov.info + token: ${{ secrets.CODECOV_TOKEN }} + fail_ci_if_error: true From deb2f04c1432c402f049032f02bbe1eb9190155a Mon Sep 17 00:00:00 2001 From: Anant Thazhemadam <47104651+thazhemadam@users.noreply.github.com> Date: Fri, 9 Feb 2024 23:12:07 +0530 Subject: [PATCH 29/35] ci: explicitly specify token for codecov Explicitly specify the codecov token to be used (i.e., `CODECOV_TOKEN`), given that the latest v4 release of the codecov action requires it to be able to generate coverage reports. Additionally, fail CI if coverage reporting fails, since coverage is an important enough metric for us to ensure that it's tracked consistently. --- .github/workflows/Documentation.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml index e7b99fc..f627519 100644 --- a/.github/workflows/Documentation.yml +++ b/.github/workflows/Documentation.yml @@ -27,3 +27,5 @@ jobs: - uses: codecov/codecov-action@v4 with: file: lcov.info + token: ${{ secrets.CODECOV_TOKEN }} + fail_ci_if_error: true From 94be5d4130a1433d57848f5a189b6a34e2918701 Mon Sep 17 00:00:00 2001 From: Lilith Orion Hafner Date: Wed, 14 Feb 2024 10:41:54 -0600 Subject: [PATCH 30/35] Run JuliaFormatter.format() Using JuliaFormatter v1.0.47 --- README.md | 4 ++-- docs/make.jl | 46 ++++++++++++++++++++++---------------------- docs/src/index.md | 2 +- src/CellMLToolkit.jl | 4 ++-- src/accessors.jl | 12 +++++++----- src/components.jl | 8 ++++---- 6 files changed, 39 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index 29c04ae..3347f51 100644 --- a/README.md +++ b/README.md @@ -175,7 +175,7 @@ CellML specification allows for models spanning multiple XML files. In these mod ```julia ml = CellModel("models/noble_1962/Noble_1962.cellml") prob = ODEProblem(ml, tspan) -sol = solve(prob, dtmax=0.5) +sol = solve(prob, dtmax = 0.5) ``` Note that the syntax is exactly the same as before. However, the list of the imported files are printed during `CellModel` generation: @@ -195,7 +195,7 @@ Note that the syntax is exactly the same as before. However, the list of the imp Same as before, we can plot the output as ```julia -plot(sol, idxs=2) +plot(sol, idxs = 2) ``` ![](docs/src/assets/noble_1962.png) diff --git a/docs/make.jl b/docs/make.jl index a82845f..5ea4093 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -4,30 +4,30 @@ cp("./docs/Manifest.toml", "./docs/src/assets/Manifest.toml", force = true) cp("./docs/Project.toml", "./docs/src/assets/Project.toml", force = true) mathengine = MathJax3(Dict(:loader => Dict("load" => ["[tex]/require", "[tex]/mathtools"]), - :tex => Dict("inlineMath" => [["\$", "\$"], ["\\(", "\\)"]], - "packages" => [ - "base", - "ams", - "autoload", - "mathtools", - "require", - ]))) + :tex => Dict("inlineMath" => [["\$", "\$"], ["\\(", "\\)"]], + "packages" => [ + "base", + "ams", + "autoload", + "mathtools", + "require" + ]))) makedocs(sitename = "CellMLToolkit.jl", - authors = "Chris Rackauckas", - modules = Module[], - clean = true, doctest = false, linkcheck = true, - linkcheck_ignore = [ - "https://journals.physiology.org/doi/full/10.1152/ajpheart.00794.2003", - ], - format = Documenter.HTML(;assets = ["assets/favicon.ico"], - mathengine, - canonical = "https://docs.sciml.ai/CellMLToolkit/stable/", - prettyurls = (get(ENV, "CI", nothing) == "true")), - pages = [ - "Home" => "index.md", - "Tutorial" => "tutorial.md", - ]) + authors = "Chris Rackauckas", + modules = Module[], + clean = true, doctest = false, linkcheck = true, + linkcheck_ignore = [ + "https://journals.physiology.org/doi/full/10.1152/ajpheart.00794.2003" + ], + format = Documenter.HTML(; assets = ["assets/favicon.ico"], + mathengine, + canonical = "https://docs.sciml.ai/CellMLToolkit/stable/", + prettyurls = (get(ENV, "CI", nothing) == "true")), + pages = [ + "Home" => "index.md", + "Tutorial" => "tutorial.md" + ]) deploydocs(repo = "github.com/SciML/CellMLToolkit.jl.git"; - push_preview = true) + push_preview = true) diff --git a/docs/src/index.md b/docs/src/index.md index 5f7b8ad..84ec567 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -106,4 +106,4 @@ file and the [project]($link_project) file. """) -``` \ No newline at end of file +``` diff --git a/src/CellMLToolkit.jl b/src/CellMLToolkit.jl index b4898c3..3b54ece 100644 --- a/src/CellMLToolkit.jl +++ b/src/CellMLToolkit.jl @@ -45,8 +45,8 @@ import ModelingToolkit.ODEProblem ODEProblem constructs an ODEProblem from a CellModel """ function ODEProblem(ml::CellModel, tspan; - jac = false, level = 1, p = last.(list_params(ml)), - u0 = last.(list_states(ml))) + jac = false, level = 1, p = last.(list_params(ml)), + u0 = last.(list_states(ml))) ODEProblem(ml.sys, u0, tspan, p; jac = jac) end diff --git a/src/accessors.jl b/src/accessors.jl index fd5263e..c8c6b94 100644 --- a/src/accessors.jl +++ b/src/accessors.jl @@ -138,15 +138,17 @@ end function list_encapsulation(doc, comp) name = string(nameof(comp)) ns = cellml_ns(doc) - groups = parentnode.(findall("//x:group/x:relationship_ref[@relationship='encapsulation']", - root(doc), ["x" => ns])) + groups = parentnode.(findall( + "//x:group/x:relationship_ref[@relationship='encapsulation']", + root(doc), ["x" => ns])) if isempty(groups) # CellML ver 2.0 - return findall("//x:encapsulation//x:component_ref[@component='$name']//x:component_ref", - root(doc), ["x" => ns]) + return findall( + "//x:encapsulation//x:component_ref[@component='$name']//x:component_ref", + root(doc), ["x" => ns]) else # CellML ver 1.0 and 1.1 for g in groups nodes = findall(".//x:component_ref[@component='$name']//x:component_ref", g, - ["x" => ns]) + ["x" => ns]) if !isempty(nodes) return nodes end diff --git a/src/components.jl b/src/components.jl index 0289631..05a4c6b 100644 --- a/src/components.jl +++ b/src/components.jl @@ -227,9 +227,9 @@ function process_components(doc::Document; simplify = true) post_sub = post_substitution(doc, systems) sys = ODESystem(translate_connections(doc, systems, class), - get_ivₚ(doc), - systems = collect(values(systems)), - name = gensym(:cellml)) + get_ivₚ(doc), + systems = collect(values(systems)), + name = gensym(:cellml)) if simplify sys = structural_simplify(sys) @@ -252,7 +252,7 @@ end """ function subsystems(doc::Document, class) Dict{Symbol, ODESystem}(to_symbol(comp) => process_component(doc, comp, class) - for comp in components(doc)) + for comp in components(doc)) end """ From 99a6c007e9b8767b7bd6f1bb446f622004adda61 Mon Sep 17 00:00:00 2001 From: Arno Strouwen Date: Sun, 18 Feb 2024 13:32:54 +0100 Subject: [PATCH 31/35] [skip ci] update downgrade CI repo --- .github/workflows/Downgrade.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Downgrade.yml b/.github/workflows/Downgrade.yml index 65114e9..54b104e 100644 --- a/.github/workflows/Downgrade.yml +++ b/.github/workflows/Downgrade.yml @@ -31,11 +31,11 @@ jobs: - uses: julia-actions/setup-julia@v1 with: version: ${{ matrix.version }} - - uses: cjdoris/julia-downgrade-compat-action@v1 + - uses: julia-actions/julia-downgrade-compat@v1 with: skip: Pkg,TOML - uses: julia-actions/cache@v1 with: token: ${{ secrets.GITHUB_TOKEN }} - uses: julia-actions/julia-buildpkg@v1 - - uses: julia-actions/julia-runtest@v1 \ No newline at end of file + - uses: julia-actions/julia-runtest@v1 From 7229896585bc20b34ad5aaf5ea350ac0bb8ea190 Mon Sep 17 00:00:00 2001 From: Anant Thazhemadam Date: Mon, 29 Apr 2024 19:10:38 +0530 Subject: [PATCH 32/35] ci: update invalidations workflow to use centralised reusable workflow --- .github/workflows/Invalidations.yml | 33 ++++------------------------- 1 file changed, 4 insertions(+), 29 deletions(-) diff --git a/.github/workflows/Invalidations.yml b/.github/workflows/Invalidations.yml index 28b9ce2..34eb7a9 100644 --- a/.github/workflows/Invalidations.yml +++ b/.github/workflows/Invalidations.yml @@ -1,4 +1,4 @@ -name: Invalidations +name: "Invalidations" on: pull_request: @@ -10,31 +10,6 @@ concurrency: cancel-in-progress: true jobs: - evaluate: - # Only run on PRs to the default branch. - # In the PR trigger above branches can be specified only explicitly whereas this check should work for master, main, or any other default branch - if: github.base_ref == github.event.repository.default_branch - runs-on: ubuntu-latest - steps: - - uses: julia-actions/setup-julia@v1 - with: - version: '1' - - uses: actions/checkout@v4 - - uses: julia-actions/julia-buildpkg@v1 - - uses: julia-actions/julia-invalidations@v1 - id: invs_pr - - - uses: actions/checkout@v4 - with: - ref: ${{ github.event.repository.default_branch }} - - uses: julia-actions/julia-buildpkg@v1 - - uses: julia-actions/julia-invalidations@v1 - id: invs_default - - - name: Report invalidation counts - run: | - echo "Invalidations on default branch: ${{ steps.invs_default.outputs.total }} (${{ steps.invs_default.outputs.deps }} via deps)" >> $GITHUB_STEP_SUMMARY - echo "This branch: ${{ steps.invs_pr.outputs.total }} (${{ steps.invs_pr.outputs.deps }} via deps)" >> $GITHUB_STEP_SUMMARY - - name: Check if the PR does increase number of invalidations - if: steps.invs_pr.outputs.total > steps.invs_default.outputs.total - run: exit 1 + evaluate-invalidations: + name: "Evaluate Invalidations" + uses: "SciML/.github/.github/workflows/invalidations.yml@v1" From 679954411b10ee135a00aaf2c591e67925114375 Mon Sep 17 00:00:00 2001 From: Anant Thazhemadam Date: Mon, 29 Apr 2024 19:36:44 +0530 Subject: [PATCH 33/35] ci: update format check workflow to use centralised reusable workflow --- .github/workflows/FormatCheck.yml | 37 ++++--------------------------- 1 file changed, 4 insertions(+), 33 deletions(-) diff --git a/.github/workflows/FormatCheck.yml b/.github/workflows/FormatCheck.yml index dd55150..c240796 100644 --- a/.github/workflows/FormatCheck.yml +++ b/.github/workflows/FormatCheck.yml @@ -1,42 +1,13 @@ -name: format-check +name: "Format Check" on: push: branches: - 'master' - - 'release-' tags: '*' pull_request: jobs: - build: - runs-on: ${{ matrix.os }} - strategy: - matrix: - julia-version: [1] - julia-arch: [x86] - os: [ubuntu-latest] - steps: - - uses: julia-actions/setup-julia@latest - with: - version: ${{ matrix.julia-version }} - - - uses: actions/checkout@v4 - - name: Install JuliaFormatter and format - # This will use the latest version by default but you can set the version like so: - # - # julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter", version="0.13.0"))' - run: | - julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter"))' - julia -e 'using JuliaFormatter; format(".", verbose=true)' - - name: Format check - run: | - julia -e ' - out = Cmd(`git diff --name-only`) |> read |> String - if out == "" - exit(0) - else - @error "Some files have not been formatted !!!" - write(stdout, out) - exit(1) - end' + format-check: + name: "Format Check" + uses: "SciML/.github/.github/workflows/format-check.yml@v1" From 39312046f216a3e4107c671eb75eae8f4517f1ec Mon Sep 17 00:00:00 2001 From: Anant Thazhemadam Date: Mon, 29 Apr 2024 20:08:24 +0530 Subject: [PATCH 34/35] ci: update documentation workflow to use centralised reusable workflow --- .github/workflows/Documentation.yml | 31 ++++++++++------------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml index f627519..2a2775c 100644 --- a/.github/workflows/Documentation.yml +++ b/.github/workflows/Documentation.yml @@ -1,4 +1,4 @@ -name: Documentation +name: "Documentation" on: push: @@ -8,24 +8,13 @@ on: pull_request: schedule: - cron: '48 8 * * 5' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref_name != github.event.repository.default_branch || github.ref != 'refs/tags/v*' }} + jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: julia-actions/setup-julia@latest - with: - version: '1' - - name: Install dependencies - run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' - - name: Build and deploy - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token - DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key - run: julia --project=docs/ --code-coverage=user docs/make.jl - - uses: julia-actions/julia-processcoverage@v1 - - uses: codecov/codecov-action@v4 - with: - file: lcov.info - token: ${{ secrets.CODECOV_TOKEN }} - fail_ci_if_error: true + build-and-deploy-docs: + name: "Documentation" + uses: "SciML/.github/.github/workflows/documentation.yml@v1" + secrets: "inherit" From 75dabd0adb947fd4d2f50b9418a853346c6df4d8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 May 2024 11:40:18 +0000 Subject: [PATCH 35/35] Bump julia-actions/cache from 1 to 2 Bumps [julia-actions/cache](https://github.com/julia-actions/cache) from 1 to 2. - [Release notes](https://github.com/julia-actions/cache/releases) - [Commits](https://github.com/julia-actions/cache/compare/v1...v2) --- updated-dependencies: - dependency-name: julia-actions/cache dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/Downgrade.yml | 2 +- .github/workflows/ci.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Downgrade.yml b/.github/workflows/Downgrade.yml index 54b104e..6f53b89 100644 --- a/.github/workflows/Downgrade.yml +++ b/.github/workflows/Downgrade.yml @@ -34,7 +34,7 @@ jobs: - uses: julia-actions/julia-downgrade-compat@v1 with: skip: Pkg,TOML - - uses: julia-actions/cache@v1 + - uses: julia-actions/cache@v2 with: token: ${{ secrets.GITHUB_TOKEN }} - uses: julia-actions/julia-buildpkg@v1 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5691133..fcf57c9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ jobs: - uses: julia-actions/setup-julia@v1 with: version: ${{ matrix.version }} - - uses: julia-actions/cache@v1 + - uses: julia-actions/cache@v2 with: token: ${{ secrets.GITHUB_TOKEN }} - uses: julia-actions/julia-buildpkg@v1