From 056715698ede200b2a4c3975cc64d5af8fb905a8 Mon Sep 17 00:00:00 2001 From: Arno Strouwen Date: Wed, 13 Dec 2023 19:47:39 +0100 Subject: [PATCH 1/2] 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 2/2] 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