Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run JuliaFormatter.format() #124

Merged
merged 1 commit into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)
46 changes: 23 additions & 23 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,4 @@ file and the
[project]($link_project)
file.
""")
```
```
4 changes: 2 additions & 2 deletions src/CellMLToolkit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 7 additions & 5 deletions src/accessors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions src/components.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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

"""
Expand Down
Loading