From a81e2f7fbb89c2779984c0abc9d85efb6a2f1151 Mon Sep 17 00:00:00 2001 From: ml server Date: Wed, 22 Jan 2020 19:32:48 -0700 Subject: [PATCH] dev cleanup --- notebooks/wut-web-dev.ipynb | 164 +++--------------------------------- 1 file changed, 10 insertions(+), 154 deletions(-) diff --git a/notebooks/wut-web-dev.ipynb b/notebooks/wut-web-dev.ipynb index bd63c09..d7ad8cc 100644 --- a/notebooks/wut-web-dev.ipynb +++ b/notebooks/wut-web-dev.ipynb @@ -6,7 +6,7 @@ "metadata": {}, "outputs": [], "source": [ - "# wut-web --- What U Think? Web App: SatNOGS Observation AI, makes predictions.\n", + "# wut-web-dev --- What U Think? Web App: SatNOGS Observation AI, makes predictions, development version.\n", "#\n", "# https://spacecruft.org/spacecruft/satnogs-wut\n", "#\n", @@ -33,14 +33,8 @@ "metadata": {}, "outputs": [], "source": [ - "# Cute SSTV: 1456893\n", - "# December, 2019 range: 1292461 \n", - "obsmin=1292461\n", - "obsmax=1470525\n", - "print(\"Minimum Observation ID: \", obsmin)\n", - "print(\"Maximum Observation ID: \", obsmax)\n", - "\n", - "print(\"Enter a value between the minimum and maximum Observation ID:\")" + "out = widgets.Output(layout={'border': '5px solid lightblue'})\n", + "out" ] }, { @@ -49,29 +43,14 @@ "metadata": {}, "outputs": [], "source": [ - "%gui asyncio\n", + "# Cute SSTV: 1456893\n", + "# December, 2019 range: 1292461 \n", + "obsmin=1292461\n", + "obsmax=1470525\n", + "print(\"Minimum Observation ID: \", obsmin)\n", + "print(\"Maximum Observation ID: \", obsmax)\n", "\n", - "import asyncio\n", - "def wait_for_change(widget, value):\n", - " future = asyncio.Future()\n", - " def getvalue(change):\n", - " # make the new value available\n", - " future.set_result(change.new)\n", - " widget.unobserve(getvalue, value)\n", - " widget.observe(getvalue, value)\n", - " return future\n", - "\n", - "from ipywidgets import IntSlider\n", - "slider = IntSlider()\n", - "\n", - "async def f():\n", - " for i in range(10):\n", - " print('did work %s'%i)\n", - " x = await wait_for_change(slider, 'value')\n", - " print('async function continued with value %s'%x)\n", - "asyncio.ensure_future(f())\n", - "\n", - "slider" + "print(\"Enter a value between the minimum and maximum Observation ID:\")" ] }, { @@ -86,69 +65,6 @@ "mylink = widgets.jslink((obsget, 'value'), (b, 'value'))" ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "import ipywidgets as widgets\n", - "print(widgets.Button.on_click.__doc__)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from IPython.display import display\n", - "button = widgets.Button(description=\"Click Me!\")\n", - "output = widgets.Output()\n", - "\n", - "display(button, output)\n", - "\n", - "def on_button_clicked(b):\n", - " with output:\n", - " print(\"Button clicked.\")\n", - "\n", - "button.on_click(on_button_clicked)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "a = widgets.IntSlider(description=\"Delayed\", continuous_update=False)\n", - "b = widgets.IntText(description=\"Delayed\", continuous_update=False)\n", - "c = widgets.IntSlider(description=\"Continuous\", continuous_update=True)\n", - "d = widgets.IntText(description=\"Continuous\", continuous_update=True)\n", - "\n", - "widgets.link((a, 'value'), (b, 'value'))\n", - "widgets.link((a, 'value'), (c, 'value'))\n", - "widgets.link((a, 'value'), (d, 'value'))\n", - "widgets.VBox([a,b,c,d])" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "widgets.IntProgress(\n", - " value=obsget.value,\n", - " min=1292461,\n", - " max=1470525,\n", - " step=1,\n", - " description='Loading:',\n", - " bar_style='success',\n", - " orientation='horizontal'\n", - ")" - ] - }, { "cell_type": "code", "execution_count": null, @@ -156,11 +72,6 @@ "outputs": [], "source": [ "out = widgets.Output(layout={'border': '5px solid lightblue'})\n", - "#out\n", - "with out:\n", - " for i in range(10):\n", - " print(i, 'Hello world!')\n", - " display(widgets.IntSlider())\n", "out" ] }, @@ -187,52 +98,6 @@ "out.clear_output()" ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "print(obsget)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "print(b.value)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "print(obsget.value)\n", - "obsget.continuous_update = True" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "obsget.keys" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "print(obsget.continuous_update)" - ] - }, { "cell_type": "code", "execution_count": null, @@ -242,15 +107,6 @@ "print(obsget.value)" ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "barf()" - ] - }, { "cell_type": "code", "execution_count": null,