Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
LCSB-BioCore
SBML.jl
Commits
538c20de
Unverified
Commit
538c20de
authored
Jun 25, 2021
by
Miroslav Kratochvil
Committed by
GitHub
Jun 25, 2021
Browse files
Merge pull request #88 from paulflang/pl-fix_getInitialConcentration
fix getInitialConcentrations
parents
1e9cdb7a
379f6beb
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/readsbml.jl
View file @
538c20de
...
...
@@ -247,7 +247,7 @@ function extractModel(mdl::VPtr)::SBML.Model
ic = nothing
if ccall(sbml(:Species_isSetInitialConcentration), Cint, (VPtr,), sp) != 0
ic = (
ccall(sbml(:Species_getInitial
Amount
), Cdouble, (VPtr,), sp),
ccall(sbml(:Species_getInitial
Concentration
), Cdouble, (VPtr,), sp),
get_optional_string(sp, :Species_getSubstanceUnits),
)
end
...
...
test/loadmodels.jl
View file @
538c20de
...
...
@@ -32,6 +32,14 @@ sbmlfiles = [
4
,
3
,
),
# a cool model with `initialConcentration` from SBML testsuite
(
joinpath
(
@__DIR__
,
"data"
,
"sbml00374.xml"
),
"https://raw.githubusercontent.com/sbmlteam/sbml-test-suite/master/cases/semantic/00374/00374-sbml-l3v2.xml"
,
"424683eea6bbb577aad855d95f2de5183a36e296b06ba18b338572cd7dba6183"
,
4
,
2
,
),
]
@testset
"Loading of models from various sources"
begin
...
...
@@ -77,4 +85,12 @@ end
@test
sum
(
ia
for
(
sp
,
ia
)
in
SBML
.
initial_amounts
(
m
))
==
0.001
@test
sum
(
ic
for
(
sp
,
ic
)
in
SBML
.
initial_concentrations
(
m
,
convert_amounts
=
true
))
==
0.001
m
=
readSBML
(
joinpath
(
@__DIR__
,
"data"
,
"sbml00374.xml"
))
@test
all
(
isnothing
(
ic
)
for
(
k
,
ic
)
in
SBML
.
initial_amounts
(
m
))
@test
length
(
SBML
.
initial_concentrations
(
m
))
==
4
@test
sum
(
ic
for
(
sp
,
ic
)
in
SBML
.
initial_concentrations
(
m
))
==
0.0020800000000000003
@test
sum
(
ia
for
(
sp
,
ia
)
in
SBML
.
initial_amounts
(
m
,
convert_concentrations
=
true
))
==
0.25
*
0.0020800000000000003
end
cylon-x
🤖
@cylon-x
mentioned in commit
1f3419c9
·
Jun 25, 2021
mentioned in commit
1f3419c9
mentioned in commit 1f3419c90577b42bdc2b06666165a63d23e4b1f6
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment