From 544e3414594d99eb26cc1c938c345338c030fdf4 Mon Sep 17 00:00:00 2001 From: alexPatrie Date: Wed, 21 Feb 2024 10:58:30 -0500 Subject: [PATCH] added main notebook and updated docker runner --- main.ipynb | 102 ++++++++++++++++++++++++++++++++++++++++++ scripts/run-docker.sh | 2 +- 2 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 main.ipynb diff --git a/main.ipynb b/main.ipynb new file mode 100644 index 000000000..35aa00a5a --- /dev/null +++ b/main.ipynb @@ -0,0 +1,102 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "id": "initial_id", + "metadata": { + "collapsed": true, + "is_executing": true + }, + "outputs": [], + "source": [ + "import os \n", + "import smoldyn\n", + "import tellurium as te\n", + "import sed2.core \n", + "from process_bigraph import Composite\n", + "from biosimulator_processes.smoldyn_process import SmoldynProcess" + ] + }, + { + "cell_type": "code", + "outputs": [], + "source": [ + "instance = {\n", + " 'smoldyn': {\n", + " '_type': 'process',\n", + " 'address': 'local:smoldyn',\n", + " 'config': {\n", + " 'model_filepath': 'biosimulator_processes/model_files/minE_model.txt',\n", + " 'animate': False},\n", + " 'inputs': {\n", + " 'species_counts': ['species_counts_store'],\n", + " 'molecules': ['molecules_store']},\n", + " 'outputs': {\n", + " 'species_counts': ['species_counts_store'],\n", + " 'molecules': ['molecules_store']}\n", + " },\n", + " 'emitter': {\n", + " '_type': 'step',\n", + " 'address': 'local:ram-emitter',\n", + " 'config': {\n", + " 'emit': {\n", + " 'species_counts': 'tree[string]',\n", + " 'molecules': 'tree[string]'}\n", + " },\n", + " 'inputs': {\n", + " 'species_counts': ['species_counts_store'],\n", + " 'molecules': ['molecules_store']}\n", + " }\n", + " }" + ], + "metadata": { + "collapsed": false + }, + "id": "e379ea06228d2046" + }, + { + "cell_type": "code", + "outputs": [], + "source": [ + "fp = instance.get('smoldyn').get('config').get('model_filepath')\n", + "\n", + "os.path.exists(fp)" + ], + "metadata": { + "collapsed": false + }, + "id": "54541b0cc32e5940" + }, + { + "cell_type": "code", + "outputs": [], + "source": [], + "metadata": { + "collapsed": false + }, + "id": "beca4cc35a69b69c" + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/scripts/run-docker.sh b/scripts/run-docker.sh index ea5b8e3f3..63934cfbb 100755 --- a/scripts/run-docker.sh +++ b/scripts/run-docker.sh @@ -2,7 +2,7 @@ yes | docker system prune docker buildx create --name biosimbuilder --use docker buildx inspect --bootstrap -docker buildx build --platform linux/amd64 -t biosimulator-processes . \ +docker buildx build --platform linux/amd64 -t biosimulators/biosimulator-processes:0.0.1 . \ && docker run --platform linux/amd64 -it -p 8888:8888 biosimulator-processes