Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
afa02ff
remove engines parameter from process_cases and make changes tht allo…
stellaprins Oct 28, 2024
9db849f
Merge branch 'development' into feature/68-add-remote-links-to-result…
stellaprins Oct 28, 2024
a699363
add results_[local/remote] JSONs for easy testing and improving of re…
stellaprins Oct 28, 2024
830810f
add links column to results table and update collapsible content for …
stellaprins Oct 29, 2024
41389a6
draft for adding the warning messages in the foldout menu for the pas…
stellaprins Oct 29, 2024
08da400
remove outcommented code and a few of the comments
stellaprins Oct 30, 2024
30f36a2
update biosimulator functions to accept engine keys and add handling …
stellaprins Oct 30, 2024
d70cd8a
add links for pass cases in pass fail column
stellaprins Oct 30, 2024
52f139c
modify collapsible content function to handle no content cases
stellaprins Oct 30, 2024
091ccfb
change "warning" label for max steps reached error (amici) to "fail"
stellaprins Oct 30, 2024
4842812
add engine_keys input to run_biosimulators_locally function
stellaprins Oct 30, 2024
a9681bc
add draft process_log_yml and fetch exeption_type from log yml
stellaprins Oct 30, 2024
f99697f
Add same error handling to local results and update table. Also remov…
stellaprins Oct 30, 2024
87b640e
save log_yml dicts in results dictionary for easier testing
stellaprins Oct 31, 2024
3e0c1f3
remove unused functions and some unnecessary comments
stellaprins Oct 31, 2024
334e33d
save log_yml and process it later for easier trouble shooting
stellaprins Oct 31, 2024
3ea5e09
change log to log_yml for clarity
stellaprins Oct 31, 2024
23a313a
Update results processing and handle empty log_yml_dict case
stellaprins Oct 31, 2024
052a952
remove replaced function and update results tables
stellaprins Oct 31, 2024
bb5bf41
fix permission issues by ensuring outputs owned by user
stellaprins Oct 31, 2024
d2cf222
process detailedErrorLog txt file generated in vcell and adjust table…
stellaprins Nov 1, 2024
de2ec3a
remove local and remote tables used for trouble shooting
stellaprins Nov 1, 2024
c07059a
add 'expected fail' to foldout menu for XFAIL cases
stellaprins Nov 1, 2024
059bf6d
improve error message formatting in results table
stellaprins Nov 1, 2024
7f16fe8
update descriptions of scripts
stellaprins Nov 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 23 additions & 23 deletions SBML/tests/results_compatibility_biosimulators.md

Large diffs are not rendered by default.

1,265 changes: 1,265 additions & 0 deletions SBML/tests/results_local.json

Large diffs are not rendered by default.

1,358 changes: 1,358 additions & 0 deletions SBML/tests/results_remote.json

Large diffs are not rendered by default.

13 changes: 10 additions & 3 deletions SBML/tests/test_biosimulators_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

"""
This script tests the compatibility of different biosimulation engines with a given SBML and SED-ML file.
It runs each engine and records the result (pass/fail) and any error messages encountered during the simulation.
The results are then displayed in a table and saved to a markdown file.
It runs each engine and saves a JSON file with the log.yml file (as a dict), and the d1 plot for each engine.
"""

import sys
import os
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))) # to import utils
import utils
import argparse
import json

# Save the current working directory
cwd = os.getcwd()
Expand Down Expand Up @@ -38,8 +38,15 @@

print('d1 plots will be saved in:', d1_plots_local_dir)

results_local = utils.run_biosimulators_locally(sedml_file_name=sedml_file_name,
engine_keys = list(utils.ENGINES.keys())

results_local = utils.run_biosimulators_locally(engine_keys,
sedml_file_name=sedml_file_name,
sbml_file_name=sbml_file_name,
d1_plots_local_dir=d1_plots_local_dir,
test_folder=test_folder)

results_local_path = os.path.join(path_to_sbml_folder, 'tests', 'results_local.json')
with open(results_local_path, 'w') as fp:
json.dump(results_local, fp, indent=4)

14 changes: 11 additions & 3 deletions SBML/tests/test_biosimulators_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@

"""
This script tests the compatibility of different biosimulation engines with a given SBML and SED-ML file.
It runs each engine and records the result (pass/fail) and any error messages encountered during the simulation.
The results are then displayed in a table and saved to a markdown file.
It runs each engine and saves the d1 plots, and a JSON file containing the log.yml file (as dict) and the
links for accessing the remote results, for each engine.
"""

import sys
import os
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))) # to import utils
import utils
import argparse
import json


# Save the current working directory
cwd = os.getcwd()
Expand Down Expand Up @@ -38,8 +40,14 @@

print('d1 plots will be saved in:', d1_plots_remote_dir)

