diff --git a/demo/demo.ipynb b/demo/demo.ipynb index e497b68e..0bc895ab 100644 --- a/demo/demo.ipynb +++ b/demo/demo.ipynb @@ -2,11 +2,11 @@ "cells": [ { "cell_type": "code", - "execution_count": 67, + "execution_count": 84, "metadata": { "ExecuteTime": { - "end_time": "2023-08-07T17:15:43.827819Z", - "start_time": "2023-08-07T17:15:43.820551Z" + "end_time": "2023-08-07T17:55:24.927897Z", + "start_time": "2023-08-07T17:55:24.902318Z" } }, "outputs": [], @@ -19,11 +19,11 @@ }, { "cell_type": "code", - "execution_count": 68, + "execution_count": 85, "metadata": { "ExecuteTime": { - "end_time": "2023-08-07T17:15:43.857901Z", - "start_time": "2023-08-07T17:15:43.831693Z" + "end_time": "2023-08-07T17:55:24.983379Z", + "start_time": "2023-08-07T17:55:24.913963Z" } }, "outputs": [], @@ -52,11 +52,11 @@ }, { "cell_type": "code", - "execution_count": 69, + "execution_count": 86, "metadata": { "ExecuteTime": { - "end_time": "2023-08-07T17:15:43.960219Z", - "start_time": "2023-08-07T17:15:43.862625Z" + "end_time": "2023-08-07T17:55:24.985129Z", + "start_time": "2023-08-07T17:55:24.919937Z" } }, "outputs": [ @@ -64,7 +64,7 @@ "data": { "text/plain": "mercury.App", "text/html": "

Mercury Application

This output won't appear in the web app.", - "application/mercury+json": "{\n \"widget\": \"App\",\n \"title\": \"Scheduler Validate Test\",\n \"description\": \"Try the Validation mode for the Scheduler\",\n \"show_code\": false,\n \"show_prompt\": true,\n \"output\": \"app\",\n \"schedule\": \"\",\n \"notify\": \"{}\",\n \"continuous_update\": true,\n \"static_notebook\": false,\n \"show_sidebar\": true,\n \"full_screen\": true,\n \"allow_download\": true,\n \"model_id\": \"mercury-app\",\n \"code_uid\": \"App.0.40.24.2-rand0b89ab1b\"\n}" + "application/mercury+json": "{\n \"widget\": \"App\",\n \"title\": \"Scheduler Validate Test\",\n \"description\": \"Try the Validation mode for the Scheduler\",\n \"show_code\": false,\n \"show_prompt\": true,\n \"output\": \"app\",\n \"schedule\": \"\",\n \"notify\": \"{}\",\n \"continuous_update\": false,\n \"static_notebook\": false,\n \"show_sidebar\": true,\n \"full_screen\": true,\n \"allow_download\": true,\n \"model_id\": \"mercury-app\",\n \"code_uid\": \"App.0.40.24.2-rand719d1b14\"\n}" }, "metadata": {}, "output_type": "display_data" @@ -76,7 +76,7 @@ " description=\"Try the Validation mode for the Scheduler\",\n", " show_code=False,\n", " show_prompt=True,\n", - " continuous_update=True,\n", + " continuous_update=False,\n", " static_notebook=False,\n", " show_sidebar=True,\n", " full_screen=True,\n", @@ -85,35 +85,49 @@ }, { "cell_type": "code", - "execution_count": 70, + "execution_count": 87, "metadata": { "ExecuteTime": { - "end_time": "2023-08-07T17:15:43.996448Z", - "start_time": "2023-08-07T17:15:43.960121Z" + "end_time": "2023-08-07T17:55:24.986026Z", + "start_time": "2023-08-07T17:55:24.950940Z" } }, "outputs": [ { "data": { - "application/mercury+json": "{\n \"widget\": \"OutputDir\",\n \"model_id\": \"output-dir\",\n \"code_uid\": \"OutputDir.0.40.18.1-randaf5d2021\"\n}", + "application/mercury+json": "{\n \"widget\": \"OutputDir\",\n \"model_id\": \"output-dir\",\n \"code_uid\": \"OutputDir.0.40.18.1-randfbfac300\"\n}", "text/html": "

Output Directory

This output won't appear in the web app.", "text/plain": "mercury.OutputDir" }, "metadata": {}, "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Output directory path: .\n" + ] } ], "source": [ - "out_dir = mr.OutputDir()" + "out_dir = mr.OutputDir()\n", + "print(f\"Output directory path: {out_dir.path}\")\n", + "def save_plans(dump_plans, s, e):\n", + " with open(os.path.join(out_dir.path,f'plans_{s}_to_{e}.pickle'), 'wb') as f:\n", + " pickle.dump(dump_plans,f)\n", + "def save_selection(s, night):\n", + " with open(os.path.join(out_dir.path,f'selection_night{night}.pickle'),'wb') as f:\n", + " pickle.dump(s, f)" ] }, { "cell_type": "code", - "execution_count": 71, + "execution_count": 88, "metadata": { "ExecuteTime": { - "end_time": "2023-08-07T17:15:44.006076Z", - "start_time": "2023-08-07T17:15:44.002867Z" + "end_time": "2023-08-07T17:55:25.005904Z", + "start_time": "2023-08-07T17:55:24.988724Z" } }, "outputs": [], @@ -140,23 +154,19 @@ }, { "cell_type": "code", - "execution_count": 72, + "execution_count": 88, "metadata": { "ExecuteTime": { - "end_time": "2023-08-07T17:15:44.014103Z", - "start_time": "2023-08-07T17:15:44.007558Z" + "end_time": "2023-08-07T17:55:25.006157Z", + "start_time": "2023-08-07T17:55:24.992737Z" } }, "outputs": [], - "source": [ - "def save_plans(dump_plans, s, e):\n", - " with open(os.path.join(out_dir.path,f'plans_{s}_to_{e}.pickle'), 'wb') as f:\n", - " pickle.dump(dump_plans,f)" - ] + "source": [] }, { "cell_type": "code", - "execution_count": 73, + "execution_count": 89, "outputs": [], "source": [ "def save_selection(s, night):\n", @@ -166,8 +176,8 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-07T17:15:44.035021Z", - "start_time": "2023-08-07T17:15:44.017268Z" + "end_time": "2023-08-07T17:55:25.006509Z", + "start_time": "2023-08-07T17:55:24.999719Z" } } }, @@ -180,11 +190,11 @@ }, { "cell_type": "code", - "execution_count": 74, + "execution_count": 90, "metadata": { "ExecuteTime": { - "end_time": "2023-08-07T17:16:03.867535Z", - "start_time": "2023-08-07T17:15:44.040220Z" + "end_time": "2023-08-07T17:55:43.986464Z", + "start_time": "2023-08-07T17:55:25.022334Z" } }, "outputs": [ @@ -193,9 +203,9 @@ "application/vnd.jupyter.widget-view+json": { "version_major": 2, "version_minor": 0, - "model_id": "af01bf9eadeb47d29eee65990f53b6e6" + "model_id": "c35f37005ba5431b9895632e01bf9160" }, - "application/mercury+json": "{\n \"widget\": \"Text\",\n \"value\": \"2018-10-01\",\n \"rows\": 1,\n \"label\": \"Start Date\",\n \"model_id\": \"af01bf9eadeb47d29eee65990f53b6e6\",\n \"code_uid\": \"Text.0.40.15.3.14-randb464e958\",\n \"url_key\": \"\",\n \"disabled\": false,\n \"hidden\": false\n}", + "application/mercury+json": "{\n \"widget\": \"Text\",\n \"value\": \"2018-10-01\",\n \"rows\": 1,\n \"label\": \"Start Date\",\n \"model_id\": \"c35f37005ba5431b9895632e01bf9160\",\n \"code_uid\": \"Text.0.40.15.3.14-randc8158058\",\n \"url_key\": \"\",\n \"disabled\": false,\n \"hidden\": false\n}", "text/plain": "mercury.Text" }, "metadata": {}, @@ -206,9 +216,9 @@ "application/vnd.jupyter.widget-view+json": { "version_major": 2, "version_minor": 0, - "model_id": "2fe1c85c1b3247539a743231633f1d3e" + "model_id": "b038c5b630a540ccbbc0c0d0c42fed0b" }, - "application/mercury+json": "{\n \"widget\": \"Text\",\n \"value\": \"08:00:00\",\n \"rows\": 1,\n \"label\": \"Start Time\",\n \"model_id\": \"2fe1c85c1b3247539a743231633f1d3e\",\n \"code_uid\": \"Text.0.40.15.4.14-rand7a713503\",\n \"url_key\": \"\",\n \"disabled\": false,\n \"hidden\": false\n}", + "application/mercury+json": "{\n \"widget\": \"Text\",\n \"value\": \"08:00:00\",\n \"rows\": 1,\n \"label\": \"Start Time\",\n \"model_id\": \"b038c5b630a540ccbbc0c0d0c42fed0b\",\n \"code_uid\": \"Text.0.40.15.4.14-randaff433d1\",\n \"url_key\": \"\",\n \"disabled\": false,\n \"hidden\": false\n}", "text/plain": "mercury.Text" }, "metadata": {}, @@ -219,9 +229,9 @@ "application/vnd.jupyter.widget-view+json": { "version_major": 2, "version_minor": 0, - "model_id": "35e4b5db3cf74ed298f77d862be49993" + "model_id": "d86fee555b5642899823fa7ec90b0cd9" }, - "application/mercury+json": "{\n \"widget\": \"Text\",\n \"value\": \"2018-10-03\",\n \"rows\": 1,\n \"label\": \"End Date\",\n \"model_id\": \"35e4b5db3cf74ed298f77d862be49993\",\n \"code_uid\": \"Text.0.40.15.5.14-randcdfc58fa\",\n \"url_key\": \"\",\n \"disabled\": false,\n \"hidden\": false\n}", + "application/mercury+json": "{\n \"widget\": \"Text\",\n \"value\": \"2018-10-03\",\n \"rows\": 1,\n \"label\": \"End Date\",\n \"model_id\": \"d86fee555b5642899823fa7ec90b0cd9\",\n \"code_uid\": \"Text.0.40.15.5.14-randb7bc065c\",\n \"url_key\": \"\",\n \"disabled\": false,\n \"hidden\": false\n}", "text/plain": "mercury.Text" }, "metadata": {}, @@ -232,9 +242,9 @@ "application/vnd.jupyter.widget-view+json": { "version_major": 2, "version_minor": 0, - "model_id": "ab58223938754097852d1611f1e7d1a2" + "model_id": "612958ea1f1046298cb27309ea76f586" }, - "application/mercury+json": "{\n \"widget\": \"Text\",\n \"value\": \"08:00:00\",\n \"rows\": 1,\n \"label\": \"End Time\",\n \"model_id\": \"ab58223938754097852d1611f1e7d1a2\",\n \"code_uid\": \"Text.0.40.15.6.14-rand286d929e\",\n \"url_key\": \"\",\n \"disabled\": false,\n \"hidden\": false\n}", + "application/mercury+json": "{\n \"widget\": \"Text\",\n \"value\": \"08:00:00\",\n \"rows\": 1,\n \"label\": \"End Time\",\n \"model_id\": \"612958ea1f1046298cb27309ea76f586\",\n \"code_uid\": \"Text.0.40.15.6.14-randb4df2b3d\",\n \"url_key\": \"\",\n \"disabled\": false,\n \"hidden\": false\n}", "text/plain": "mercury.Text" }, "metadata": {}, @@ -245,9 +255,9 @@ "application/vnd.jupyter.widget-view+json": { "version_major": 2, "version_minor": 0, - "model_id": "c064706ae3a34f89b1810571d037c635" + "model_id": "e3b8682deecf4a37843d1a39606fffbc" }, - "application/mercury+json": "{\n \"widget\": \"MultiSelect\",\n \"value\": [\n \"GS\",\n \"GN\"\n ],\n \"choices\": [\n \"GS\",\n \"GN\"\n ],\n \"label\": \"Sites\",\n \"model_id\": \"c064706ae3a34f89b1810571d037c635\",\n \"code_uid\": \"MultiSelect.0.40.16.10.15-rand5075d06c\",\n \"url_key\": \"\",\n \"disabled\": false,\n \"hidden\": false\n}", + "application/mercury+json": "{\n \"widget\": \"MultiSelect\",\n \"value\": [\n \"GS\",\n \"GN\"\n ],\n \"choices\": [\n \"GS\",\n \"GN\"\n ],\n \"label\": \"Sites\",\n \"model_id\": \"e3b8682deecf4a37843d1a39606fffbc\",\n \"code_uid\": \"MultiSelect.0.40.16.10.15-rand9984bb1a\",\n \"url_key\": \"\",\n \"disabled\": false,\n \"hidden\": false\n}", "text/plain": "mercury.MultiSelect" }, "metadata": {}, @@ -549,14 +559,14 @@ }, { "cell_type": "code", - "execution_count": 74, + "execution_count": 90, "outputs": [], "source": [], "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-07T17:16:03.871968Z", - "start_time": "2023-08-07T17:16:03.761937Z" + "end_time": "2023-08-07T17:55:44.004109Z", + "start_time": "2023-08-07T17:55:43.887229Z" } } }