Skip to content

Commit

Permalink
Merge pull request #115 from ArnoStrouwen/qa
Browse files Browse the repository at this point in the history
typos + Aqua CI
  • Loading branch information
ChrisRackauckas authored Dec 14, 2023
2 parents 6dd9984 + 5046804 commit 0bef179
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
13 changes: 13 additions & 0 deletions .github/workflows/SpellCheck.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
5 changes: 5 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[default.extend-words]
ba = "ba"
caf = "caf"
ths = "ths"
allo = "allo"
7 changes: 6 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion models/beeler_reuter_1977.cellml.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1347,7 +1347,7 @@ The breakdown of the model into components and the definition of encapsulation a
</rdf:Description>
<rdf:Description rdf:about="rdf:#77f98dda-c979-49f1-9bcf-da4944906f91">
<dcterms:modified rdf:resource="rdf:#e7527bce-f615-4263-afc0-c075d70b6e23"/>
<rdf:value>Added an intial value for X1 to enable the model to run.</rdf:value>
<rdf:value>Added an initial value for X1 to enable the model to run.</rdf:value>
<cmeta:modifier rdf:resource="rdf:#baef8605-6d17-47bc-b214-261f23273934"/>
</rdf:Description>
<rdf:Description rdf:about="rdf:#9c5e9628-92e3-4989-a4b1-21fce295ab89">
Expand Down
4 changes: 2 additions & 2 deletions src/CellMLToolkit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/components.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/import.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
"""
Expand Down
12 changes: 12 additions & 0 deletions test/qa.jl
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 0bef179

Please sign in to comment.