results_remote = utils.run_biosimulators_remotely(sedml_file_name=sedml_file_name,
engine_keys = list(utils.ENGINES.keys())

results_remote = utils.run_biosimulators_remotely(engine_keys, sedml_file_name=sedml_file_name,
sbml_file_name=sbml_file_name,
d1_plots_remote_dir=d1_plots_remote_dir,
test_folder=test_folder)

results_remote_path = os.path.join(path_to_sbml_folder, 'tests', 'results_remote.json')
with open(results_remote_path, 'w') as fp:
json.dump(results_remote, fp, indent=4)

5 changes: 4 additions & 1 deletion SBML/tests/test_compatibility_biosimulators.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@

print('d1 plots will be saved in:', d1_plots_remote_dir, 'and', d1_plots_local_dir)

utils.run_biosimulators_remotely_and_locally(sedml_file_name,
engine_keys = list(utils.ENGINES.keys())

utils.run_biosimulators_remotely_and_locally(engine_keys,
sedml_file_name,
sbml_file_name,
d1_plots_remote_dir,
d1_plots_local_dir,
Expand Down
16 changes: 12 additions & 4 deletions SBML/tests/test_creation_combined_results_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))) # to import utils
import utils
import argparse
import json

engines = utils.ENGINES

Expand Down Expand Up @@ -31,11 +32,18 @@
d1_plots_local_dir = os.path.join(test_folder, args.output_dir + '_local')
d1_plots_remote_dir = os.path.join(test_folder, args.output_dir + '_remote')

