diff --git a/.gitignore b/.gitignore index 3eb97453..5e2d0e73 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ log .coverage htmlcov/ +.idea/ +build-install.sh diff --git a/examples/S99_more/Min/Min1.omex b/examples/S99_more/Min/Min1.omex new file mode 100644 index 00000000..cd12beb3 Binary files /dev/null and b/examples/S99_more/Min/Min1.omex differ diff --git a/source/python/setup.py.in b/source/python/setup.py.in index dd792a63..2060067d 100644 --- a/source/python/setup.py.in +++ b/source/python/setup.py.in @@ -63,6 +63,7 @@ setuptools.setup( "biosimulators-utils[logging]>=0.1.124", "numpy", "pandas", + "biosimulators-simularium>=0.5.24" ], "biosimulators-dev": [ "flake8", diff --git a/source/python/smoldyn/biosimulators/combine.py b/source/python/smoldyn/biosimulators/combine.py index 9a9fbd88..d3aa9964 100644 --- a/source/python/smoldyn/biosimulators/combine.py +++ b/source/python/smoldyn/biosimulators/combine.py @@ -25,6 +25,7 @@ Symbol) from biosimulators_utils.sedml.exec import exec_sed_doc as base_exec_sed_doc from biosimulators_utils.utils.core import validate_str_value, parse_value, raise_errors_warnings +from biosimulators_simularium.exec import execute as exec_biosimularium from smoldyn import smoldyn import functools import os @@ -32,6 +33,7 @@ import pandas import re import tempfile +import zipfile import types # noqa: F401 __all__ = ['exec_sedml_docs_in_combine_archive', 'exec_sed_task', 'exec_sed_doc', 'preprocess_sed_task'] @@ -57,9 +59,27 @@ def exec_sedml_docs_in_combine_archive(archive_filename, out_dir, config=None): * :obj:`SedDocumentResults`: results * :obj:`CombineArchiveLog`: log ''' - return exec_sedml_docs_in_archive(exec_sed_doc, archive_filename, out_dir, - apply_xml_model_changes=False, - config=config) + + print('GENERATING A SIMULARIUM FILE ------------- ') + # extract contents from archive + temp_archive_root = tempfile.mkdtemp() + with zipfile.ZipFile(archive_filename, 'r') as ref: + ref.extractall(temp_archive_root) + + # process simularium file generation + exec_biosimularium( + working_dir=temp_archive_root, + output_dir=out_dir, + use_json=True + ) + + print('RUNNING A SEDML SIMULATION ------------------ ') + # process sed result + results, log = exec_sedml_docs_in_archive(exec_sed_doc, archive_filename, out_dir, + apply_xml_model_changes=False, + config=config) + + return results, log def exec_sed_doc(doc, working_dir, base_out_path, rel_out_path=None,