Skip to content
Open
Changes from all commits
Commits
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
100 changes: 48 additions & 52 deletions config_gui.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
"cells": [
{
"cell_type": "code",
"execution_count": 36,
"execution_count": 30,
"metadata": {},
"outputs": [],
"source": [
"import ipywidgets as widgets\n",
"#from ipywidgets import interact, interactive\n",
"from ipywidgets import Layout"
"\n",
"%matplotlib inline\n",
"import matplotlib.pyplot as plt\n",
Expand All @@ -17,33 +18,18 @@
},
{
"cell_type": "code",
"execution_count": 37,
"execution_count": 47,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "cb4ef4ff6f734170bb59f5c1daa767ed",
"model_id": "06f8394425644434bbc1c6ab1f0ba488",
"version_major": 2,
"version_minor": 0
},
"text/html": [
"<p>Failed to display Jupyter Widget of type <code>VBox</code>.</p>\n",
"<p>\n",
" If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean\n",
" that the widgets JavaScript is still loading. If this message persists, it\n",
" likely means that the widgets JavaScript library is either not installed or\n",
" not enabled. See the <a href=\"https://ipywidgets.readthedocs.io/en/stable/user_install.html\">Jupyter\n",
" Widgets Documentation</a> for setup instructions.\n",
"</p>\n",
"<p>\n",
" If you're reading this message in another frontend (for example, a static\n",
" rendering on GitHub or <a href=\"https://nbviewer.jupyter.org/\">NBViewer</a>),\n",
" it may mean that your frontend doesn't currently support widgets.\n",
"</p>\n"
],
"text/plain": [
"VBox(children=(Tab(children=(VBox(children=(HBox(children=(Button(button_style='info', description='Read config file', style=ButtonStyle(), tooltip='Read XML'), Text(value='default.xml'))), HBox(children=(FloatText(value=-500.0, description='$X_{min}$'), FloatText(value=500.0, description='$X_{max}$'), BoundedFloatText(value=20.0, description='$X_{delta}$', min=1.0))), HBox(children=(FloatText(value=-500.0, description='$Y_{min}$'), FloatText(value=500.0, description='$Y_{max}$'), BoundedFloatText(value=20.0, description='$Y_{delta}$', min=1.0))), HBox(children=(FloatText(value=-500.0, description='$Z_{min}$'), FloatText(value=500.0, description='$Z_{max}$'), BoundedFloatText(value=20.0, description='$Z_{delta}$', min=1.0))), BoundedFloatText(value=10000.0, description='$Time_{max}$', max=100000000.0), BoundedIntText(value=8, description='# threads', min=1), HBox(children=(Checkbox(value=False, description='Seed PRNG'), BoundedIntText(value=13, description='Seed value', min=1))), HBox(children=(Checkbox(value=True, description='.svg'), BoundedFloatText(value=0.0, description='$T_0$'), BoundedIntText(value=5, description='Every $N^{th}$ time step', min=1))), HBox(children=(Checkbox(value=False, description='MultiCellDS'), FloatText(value=0.0, description='$T_0$', disabled=True), BoundedIntText(value=5, description='Every $N^{th}$ time step', disabled=True))), HBox(children=(Button(button_style='success', description='Write config file', style=ButtonStyle(), tooltip='Generate XML'), Text(value='nano.xml'))))), interactive(children=(IntSlider(value=50, description='p'), Output(layout=Layout(height='300px'))), _dom_classes=('widget-interact',))), _titles={'0': 'Config', '1': 'Simulate'}),))"
"A Jupyter Widget"
]
},
"metadata": {},
Expand All @@ -58,76 +44,88 @@
}
],
"source": [
"constWidth = '175px'\n",
"xmin = widgets.FloatText(\n",
" value= -500.,\n",
" value= -500.0,\n",
" description='$X_{min}$',\n",
" disabled=False\n",
" disabled=False,\n",
" layout = Layout(width = constWidth)\n",
")\n",
"\n",
"ymin = widgets.FloatText(\n",
" value= -500.,\n",
" description='$Y_{min}$',\n",
" disabled=False\n",
" disabled=False,\n",
" layout = Layout(width = constWidth)\n",
")\n",
"\n",
"zmin = widgets.FloatText(\n",
" value= -500.,\n",
" description='$Z_{min}$',\n",
" disabled=False\n",
" disabled=False,\n",
" layout = Layout(width = constWidth)\n",
")\n",
" \n",
"xmax = widgets.FloatText(\n",
" value= 500.,\n",
" description='$X_{max}$',\n",
" disabled=False\n",
" disabled=False,\n",
" layout = Layout(width = constWidth)\n",
")\n",
"\n",
"ymax = widgets.FloatText(\n",
" value= 500.,\n",
" description='$Y_{max}$',\n",
" disabled=False\n",
" disabled=False,\n",
" layout = Layout(width = constWidth)\n",
")\n",
"\n",
"zmax = widgets.FloatText(\n",
" value= 500,\n",
" description='$Z_{max}$',\n",
" disabled=False\n",
" disabled=False,\n",
" layout = Layout(width = constWidth)\n",
")\n",
"\n",
"tmax = widgets.BoundedFloatText(\n",
" min = 0.,\n",
" max = 100000000,\n",
" value= 10000.,\n",
" description='$Time_{max}$',\n",
" disabled=False\n",
" disabled=False,\n",
" layout = Layout(width = constWidth)\n",
")\n",
" \n",
"xdelta = widgets.BoundedFloatText(\n",
" min = 1.,\n",
" value= 20.,\n",
" description='$X_{delta}$',\n",
" disabled=False\n",
" disabled=False,\n",
" layout = Layout(width = constWidth)\n",
")\n",
"\n",
"ydelta = widgets.BoundedFloatText(\n",
" min = 1.,\n",
" value= 20.,\n",
" description='$Y_{delta}$',\n",
" disabled=False\n",
" disabled=False,\n",
" layout = Layout(width = constWidth)\n",
")\n",
"\n",
"zdelta = widgets.BoundedFloatText(\n",
" min = 1.,\n",
" value= 20.,\n",
" description='$Z_{delta}$',\n",
" disabled=False\n",
" disabled=False,\n",
" layout = Layout(width = constWidth)\n",
")\n",
" \n",
"tdelta = widgets.BoundedFloatText(\n",
" min = 0.01,\n",
" value= 10.,\n",
" description='$Time_{delta}$',\n",
" disabled=False\n",
" disabled=False,\n",
" layout = Layout(width = constWidth)\n",
")\n",
"x_row = widgets.HBox([xmin,xmax,xdelta])\n",
"y_row = widgets.HBox([ymin,ymax,ydelta])\n",
Expand All @@ -138,7 +136,8 @@
" min=1,\n",
" step=1,\n",
" description='# threads',\n",
" disabled=False\n",
" disabled=False,\n",
" layout = Layout(width = constWidth)\n",
")\n",
"prng_toggle = widgets.Checkbox(\n",
" value=False,\n",
Expand All @@ -149,7 +148,8 @@
" min = 1,\n",
" value=13,\n",
" description='Seed value',\n",
" disabled=False\n",
" disabled=False,\n",
" layout = Layout(width = constWidth)\n",
")\n",
"prng_row = widgets.HBox([prng_toggle, prng_seed])\n",
"\n",
Expand All @@ -162,13 +162,15 @@
" min=0,\n",
" value=0.0,\n",
" description='$T_0$',\n",
" disabled=False\n",
" disabled=False,\n",
" layout = Layout(width = constWidth)\n",
")\n",
"svg_num_delT = widgets.BoundedIntText(\n",
" min=1,\n",
" value=5,\n",
" description='Every $N^{th}$ time step',\n",
" disabled=False\n",
" disabled=False,\n",
" layout = Layout(width = constWidth)\n",
")\n",
"\n",
"mcds_toggle = widgets.Checkbox(\n",
Expand All @@ -179,13 +181,15 @@
"mcds_t0 = widgets.FloatText(\n",
" value=0.0,\n",
" description='$T_0$',\n",
" disabled=True\n",
" disabled=True,\n",
" layout = Layout(width = constWidth)\n",
")\n",
"mcds_num_delT = widgets.BoundedIntText(\n",
" min=0,\n",
" value=5,\n",
" description='Every $N^{th}$ time step',\n",
" disabled=True\n",
" disabled=True,\n",
" layout = Layout(width = constWidth)\n",
")\n",
"\n",
"def read_config_file_cb(b):\n",
Expand Down Expand Up @@ -290,20 +294,12 @@
},
{
"cell_type": "code",
"execution_count": 38,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"/bin/sh: nanobio: command not found\r\n"
]
}
],
"source": [
"!nanobio config/liver.xml"
]
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -322,7 +318,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.4"
"version": "3.6.2"
}
},
"nbformat": 4,
Expand Down