Skip to content

Commit

Permalink
Fix tests, naming scheme.
Browse files Browse the repository at this point in the history
Since the sbml ids can have two forms, the index might be off.  Also, fix the name of the test file.
  • Loading branch information
luciansmith committed Oct 29, 2024
1 parent bc06b54 commit dda35bb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 5 additions & 1 deletion biosimulators_masspy/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,11 @@ def preprocess_sed_task(task, variables, config=None):
invalid_changes = []
for target, sbml_id in model_change_target_sbml_id_map.items():
if sbml_id in met_ids:
model_change_target_mass_map[target] = (mass_model.metabolites[met_ids.index(sbml_id)], 'ic')
try:
model_change_target_mass_map[target] = (mass_model.metabolites[met_ids.index(sbml_id)], 'ic')
except:
#If the id has a "M_" in front of it:
model_change_target_mass_map[target] = (mass_model.metabolites[met_ids.index(sbml_id) - len(mass_model.metabolites)], 'ic')

elif sbml_id in sbml_id_mass_parameter_map:
model_change_target_mass_map[target] = sbml_id_mass_parameter_map[sbml_id]
Expand Down
5 changes: 3 additions & 2 deletions tests/test_core_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,10 +648,11 @@ def test_exec_sedml_docs_in_combine_archive_with_docker_image(self):

def test_exec_sedml_docs_in_combine_archive(self):
# with reports
archive_filename = 'fixtures/Ciliberto-J-Cell-Biol-2003-morphogenesis-checkpoint-Fehlberg.omex'
archive_filename = 'Ciliberto-J-Cell-Biol-2003-morphogenesis-checkpoint-Fehlberg.omex'
archive_filename = os.path.join(os.path.dirname(__file__), 'fixtures', archive_filename)

dirname = os.path.join(self.dirname, 'reports')
_, log = core.exec_sedml_docs_in_combine_archive(archive_filename, dirname)
_, log = core.exec_sedml_docs_in_combine_archive(str(archive_filename), dirname)
if log.exception:
raise log.exception

Expand Down

0 comments on commit dda35bb

Please sign in to comment.