Skip to content

Commit 8f362ef

Browse files
authored
Merge pull request #49 from SciML/YingboMa-patch-1
Actually return parameters
2 parents 9128de0 + 19d41d1 commit 8f362ef

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

Project.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
name = "CellMLToolkit"
22
uuid = "03cb29e0-1ef4-4721-aa24-cf58a006576f"
33
authors = ["Shahriar Iravanian <siravan@svtsim.com>"]
4-
version = "2.4.1"
4+
version = "2.4.2"
55

66
[deps]
77
EzXML = "8f5d6c58-4d21-5cfd-889c-e3ad7ee6a615"
88
MathML = "abcecc63-2b08-419c-80c4-c63dca6fa478"
99
Memoize = "c03570c3-d221-55d1-a50c-7939bbd78826"
1010
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
1111
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
12+
Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46"
1213
SymbolicUtils = "d1185830-fcd6-423d-90d6-eec64667417b"
1314
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1415

@@ -17,14 +18,15 @@ EzXML = "1.1"
1718
MathML = "0.1"
1819
Memoize = "0.4"
1920
ModelingToolkit = "5.14.1"
20-
SymbolicUtils = "0.10.2"
21+
Setfield = "0.7"
22+
SymbolicUtils = "0.10.2, 0.11"
2123
julia = "1.5"
2224

2325
[extras]
2426
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
2527
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
2628
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
2729
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
28-
30+
2931
[targets]
3032
test = ["Test", "ModelingToolkit", "OrdinaryDiffEq", "JSON3"]

src/analysis.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
function simplify_systems(systems)
66
for x in systems
77
sys = last(x)
8-
print("simplifying $(sys.name)")
8+
print("simplifying $(nameof(sys))")
99
try
1010
sys = structural_simplify(sys)
11-
k = max(1, 50-length(string(sys.name)))
11+
k = max(1, 50-length(string(nameof(sys))))
1212
printstyled(repeat(" ", k) * "OK!"; color=:green)
1313
println()
1414
catch e

src/components.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
using Setfield
2+
13
const cellml_ns(xml::EzXML.Document) = namespace(root(xml))
24
const cellml_ns(node::EzXML.Node) = namespace(node)
35
const mathml_ns = "http://www.w3.org/1998/Math/MathML"
@@ -8,7 +10,6 @@ create_var(x, iv) = Num(Variable{Symbolics.FnType{Tuple{Any},Real}}(Symbol(x)))(
810
function create_param(x)
911
p = Sym{Real}(Symbol(x))
1012
ModelingToolkit.toparam(p)
11-
p
1213
end
1314

1415
to_symbol(x::Symbol) = x
@@ -234,7 +235,7 @@ function process_components(doc::Document; simplify=true)
234235

235236
if simplify
236237
sys = structural_simplify(sys)
237-
sys = ODESystem(substitute_eqs(sys.eqs, post_sub), sys.iv, sys.states, sys.ps)
238+
@set! sys.eqs = substitute_eqs(equations(sys), post_sub)
238239
end
239240

240241
return sys

0 commit comments

Comments
 (0)