Skip to content

Commit c74bab4

Browse files
committed
..
1 parent f0d634b commit c74bab4

File tree

2 files changed

+41
-52
lines changed

2 files changed

+41
-52
lines changed

petabtests/cases/v1.0.0/sbml/0005/0005.py

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import pandas as pd
55
from petab.v1.C import *
66

7-
from petabtests import PetabTestCase, analytical_a
7+
from petabtests import PetabTestCase, analytical_a, antimony_to_sbml_str
88

99
DESCRIPTION = cleandoc("""
1010
## Objective
@@ -23,6 +23,26 @@
2323
""")
2424

2525
# problem --------------------------------------------------------------------
26+
ant_model = """
27+
model *petab_test_0011()
28+
compartment compartment_ = 1;
29+
species A in compartment_, B in compartment_;
30+
31+
fwd: A => B; compartment_ * k1 * A;
32+
rev: B => A; compartment_ * k2 * B;
33+
34+
A = a0;
35+
B = b0;
36+
B = 1;
37+
a0 = 1;
38+
b0 = 1;
39+
k1 = 0;
40+
k2 = 0;
41+
offset_A = 0;
42+
end
43+
"""
44+
model_file = sbml_file = Path(__file__).parent / "_model.xml"
45+
model_file.write_text(antimony_to_sbml_str(ant_model))
2646

2747
condition_df = pd.DataFrame(
2848
data={
@@ -73,7 +93,7 @@
7393
brief="Simulation. Condition-specific parameters only defined in "
7494
"parameter table.",
7595
description=DESCRIPTION,
76-
model=Path("conversion_modified.xml"),
96+
model=model_file,
7797
condition_dfs=[condition_df],
7898
observable_dfs=[observable_df],
7999
measurement_dfs=[measurement_df],
Lines changed: 19 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,96 +1,65 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
3-
<model id="conversion_reaction_0" name="Conversion Reaction 0">
4-
5-
<listOfUnitDefinitions>
6-
<unitDefinition id="volume" name="volume">
7-
<listOfUnits>
8-
<unit kind="litre" exponent="1" scale="-3" multiplier="1"/>
9-
</listOfUnits>
10-
</unitDefinition>
11-
<unitDefinition id="substance" name="substance">
12-
<listOfUnits>
13-
<unit kind="mole" exponent="1" scale="-3" multiplier="1"/>
14-
</listOfUnits>
15-
</unitDefinition>
16-
</listOfUnitDefinitions>
17-
2+
<!-- Created by libAntimony version v2.14.0 with libSBML version 5.20.2. -->
3+
<sbml xmlns="http://www.sbml.org/sbml/level3/version2/core" level="3" version="2">
4+
<model metaid="petab_test_0011" id="petab_test_0011">
185
<listOfCompartments>
19-
<compartment id="compartment" name="compartment" spatialDimensions="3" size="1" constant="true">
20-
</compartment>
6+
<compartment id="compartment_" spatialDimensions="3" size="1" constant="true"/>
217
</listOfCompartments>
22-
238
<listOfSpecies>
24-
<species id="A" name="A" compartment="compartment" initialConcentration="1" boundaryCondition="false" constant="false">
25-
</species>
26-
<species id="B" name="B" compartment="compartment" initialConcentration="1" boundaryCondition="false" constant="false">
27-
</species>
9+
<species id="A" compartment="compartment_" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false"/>
10+
<species id="B" compartment="compartment_" initialConcentration="1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false"/>
2811
</listOfSpecies>
29-
3012
<listOfParameters>
31-
<parameter id="a0" name="a0" value="1" constant="true">
32-
</parameter>
33-
<parameter id="b0" name="b0" value="1" constant="true">
34-
</parameter>
35-
<parameter id="k1" name="k1" value="0" constant="true">
36-
</parameter>
37-
<parameter id="k2" name="k2" value="0" constant="true">
38-
</parameter>
39-
<parameter id="offset_A" name="offset_A" value="0" constant="true">
40-
</parameter>
13+
<parameter id="k1" value="0" constant="true"/>
14+
<parameter id="k2" value="0" constant="true"/>
15+
<parameter id="a0" value="1" constant="true"/>
16+
<parameter id="b0" value="1" constant="true"/>
17+
<parameter id="offset_A" value="0" constant="true"/>
4118
</listOfParameters>
42-
4319
<listOfInitialAssignments>
4420
<initialAssignment symbol="A">
4521
<math xmlns="http://www.w3.org/1998/Math/MathML">
4622
<ci> a0 </ci>
4723
</math>
4824
</initialAssignment>
49-
<initialAssignment symbol="B">
50-
<math xmlns="http://www.w3.org/1998/Math/MathML">
51-
<ci> b0 </ci>
52-
</math>
53-
</initialAssignment>
5425
</listOfInitialAssignments>
55-
5626
<listOfReactions>
57-
<reaction id="fwd" name="fwd" reversible="false">
27+
<reaction id="fwd" reversible="false">
5828
<listOfReactants>
59-
<speciesReference species="A" stoichiometry="1"/>
29+
<speciesReference species="A" stoichiometry="1" constant="true"/>
6030
</listOfReactants>
6131
<listOfProducts>
62-
<speciesReference species="B" stoichiometry="1"/>
32+
<speciesReference species="B" stoichiometry="1" constant="true"/>
6333
</listOfProducts>
6434
<kineticLaw>
6535
<math xmlns="http://www.w3.org/1998/Math/MathML">
6636
<apply>
6737
<times/>
68-
<ci> compartment </ci>
38+
<ci> compartment_ </ci>
6939
<ci> k1 </ci>
7040
<ci> A </ci>
7141
</apply>
7242
</math>
7343
</kineticLaw>
7444
</reaction>
75-
<reaction id="rev" name="rev" reversible="false">
45+
<reaction id="rev" reversible="false">
7646
<listOfReactants>
77-
<speciesReference species="B" stoichiometry="1"/>
47+
<speciesReference species="B" stoichiometry="1" constant="true"/>
7848
</listOfReactants>
7949
<listOfProducts>
80-
<speciesReference species="A" stoichiometry="1"/>
50+
<speciesReference species="A" stoichiometry="1" constant="true"/>
8151
</listOfProducts>
8252
<kineticLaw>
8353
<math xmlns="http://www.w3.org/1998/Math/MathML">
8454
<apply>
8555
<times/>
86-
<ci> compartment </ci>
56+
<ci> compartment_ </ci>
8757
<ci> k2 </ci>
8858
<ci> B </ci>
8959
</apply>
9060
</math>
9161
</kineticLaw>
9262
</reaction>
9363
</listOfReactions>
94-
9564
</model>
9665
</sbml>

0 commit comments

Comments
 (0)