-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51 from OpenSourceBrain/feature/create_test_compa…
…tibility_biosimulators_for_first_example_in_sbml_test_suite Feature/create test compatibility biosimulators for first example in sbml test suite
- Loading branch information
Showing
41 changed files
with
577 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
|
||
name: Testing non OMV scripts (locally using docker) | ||
|
||
on: | ||
push: | ||
branches: [ master, development, experimental, test*, feature/* ] | ||
pull_request: | ||
branches: [ master, development, experimental, test*, feature/* ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [ 3.9, "3.10" ] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install git+https://github.com/OpenSourceBrain/osb-model-validation | ||
pip install pyNeuroML[annotations] | ||
pip install python-libsedml | ||
pip install tellurium | ||
sudo apt-get install libncurses5 --fix-missing | ||
omv install jneuroml | ||
pip install "pymetadata>=0.4.2" docker "requests<2.32.0" | ||
- name: Final version info | ||
run: | | ||
omv list -V # list installed engines | ||
pip list | ||
env | ||
- name: Test local biosimulators compatibility table creation | ||
run: | | ||
cd SBML/tests | ||
sudo rm -rf output | ||
python ./test_biosimulators_local.py --output-dir=tmp_plots | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
|
||
name: Testing non OMV scripts (remotely via URLs) | ||
|
||
on: | ||
push: | ||
branches: [ master, development, experimental, test*, feature/* ] | ||
pull_request: | ||
branches: [ master, development, experimental, test*, feature/* ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [ 3.9, "3.10" ] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install git+https://github.com/OpenSourceBrain/osb-model-validation | ||
pip install pyNeuroML[annotations] | ||
pip install python-libsedml | ||
pip install tellurium | ||
sudo apt-get install libncurses5 --fix-missing | ||
omv install jneuroml | ||
pip install "pymetadata>=0.4.2" docker "requests<2.32.0" | ||
- name: Final version info | ||
run: | | ||
omv list -V # list installed engines | ||
pip list | ||
env | ||
- name: Test remote biosimulators compatibility table creation | ||
run: | | ||
cd SBML/tests | ||
sudo rm -rf output | ||
python ./test_biosimulators_remote.py --output-dir=tmp_plots | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/usr/bin/env python | ||
|
||
""" | ||
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. | ||
""" | ||
|
||
import sys | ||
import os | ||
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))) # to import utils | ||
import utils | ||
import argparse | ||
|
||
engines = utils.engines | ||
types_dict = utils.types_dict | ||
|
||
# Save the current working directory | ||
cwd = os.getcwd() | ||
print('Current working directory:', cwd) | ||
|
||
# SBML folder is one folder up relative to cwd | ||
path_to_sbml_folder = os.path.abspath(os.path.join(cwd, os.pardir)) | ||
print('Path to SBML folder:', path_to_sbml_folder) | ||
|
||
# change the working directory to the SBML folder (because here the SBML and SED-ML files are located) | ||
os.chdir(path_to_sbml_folder) | ||
print('Changed working directory to:', os.getcwd()) | ||
|
||
sbml_file_name = 'LEMS_NML2_Ex9_FN.sbml' | ||
sedml_file_name = 'LEMS_NML2_Ex9_FN_missing_xmlns.sedml' #xmlns:sbml missing | ||
|
||
# output_dir is set to 'd1_plots' by default but can be changed using the --output-dir argument (required to deal with GitHub Actions permission issues) | ||
parser = argparse.ArgumentParser(description='Test compatibility of different biosimulation engines') | ||
parser.add_argument('--output-dir',action='store',default='d1_plots',help='prefix of the output directory where the d1 plots will be saved') | ||
args = parser.parse_args() | ||
|
||
test_folder = 'tests' | ||
|
||
d1_plots_local_dir = os.path.join(test_folder, args.output_dir + '_local') | ||
|
||
print('d1 plots will be saved in:', d1_plots_local_dir) | ||
|
||
results_local = utils.run_biosimulators_locally(sedml_file_name=sedml_file_name, | ||
sbml_file_name=sbml_file_name, | ||
d1_plots_local_dir=d1_plots_local_dir, | ||
engines=engines, test_folder=test_folder) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/usr/bin/env python | ||
|
||
""" | ||
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. | ||
""" | ||
|
||
import sys | ||
import os | ||
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))) # to import utils | ||
import utils | ||
import argparse | ||
|
||
engines = utils.engines | ||
types_dict = utils.types_dict | ||
|
||
# Save the current working directory | ||
cwd = os.getcwd() | ||
print('Current working directory:', cwd) | ||
|
||
# SBML folder is one folder up relative to cwd | ||
path_to_sbml_folder = os.path.abspath(os.path.join(cwd, os.pardir)) | ||
print('Path to SBML folder:', path_to_sbml_folder) | ||
|
||
# change the working directory to the SBML folder (because here the SBML and SED-ML files are located) | ||
os.chdir(path_to_sbml_folder) | ||
print('Changed working directory to:', os.getcwd()) | ||
|
||
sbml_file_name = 'LEMS_NML2_Ex9_FN.sbml' | ||
sedml_file_name = 'LEMS_NML2_Ex9_FN_missing_xmlns.sedml' #xmlns:sbml missing | ||
|
||
# output_dir is set to 'd1_plots' by default but can be changed using the --output-dir argument (required to deal with GitHub Actions permission issues) | ||
parser = argparse.ArgumentParser(description='Test compatibility of different biosimulation engines') | ||
parser.add_argument('--output-dir',action='store',default='d1_plots',help='prefix of the output directory where the d1 plots will be saved') | ||
args = parser.parse_args() | ||
|
||
test_folder = 'tests' | ||
|
||
d1_plots_remote_dir = os.path.join(test_folder, args.output_dir + '_remote') | ||
|
||
print('d1 plots will be saved in:', d1_plots_remote_dir) | ||
|
||
results_remote = utils.run_biosimulators_remotely(sedml_file_name=sedml_file_name, | ||
sbml_file_name=sbml_file_name, | ||
d1_plots_remote_dir=d1_plots_remote_dir, | ||
engines=engines, test_folder=test_folder) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- Written by libSedML v1.1.5419.25885 see http://libsedml.sf.net --> | ||
<sedML level="1" version="1" xmlns="http://sed-ml.org/"> | ||
<listOfSimulations> | ||
<uniformTimeCourse id="simulation_1" initialTime="0" outputStartTime="0" outputEndTime="5" numberOfPoints="50"> | ||
<algorithm kisaoID="KISAO:0000019" /> | ||
</uniformTimeCourse> | ||
</listOfSimulations> | ||
<listOfModels> | ||
<model id="model_1" language="urn:sedml:language:sbml" source="00001-sbml-l3v2.xml" /> | ||
</listOfModels> | ||
<listOfTasks> | ||
<task id="task_1" modelReference="model_1" simulationReference="simulation_1" /> | ||
</listOfTasks> | ||
<listOfDataGenerators> | ||
<dataGenerator id="time_1" name="time"> | ||
<listOfVariables> | ||
<variable id="time" taskReference="task_1" symbol="urn:sedml:symbol:time" /> | ||
</listOfVariables> | ||
<math xmlns="http://www.w3.org/1998/Math/MathML"> | ||
<ci> time </ci> | ||
</math> | ||
</dataGenerator> | ||
<dataGenerator id="S1_1" name="S1"> | ||
<listOfVariables> | ||
<variable id="S1_1_s" taskReference="task_1" target="/sbml:sbml/sbml:model/sbml:listOfSpecies/sbml:species[@id='S1']" /> | ||
<variable id="S1_1_c" taskReference="task_1" target="/sbml:sbml/sbml:model/sbml:listOfCompartments/sbml:compartment[@id='compartment']" /> | ||
</listOfVariables> | ||
<math xmlns="http://www.w3.org/1998/Math/MathML"> | ||
<apply> | ||
<times /> | ||
<ci> S1_1_s </ci> | ||
<ci> S1_1_c </ci> | ||
</apply> | ||
</math> | ||
</dataGenerator> | ||
<dataGenerator id="S2_1" name="S2"> | ||
<listOfVariables> | ||
<variable id="S2_1_s" taskReference="task_1" target="/sbml:sbml/sbml:model/sbml:listOfSpecies/sbml:species[@id='S2']" /> | ||
<variable id="S2_1_c" taskReference="task_1" target="/sbml:sbml/sbml:model/sbml:listOfCompartments/sbml:compartment[@id='compartment']" /> | ||
</listOfVariables> | ||
<math xmlns="http://www.w3.org/1998/Math/MathML"> | ||
<apply> | ||
<times /> | ||
<ci> S2_1_s </ci> | ||
<ci> S2_1_c </ci> | ||
</apply> | ||
</math> | ||
</dataGenerator> | ||
</listOfDataGenerators> | ||
<listOfOutputs> | ||
<plot2D id="plot_1" name="Timecourse for test 00001"> | ||
<listOfCurves> | ||
<curve id="c_S1_1" name="S1" logX="false" logY="false" xDataReference="time_1" yDataReference="S1_1" /> | ||
<curve id="c_S2_1" name="S2" logX="false" logY="false" xDataReference="time_1" yDataReference="S2_1" /> | ||
</listOfCurves> | ||
</plot2D> | ||
<report id="report_1" name="Report for test 00001"> | ||
<listOfDataSets> | ||
<dataSet id="ds_time" dataReference="time_1" label="Time" /> | ||
<dataSet id="ds_S1_1" dataReference="S1_1" label="S1" /> | ||
<dataSet id="ds_S2_1" dataReference="S2_1" label="S2" /> | ||
</listOfDataSets> | ||
</report> | ||
</listOfOutputs> | ||
</sedML> |
Oops, something went wrong.