|
6 | 6 | import pytest |
7 | 7 | from numpy.testing import assert_allclose, assert_array_equal |
8 | 8 | from amici.testing import skip_on_valgrind |
9 | | -from conftest import MODEL_CONSTANT_SPECIES_XML |
10 | 9 |
|
11 | 10 |
|
12 | 11 | @pytest.fixture |
@@ -44,8 +43,40 @@ def edata_fixture(): |
44 | 43 |
|
45 | 44 | @pytest.fixture(scope="session") |
46 | 45 | def models(): |
47 | | - # SBML model we want to import |
48 | | - sbml_importer = amici.SbmlImporter(MODEL_CONSTANT_SPECIES_XML) |
| 46 | + from amici.antimony_import import antimony2sbml |
| 47 | + |
| 48 | + ant_model = """model *model_constant_species() |
| 49 | + const compartment compartment_ = 1; |
| 50 | + var species substrate in compartment_ = 0; |
| 51 | + const species $enzyme in compartment_; |
| 52 | + var species complex in compartment_ = 0; |
| 53 | + species product in compartment_ = 0; |
| 54 | +
|
| 55 | + var substrate_product := complex + product + substrate; |
| 56 | +
|
| 57 | + creation: => substrate; compartment_*(synthesis_substrate + k_create); |
| 58 | + binding: substrate + $enzyme -> complex; compartment_*(k_bind*substrate*enzyme - k_unbind*complex); |
| 59 | + conversion: complex => $enzyme + product; compartment_*k_convert*complex; |
| 60 | + decay: product => ; compartment_*k_decay*product; |
| 61 | +
|
| 62 | + enzyme = init_enzyme; |
| 63 | + substrate = init_substrate; |
| 64 | +
|
| 65 | + const init_enzyme = 2; |
| 66 | + const init_substrate = 5; |
| 67 | + const synthesis_substrate = 0; |
| 68 | + const k_bind = 10; |
| 69 | + const k_unbind = 1; |
| 70 | + const k_convert = 10; |
| 71 | + const k_create = 2; |
| 72 | + const k_decay = 1; |
| 73 | +
|
| 74 | + unit volume = 1e-3 litre; |
| 75 | + unit substance = 1e-3 mole; |
| 76 | +end""" |
| 77 | + sbml_importer = amici.SbmlImporter( |
| 78 | + antimony2sbml(ant_model), from_file=False |
| 79 | + ) |
49 | 80 |
|
50 | 81 | # Name of the model that will also be the name of the python module |
51 | 82 | model_name = model_output_dir = "model_constant_species" |
|
0 commit comments