results_local = {'amici': 'pass', 'brian2': ['other', "```Command '-i /root/in/LEMS_NML2_Ex9_FN_missing_xmlns.omex -o /root/out' in image 'ghcr.io/biosimulators/brian2' returned non-zero exit status 1```"], 'bionetgen': ['other', "```Command '-i /root/in/LEMS_NML2_Ex9_FN_missing_xmlns.omex -o /root/out' in image 'ghcr.io/biosimulators/bionetgen' returned non-zero exit status 1```"], 'boolnet': ['other', "```Command '-i /root/in/LEMS_NML2_Ex9_FN_missing_xmlns.omex -o /root/out' in image 'ghcr.io/biosimulators/boolnet' returned non-zero exit status 1```"], 'cbmpy': ['other', "```Command '-i /root/in/LEMS_NML2_Ex9_FN_missing_xmlns.omex -o /root/out' in image 'ghcr.io/biosimulators/cbmpy' returned non-zero exit status 1```"], 'cobrapy': ['other', "```Command '-i /root/in/LEMS_NML2_Ex9_FN_missing_xmlns.omex -o /root/out' in image 'ghcr.io/biosimulators/cobrapy' returned non-zero exit status 1```"], 'copasi': 'pass', 'gillespy2': 'pass', 'ginsim': ['other', "```Command '-i /root/in/LEMS_NML2_Ex9_FN_missing_xmlns.omex -o /root/out' in image 'ghcr.io/biosimulators/ginsim' returned non-zero exit status 1```"], 'libsbmlsim': 'pass', 'masspy': ['other', "```Command '-i /root/in/LEMS_NML2_Ex9_FN_missing_xmlns.omex -o /root/out' in image 'ghcr.io/biosimulators/masspy' returned non-zero exit status 1```"], 'netpyne': ['other', "```Command '-i /root/in/LEMS_NML2_Ex9_FN_missing_xmlns.omex -o /root/out' in image 'ghcr.io/biosimulators/netpyne' returned non-zero exit status 1```"], 'neuron': ['other', "```Command '-i /root/in/LEMS_NML2_Ex9_FN_missing_xmlns.omex -o /root/out' in image 'ghcr.io/biosimulators/neuron' returned non-zero exit status 1```"], 'opencor': ['other', "```Command '-i /root/in/LEMS_NML2_Ex9_FN_missing_xmlns.omex -o /root/out' in image 'ghcr.io/biosimulators/opencor' returned non-zero exit status 1```"], 'pyneuroml': ['other', "```Command '-i /root/in/LEMS_NML2_Ex9_FN_missing_xmlns.omex -o /root/out' in image 'ghcr.io/biosimulators/pyneuroml' returned non-zero exit status 1```"], 'pysces': ['other', "```Command '-i /root/in/LEMS_NML2_Ex9_FN_missing_xmlns.omex -o /root/out' in image 'ghcr.io/biosimulators/pysces' returned non-zero exit status 1```"], 'rbapy': ['other', "```Command '-i /root/in/LEMS_NML2_Ex9_FN_missing_xmlns.omex -o /root/out' in image 'ghcr.io/biosimulators/rbapy' returned non-zero exit status 1```"], 'smoldyn': ['other', "```Command '-i /root/in/LEMS_NML2_Ex9_FN_missing_xmlns.omex -o /root/out' in image 'ghcr.io/biosimulators/smoldyn' returned non-zero exit status 1```"], 'tellurium': 'pass', 'vcell': ['other', "```Command '-i /root/in/LEMS_NML2_Ex9_FN_missing_xmlns.omex -o /root/out' in image 'ghcr.io/biosimulators/vcell' returned non-zero exit status 1```"], 'xpp': ['other', "```Command '-i /root/in/LEMS_NML2_Ex9_FN_missing_xmlns.omex -o /root/out' in image 'ghcr.io/biosimulators/xpp' returned non-zero exit status 1```"]}
results_remote = {'amici': ['pass', '', ''], 'brian2': ['FAIL', "No module named 'libsbml'", 'ModuleNotFoundError'], 'bionetgen': ['FAIL', 'The COMBINE/OMEX did not execute successfully:\n\n The SED document did not execute successfully:\n \n Language for model `net1` is not supported.\n - Model language `urn:sedml:language:sbml` is not supported. Models must be in BNGL format (e.g., `sed:model/@language` must match `^urn:sedml:language:bngl(\\.|$)` such as `urn:sedml:language:bngl`).', 'CombineArchiveExecutionError'], 'boolnet': ['FAIL', 'The COMBINE/OMEX did not execute successfully:\n\n The SED document did not execute successfully:\n \n Simulation `sim1` is invalid.\n - Number of points (20000) must be equal to the difference between the output end (200.0) and start times (0.0).', 'CombineArchiveExecutionError'], 'cbmpy': ['FAIL', 'The COMBINE/OMEX did not execute successfully:\n\n The SED document did not execute successfully:\n \n UniformTimeCourseSimulation `sim1` is not supported.\n - Simulation sim1 of type `UniformTimeCourseSimulation` is not supported. Simulation must be an instance of one of the following:\n - SteadyStateSimulation', 'CombineArchiveExecutionError'], 'cobrapy': ['FAIL', 'The COMBINE/OMEX did not execute successfully:\n\n The SED document did not execute successfully:\n \n UniformTimeCourseSimulation `sim1` is not supported.\n - Simulation sim1 of type `UniformTimeCourseSimulation` is not supported. Simulation must be an instance of one of the following:\n - SteadyStateSimulation', 'CombineArchiveExecutionError'], 'copasi': ['pass', '', ''], 'gillespy2': ['pass', '', ''], 'ginsim': ['FAIL', 'The COMBINE/OMEX did not execute successfully:\n\n The SED document did not execute successfully:\n \n Simulation `sim1` is invalid.\n - The interval between the output start and time time must be an integer multiple of the number of steps, not `0.01`:\n Output start time: 0.0\n Output end time: 200.0\n Number of steps: 20000', 'CombineArchiveExecutionError'], 'libsbmlsim': ['pass', '', ''], 'masspy': ['FAIL', 'The COMBINE/OMEX did not execute successfully:\n\n The SED document did not execute successfully:\n \n Something went wrong reading the SBML model. Most likely the SBML model is not valid. Please check that your model is valid using the `mass.io.sbml.validate_sbml_model` function or via the online validator at http://sbml.org/validator .\n \t`(model, errors) = validate_sbml_model(filename)`\n If the model is valid and cannot be read please open an issue at https://github.com/SBRG/masspy/issues .', 'CombineArchiveExecutionError'], 'netpyne': ['FAIL', "No module named 'libsbml'", 'ModuleNotFoundError'], 'neuron': ['FAIL', "No module named 'libsbml'", 'ModuleNotFoundError'], 'opencor': ['FAIL', "No module named 'libsbml'", 'ModuleNotFoundError'], 'pyneuroml': ['FAIL', "No module named 'libsbml'", 'ModuleNotFoundError'], 'pysces': ['FAIL', 'The COMBINE/OMEX did not execute successfully:\n\n The SED document did not execute successfully:\n \n Model at /tmp/tmp1bq_quiv/./LEMS_NML2_Ex9_FN.sbml could not be imported:\n \n File /tmp/tmp1bq_quiv/./LEMS_NML2_Ex9_FN.sbml.xml does not exist', 'CombineArchiveExecutionError'], 'rbapy': ['FAIL', 'The COMBINE/OMEX did not execute successfully:\n\n The SED document did not execute successfully:\n \n Language for model `net1` is not supported.\n - Model language `urn:sedml:language:sbml` is not supported. Models must be in RBA format (e.g., `sed:model/@language` must match `^urn:sedml:language:rba(\\.|$)` such as `urn:sedml:language:rba`).', 'CombineArchiveExecutionError'], 'smoldyn': ['FAIL', "No module named 'libsbml'", 'ModuleNotFoundError'], 'tellurium': ['pass', '', ''], 'vcell': [None, '', ''], 'xpp': ['FAIL', "No module named 'libsbml'", 'ModuleNotFoundError']}
results_paths = {
"local": os.path.join(path_to_sbml_folder, 'tests', 'results_local.json'),
"remote": os.path.join(path_to_sbml_folder, 'tests', 'results_remote.json')
}

results_table = utils.create_combined_results_table(results_remote,
results_local,
results = {}
for key, path in results_paths.items():
with open(path, 'r') as f:
results[key] = json.load(f)

results_table = utils.create_combined_results_table(results["remote"],
results["local"],
sedml_file_name,
sbml_file_name,
d1_plots_local_dir,
Expand Down
2 changes: 1 addition & 1 deletion test_suite/test_test_suite_compatibility_biosimulators.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def process_cases(args):
os.path.basename(sbml_file_path),
os.path.join(test_folder,'d1_plots_remote'),
os.path.join(test_folder,'d1_plots_local'),
engines=engines, test_folder=test_folder)
test_folder=test_folder)


if __name__ == "__main__":
Expand Down
Loading