Skip to content

Commit

Permalink
Merge pull request #107 from SciML/pl/convert_promotelocals_expandfuns
Browse files Browse the repository at this point in the history
use SBML converter that retains initialAssignment
  • Loading branch information
paulflang authored Jan 31, 2023
2 parents 0f74dd5 + f766689 commit 03aeee6
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "SBMLToolkit"
uuid = "86080e66-c8ac-44c2-a1a0-9adaadfe4a4e"
authors = ["paulflang", "anandijain"]
version = "0.1.19"
version = "0.1.20"

[deps]
Catalyst = "479239e8-5488-4da2-87a7-35f2df7eef83"
Expand All @@ -12,7 +12,7 @@ SymbolicUtils = "d1185830-fcd6-423d-90d6-eec64667417b"
[compat]
Catalyst = "12"
MathML = "0.1"
SBML = "1.3"
SBML = "1.4"
SymbolicUtils = "0.17, 0.18, 0.19"
julia = "1.6"

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ SBML models can be simulated with the following steps (note that `sol` is in abs
SBMLToolkit.checksupport_file("my_model.xml")
mdl = readSBML("my_model.xml", doc -> begin
set_level_and_version(3, 2)(doc)
convert_simplify_math(doc)
convert_promotelocals_expandfuns(doc)
end)

rs = ReactionSystem(mdl) # If you want to create a reaction system
Expand Down
2 changes: 1 addition & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ using SBMLToolkit, ModelingToolkit, OrdinaryDiffEq
SBMLToolkit.checksupport_file("my_model.xml")
mdl = readSBML("my_model.xml", doc -> begin
set_level_and_version(3, 2)(doc)
convert_simplify_math(doc)
convert_promotelocals_expandfuns(doc)
end)
rs = ReactionSystem(mdl) # If you want to create a reaction system
odesys = convert(ODESystem, rs) # Alternatively: ODESystem(mdl)
Expand Down
5 changes: 4 additions & 1 deletion src/SBMLToolkit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ include("rules.jl")
include("events.jl")
include("utils.jl")

@deprecate convert_simplify_math convert_promotelocals_expandfuns

export ReactionSystem, ODESystem
export readSBML, readSBMLFromString, set_level_and_version, convert_simplify_math
export readSBML, readSBMLFromString, set_level_and_version, convert_simplify_math,
convert_promotelocals_expandfuns

end
2 changes: 1 addition & 1 deletion test/events.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const IV = Catalyst.DEFAULT_IV
function readmodel(sbml)
SBMLToolkit.readSBMLFromString(sbml, doc -> begin
set_level_and_version(3, 2)(doc)
convert_simplify_math(doc)
convert_promotelocals_expandfuns(doc)
end)
end

Expand Down
2 changes: 1 addition & 1 deletion test/rules.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const IV = Catalyst.DEFAULT_IV
function readmodel(sbml)
SBMLToolkit.readSBMLFromString(sbml, doc -> begin
set_level_and_version(3, 2)(doc)
convert_simplify_math(doc)
convert_promotelocals_expandfuns(doc)
end)
end

Expand Down
2 changes: 1 addition & 1 deletion test/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ using Test
function readmodel(sbml)
SBMLToolkit.readSBMLFromString(sbml, doc -> begin
set_level_and_version(3, 2)(doc)
convert_simplify_math(doc)
convert_promotelocals_expandfuns(doc)
end)
end

Expand Down
2 changes: 1 addition & 1 deletion test/wuschel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ sbml_url = "https://www.ebi.ac.uk/biomodels/model/download/MODEL1112100000.2?fil
sbml = String(take!(Downloads.download(sbml_url, IOBuffer())))
m = readSBMLFromString(sbml, doc -> begin
# set_level_and_version(3, 2)(doc) # fails on wuschel
convert_simplify_math(doc) end)
convert_promotelocals_expandfuns(doc) end)
sys = ODESystem(m)
@test length(equations(sys)) == 1012
@test length(states(sys)) == 1012
Expand Down

0 comments on commit 03aeee6

Please sign in to comment.