From 68dcfb570f986118df59e810dd569438ed94e35e Mon Sep 17 00:00:00 2001 From: Eric Bower <31257558+ebower42@users.noreply.github.com> Date: Fri, 9 Mar 2018 16:22:40 -0500 Subject: [PATCH 1/2] Add files via upload --- config_gui.ipynb | 86 ++++++++++++++++++++++++++---------------------- 1 file changed, 46 insertions(+), 40 deletions(-) diff --git a/config_gui.ipynb b/config_gui.ipynb index 2c7a542..7ea9ad3 100644 --- a/config_gui.ipynb +++ b/config_gui.ipynb @@ -2,42 +2,28 @@ "cells": [ { "cell_type": "code", - "execution_count": 2, + "execution_count": 30, "metadata": {}, "outputs": [], "source": [ - "import ipywidgets as widgets" + "import ipywidgets as widgets\n", + "from ipywidgets import Layout" ] }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 47, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "055b1c7377164d718f142e03f88396b0", + "model_id": "06f8394425644434bbc1c6ab1f0ba488", "version_major": 2, "version_minor": 0 }, - "text/html": [ - "
Failed to display Jupyter Widget of type VBox.
\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 Jupyter\n", - " Widgets Documentation for setup instructions.\n", - "
\n", - "\n", - " If you're reading this message in another frontend (for example, a static\n", - " rendering on GitHub or NBViewer),\n", - " it may mean that your frontend doesn't currently support widgets.\n", - "
\n" - ], "text/plain": [ - "VBox(children=(HBox(children=(Button(button_style='info', description='Read config file', style=ButtonStyle(), tooltip='Read XML'), Text(value='config/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='.mat'), 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='config/liver.xml')))))" + "A Jupyter Widget" ] }, "metadata": {}, @@ -45,40 +31,47 @@ } ], "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", @@ -86,35 +79,40 @@ " 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", @@ -125,7 +123,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", @@ -136,7 +135,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", @@ -149,13 +149,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", "mat_toggle = widgets.Checkbox(\n", @@ -166,13 +168,15 @@ "mat_t0 = widgets.FloatText(\n", " value=0.0,\n", " description='$T_0$',\n", - " disabled=True\n", + " disabled=True,\n", + " layout = Layout(width = constWidth)\n", ")\n", "mat_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", "read_config_button = widgets.Button(\n", @@ -207,7 +211,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [] } @@ -228,7 +234,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.4" + "version": "3.6.2" } }, "nbformat": 4, From 3af5d47a6a448eeefd9e1f03f76ee02a29e49742 Mon Sep 17 00:00:00 2001 From: Eric Bower <31257558+ebower42@users.noreply.github.com> Date: Fri, 9 Mar 2018 16:25:57 -0500 Subject: [PATCH 2/2] Halved text box sizes Added an import line of importing Layout from ipywidgets. Also added variable constWidth which represents the width of every text box. In the initialization of each text box, I added a Layout argument with constWidth.