From c9bd934c05bc20cf6398fec29f4e9dcef0d32cb2 Mon Sep 17 00:00:00 2001 From: Henry Webel Date: Thu, 13 Feb 2025 16:21:09 +0100 Subject: [PATCH 1/8] :art: add vuegen demo to docs #64 --- docs/index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/index.md b/docs/index.md index 4e8f239..50220d8 100644 --- a/docs/index.md +++ b/docs/index.md @@ -2,6 +2,7 @@ + ```{include} ../README.md :start-line: 0 :relative-docs: docs @@ -18,6 +19,7 @@ vuegen_demo :maxdepth: 1 :caption: Building a report +vuegen_basic_case_study vuegen_case_study_earth_microbiome example_report ``` From 23e74d9617ee4717c7b4e2123ff400ed2c34918c Mon Sep 17 00:00:00 2001 From: Henry Webel Date: Fri, 14 Feb 2025 11:07:43 +0100 Subject: [PATCH 2/8] :art: add boolean for colab --- docs/vuegen_basic_case_study.ipynb | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/docs/vuegen_basic_case_study.ipynb b/docs/vuegen_basic_case_study.ipynb index 34cbd81..0412208 100644 --- a/docs/vuegen_basic_case_study.ipynb +++ b/docs/vuegen_basic_case_study.ipynb @@ -54,13 +54,17 @@ "source": [ "### 0.1. Installing libraries and creating global variables for platform and working directory\n", "\n", - "To run this notebook locally, you should create a virtual environment with the required libraries and set the `platform` variable to `local_notebook`. If you are running this notebook on Google Colab, set the `platform` variable to `colab`." + "To run this notebook locally, you should create a virtual environment with the required libraries. If you are running this notebook on Google Colab, everything should be set." ] }, { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "tags": [ + "hide-output" + ] + }, "outputs": [], "source": [ "# Vuegen library \n", @@ -73,7 +77,7 @@ "metadata": {}, "outputs": [], "source": [ - "platform = 'local_notebook' #@param ['colab', 'local_notebook'] {allow-input: true}" + "IN_COLAB = \"COLAB_GPU\" in os.environ" ] }, { @@ -83,11 +87,11 @@ "outputs": [], "source": [ "# Set working directory\n", - "if platform == 'colab':\n", + "if IN_COLAB:\n", " # Clone the repository in Colab\n", " !git clone --depth=1 https://github.com/Multiomics-Analytics-Group/vuegen.git\n", " base_output_dir = \"vuegen/docs/example_data/Basic_example_vuegen_demo_notebook/\"\n", - "elif platform == 'local_notebook':\n", + "else:\n", " # Output directory for local execution\n", " base_output_dir = \"./example_data/Basic_example_vuegen_demo_notebook/\"" ] @@ -99,7 +103,7 @@ "outputs": [], "source": [ "# Optional library to launch a streamlit app from colab\n", - "if platform == 'colab':\n", + "if IN_COLAB:\n", " !npm install localtunnel" ] }, @@ -112,7 +116,7 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -122,7 +126,7 @@ "from vuegen import report_generator\n", "from vuegen.utils import get_logger, load_yaml_config\n", "\n", - "if platform == 'colab':\n", + "if IN_COLAB:\n", " import urllib" ] }, @@ -310,7 +314,7 @@ "outputs": [], "source": [ "# Launch the Streamlit report depneding on the platform\n", - "#if platform == \"local_notebook\":\n", + "#if not IN_COLAB:\n", "# !streamlit run streamlit_report/sections/report_manager.py\n", "#elif platform == \"colab\":\n", "# print(\"Password/Enpoint IP for localtunnel is:\",urllib.request.urlopen('https://ipv4.icanhazip.com').read().decode('utf8').strip(\"\\n\"))\n", From c0d5b9809dca72416d42296fa4aaeacc675d20d4 Mon Sep 17 00:00:00 2001 From: Henry Webel Date: Fri, 14 Feb 2025 11:13:10 +0100 Subject: [PATCH 3/8] :bug: add missing import --- docs/vuegen_basic_case_study.ipynb | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/vuegen_basic_case_study.ipynb b/docs/vuegen_basic_case_study.ipynb index 0412208..b8d5f4c 100644 --- a/docs/vuegen_basic_case_study.ipynb +++ b/docs/vuegen_basic_case_study.ipynb @@ -77,6 +77,7 @@ "metadata": {}, "outputs": [], "source": [ + "import os\n", "IN_COLAB = \"COLAB_GPU\" in os.environ" ] }, From faeede0365cc8a7d006213a1597c69fde0669b66 Mon Sep 17 00:00:00 2001 From: Henry Webel Date: Fri, 14 Feb 2025 13:08:42 +0100 Subject: [PATCH 4/8] :bug: remove old references to platform in commented sections --- docs/vuegen_basic_case_study.ipynb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/vuegen_basic_case_study.ipynb b/docs/vuegen_basic_case_study.ipynb index b8d5f4c..88464b9 100644 --- a/docs/vuegen_basic_case_study.ipynb +++ b/docs/vuegen_basic_case_study.ipynb @@ -172,9 +172,9 @@ "outputs": [], "source": [ "# Launch the Streamlit report depneding on the platform\n", - "# if platform == \"local_notebook\":\n", + "# if not IN_COLAB:\n", "# !streamlit run streamlit_report/sections/report_manager.py\n", - "# elif platform == \"colab\": # https://discuss.streamlit.io/t/how-to-launch-streamlit-app-from-google-colab-notebook/42399\n", + "# else: # https://discuss.streamlit.io/t/how-to-launch-streamlit-app-from-google-colab-notebook/42399\n", "# print(\"Password/Enpoint IP for localtunnel is:\",urllib.request.urlopen('https://ipv4.icanhazip.com').read().decode('utf8').strip(\"\\n\"))\n", "# !streamlit run streamlit_report/sections/report_manager.py --server.address=localhost &>/content/logs.txt &\n", "# !npx localtunnel --port 8501" @@ -317,7 +317,7 @@ "# Launch the Streamlit report depneding on the platform\n", "#if not IN_COLAB:\n", "# !streamlit run streamlit_report/sections/report_manager.py\n", - "#elif platform == \"colab\":\n", + "#else:\n", "# print(\"Password/Enpoint IP for localtunnel is:\",urllib.request.urlopen('https://ipv4.icanhazip.com').read().decode('utf8').strip(\"\\n\"))\n", "# !streamlit run streamlit_report/sections/report_manager.py --server.address=localhost &>/content/logs.txt &\n", "# !npx localtunnel --port 8501" From 630cb9087816cdc565d154ca84961c794ad82ce6 Mon Sep 17 00:00:00 2001 From: Henry Webel Date: Fri, 14 Feb 2025 13:13:46 +0100 Subject: [PATCH 5/8] :art: format for block uncommeting - might be good to have this as a parameter which is per default set to false? (open=False) --- docs/vuegen_basic_case_study.ipynb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/vuegen_basic_case_study.ipynb b/docs/vuegen_basic_case_study.ipynb index 88464b9..1f49693 100644 --- a/docs/vuegen_basic_case_study.ipynb +++ b/docs/vuegen_basic_case_study.ipynb @@ -171,7 +171,7 @@ "metadata": {}, "outputs": [], "source": [ - "# Launch the Streamlit report depneding on the platform\n", + "# # Launch the Streamlit report depneding on the platform\n", "# if not IN_COLAB:\n", "# !streamlit run streamlit_report/sections/report_manager.py\n", "# else: # https://discuss.streamlit.io/t/how-to-launch-streamlit-app-from-google-colab-notebook/42399\n", @@ -314,10 +314,10 @@ "metadata": {}, "outputs": [], "source": [ - "# Launch the Streamlit report depneding on the platform\n", - "#if not IN_COLAB:\n", + "# # Launch the Streamlit report depneding on the platform\n", + "# if not IN_COLAB:\n", "# !streamlit run streamlit_report/sections/report_manager.py\n", - "#else:\n", + "# else: # https://discuss.streamlit.io/t/how-to-launch-streamlit-app-from-google-colab-notebook/42399\n", "# print(\"Password/Enpoint IP for localtunnel is:\",urllib.request.urlopen('https://ipv4.icanhazip.com').read().decode('utf8').strip(\"\\n\"))\n", "# !streamlit run streamlit_report/sections/report_manager.py --server.address=localhost &>/content/logs.txt &\n", "# !npx localtunnel --port 8501" From 0da2d29a60ba821b211ded445d03fad28444b766 Mon Sep 17 00:00:00 2001 From: sayalaruano Date: Fri, 14 Feb 2025 14:00:25 +0100 Subject: [PATCH 6/8] =?UTF-8?q?=F0=9F=8E=A8=20Style(vuegen=5Fcase=5Fstudy?= =?UTF-8?q?=5Fearth=5Fmicrobiome.ipynb):=20Update=20EMP=20example=20notebo?= =?UTF-8?q?ok=20with=20boolean=20for=20colab?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/vuegen_case_study_earth_microbiome.ipynb | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/docs/vuegen_case_study_earth_microbiome.ipynb b/docs/vuegen_case_study_earth_microbiome.ipynb index 5e1f0ea..a72ff1a 100644 --- a/docs/vuegen_case_study_earth_microbiome.ipynb +++ b/docs/vuegen_case_study_earth_microbiome.ipynb @@ -61,7 +61,7 @@ "source": [ "### 0.1. Installing libraries and creating global variables for platform and working directory\n", "\n", - "To run this notebook locally, you should create a virtual environment with the required libraries and set the `platform` variable to `local_notebook`. If you are running this notebook on Google Colab, set the `platform` variable to `colab`." + "To run this notebook locally, you should create a virtual environment with the required libraries. If you are running this notebook on Google Colab, everything should be set." ] }, { @@ -90,7 +90,8 @@ "metadata": {}, "outputs": [], "source": [ - "platform = 'local_notebook' #@param ['colab', 'local_notebook'] {allow-input: true}" + "import os\n", + "IN_COLAB = \"COLAB_GPU\" in os.environ" ] }, { @@ -100,7 +101,7 @@ "outputs": [], "source": [ "# Optional library to launch a streamlit app from colab\n", - "if platform == 'colab':\n", + "if IN_COLAB:\n", " !npm install localtunnel" ] }, @@ -148,7 +149,7 @@ "from vuegen import report_generator\n", "from vuegen.utils import get_logger, load_yaml_config\n", "\n", - "if platform == 'colab':\n", + "if IN_COLAB:\n", " import urllib" ] }, @@ -1388,10 +1389,10 @@ "metadata": {}, "outputs": [], "source": [ - "# Launch the Streamlit report depneding on the platform\n", - "#if platform == \"local_notebook\":\n", + "# # Launch the Streamlit report depneding on the platform\n", + "# if not IN_COLAB:\n", "# !streamlit run streamlit_report/sections/report_manager.py\n", - "#elif platform == \"colab\": # https://discuss.streamlit.io/t/how-to-launch-streamlit-app-from-google-colab-notebook/42399\n", + "# else: # https://discuss.streamlit.io/t/how-to-launch-streamlit-app-from-google-colab-notebook/42399\n", "# print(\"Password/Enpoint IP for localtunnel is:\",urllib.request.urlopen('https://ipv4.icanhazip.com').read().decode('utf8').strip(\"\\n\"))\n", "# !streamlit run streamlit_report/sections/report_manager.py --server.address=localhost &>/content/logs.txt &\n", "# !npx localtunnel --port 8501" @@ -1567,10 +1568,10 @@ "metadata": {}, "outputs": [], "source": [ - "# Launch the Streamlit report depneding on the platform\n", - "#if platform == \"local_notebook\":\n", + "# # Launch the Streamlit report depneding on the platform\n", + "# if not IN_COLAB:\n", "# !streamlit run streamlit_report/sections/report_manager.py\n", - "#elif platform == \"colab\":\n", + "# else: # https://discuss.streamlit.io/t/how-to-launch-streamlit-app-from-google-colab-notebook/42399\n", "# print(\"Password/Enpoint IP for localtunnel is:\",urllib.request.urlopen('https://ipv4.icanhazip.com').read().decode('utf8').strip(\"\\n\"))\n", "# !streamlit run streamlit_report/sections/report_manager.py --server.address=localhost &>/content/logs.txt &\n", "# !npx localtunnel --port 8501" From 5340444963c1ef543a1a4dd4e49632c32c6b3400 Mon Sep 17 00:00:00 2001 From: Henry Webel Date: Fri, 14 Feb 2025 14:34:26 +0100 Subject: [PATCH 7/8] :art: toogle streamlit app running in tutorial (especially for colab) --- docs/vuegen_basic_case_study.ipynb | 70 +++++++++++++------ docs/vuegen_case_study_earth_microbiome.ipynb | 42 ++++++----- 2 files changed, 76 insertions(+), 36 deletions(-) diff --git a/docs/vuegen_basic_case_study.ipynb b/docs/vuegen_basic_case_study.ipynb index 1f49693..d847749 100644 --- a/docs/vuegen_basic_case_study.ipynb +++ b/docs/vuegen_basic_case_study.ipynb @@ -73,7 +73,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": {}, "outputs": [], "source": [ @@ -117,9 +117,21 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "ModuleNotFoundError", + "evalue": "No module named 'vuegen'", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[0;32mIn[2], line 4\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mos\u001b[39;00m\n\u001b[1;32m 3\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01myaml\u001b[39;00m\n\u001b[0;32m----> 4\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mvuegen\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m report_generator\n\u001b[1;32m 5\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mvuegen\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mutils\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m get_logger, load_yaml_config\n\u001b[1;32m 7\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m IN_COLAB:\n", + "\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'vuegen'" + ] + } + ], "source": [ "# Imports\n", "import os\n", @@ -169,15 +181,28 @@ "cell_type": "code", "execution_count": null, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Streamlit report not executed, set run_streamlit to True to run the report\n" + ] + } + ], "source": [ - "# # Launch the Streamlit report depneding on the platform\n", - "# if not IN_COLAB:\n", - "# !streamlit run streamlit_report/sections/report_manager.py\n", - "# else: # https://discuss.streamlit.io/t/how-to-launch-streamlit-app-from-google-colab-notebook/42399\n", - "# print(\"Password/Enpoint IP for localtunnel is:\",urllib.request.urlopen('https://ipv4.icanhazip.com').read().decode('utf8').strip(\"\\n\"))\n", - "# !streamlit run streamlit_report/sections/report_manager.py --server.address=localhost &>/content/logs.txt &\n", - "# !npx localtunnel --port 8501" + "run_streamlit = False\n", + "# run_streamlit = True # uncomment line to run the streamlit report\n", + "# Launch the Streamlit report depneding on the platform\n", + "if not IN_COLAB and run_streamlit:\n", + " !streamlit run streamlit_report/sections/report_manager.py\n", + "elif run_streamlit:\n", + " # see: https://discuss.streamlit.io/t/how-to-launch-streamlit-app-from-google-colab-notebook/42399\n", + " print(\"Password/Enpoint IP for localtunnel is:\",urllib.request.urlopen('https://ipv4.icanhazip.com').read().decode('utf8').strip(\"\\n\"))\n", + " !streamlit run streamlit_report/sections/report_manager.py --server.address=localhost &>/content/logs.txt &\n", + " !npx localtunnel --port 8501 --subdomain vuegen-demo\n", + "else:\n", + " print(\"Streamlit report not executed, set run_streamlit to True to run the report\")" ] }, { @@ -314,13 +339,18 @@ "metadata": {}, "outputs": [], "source": [ - "# # Launch the Streamlit report depneding on the platform\n", - "# if not IN_COLAB:\n", - "# !streamlit run streamlit_report/sections/report_manager.py\n", - "# else: # https://discuss.streamlit.io/t/how-to-launch-streamlit-app-from-google-colab-notebook/42399\n", - "# print(\"Password/Enpoint IP for localtunnel is:\",urllib.request.urlopen('https://ipv4.icanhazip.com').read().decode('utf8').strip(\"\\n\"))\n", - "# !streamlit run streamlit_report/sections/report_manager.py --server.address=localhost &>/content/logs.txt &\n", - "# !npx localtunnel --port 8501" + "run_streamlit = False\n", + "# run_streamlit = True # uncomment line to run the streamlit report\n", + "# Launch the Streamlit report depneding on the platform\n", + "if not IN_COLAB and run_streamlit:\n", + " !streamlit run streamlit_report/sections/report_manager.py\n", + "elif run_streamlit:\n", + " # see: https://discuss.streamlit.io/t/how-to-launch-streamlit-app-from-google-colab-notebook/42399\n", + " print(\"Password/Enpoint IP for localtunnel is:\",urllib.request.urlopen('https://ipv4.icanhazip.com').read().decode('utf8').strip(\"\\n\"))\n", + " !streamlit run streamlit_report/sections/report_manager.py --server.address=localhost &>/content/logs.txt &\n", + " !npx localtunnel --port 8501 --subdomain vuegen-demo\n", + "else:\n", + " print(\"Streamlit report not executed, set run_streamlit to True to run the report\")" ] }, { @@ -344,7 +374,7 @@ ], "metadata": { "kernelspec": { - "display_name": "vuegen-IFxaxej_-py3.12", + "display_name": "vuegen", "language": "python", "name": "python3" }, @@ -358,7 +388,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.6" + "version": "3.9.21" } }, "nbformat": 4, diff --git a/docs/vuegen_case_study_earth_microbiome.ipynb b/docs/vuegen_case_study_earth_microbiome.ipynb index a72ff1a..af532ba 100644 --- a/docs/vuegen_case_study_earth_microbiome.ipynb +++ b/docs/vuegen_case_study_earth_microbiome.ipynb @@ -1389,13 +1389,18 @@ "metadata": {}, "outputs": [], "source": [ - "# # Launch the Streamlit report depneding on the platform\n", - "# if not IN_COLAB:\n", - "# !streamlit run streamlit_report/sections/report_manager.py\n", - "# else: # https://discuss.streamlit.io/t/how-to-launch-streamlit-app-from-google-colab-notebook/42399\n", - "# print(\"Password/Enpoint IP for localtunnel is:\",urllib.request.urlopen('https://ipv4.icanhazip.com').read().decode('utf8').strip(\"\\n\"))\n", - "# !streamlit run streamlit_report/sections/report_manager.py --server.address=localhost &>/content/logs.txt &\n", - "# !npx localtunnel --port 8501" + "run_streamlit = False\n", + "# run_streamlit = True # uncomment line to run the streamlit report\n", + "# Launch the Streamlit report depneding on the platform\n", + "if not IN_COLAB and run_streamlit:\n", + " !streamlit run streamlit_report/sections/report_manager.py\n", + "elif run_streamlit:\n", + " # see: https://discuss.streamlit.io/t/how-to-launch-streamlit-app-from-google-colab-notebook/42399\n", + " print(\"Password/Enpoint IP for localtunnel is:\",urllib.request.urlopen('https://ipv4.icanhazip.com').read().decode('utf8').strip(\"\\n\"))\n", + " !streamlit run streamlit_report/sections/report_manager.py --server.address=localhost &>/content/logs.txt &\n", + " !npx localtunnel --port 8501 --subdomain vuegen-demo\n", + "else:\n", + " print(\"Streamlit report not executed, set run_streamlit to True to run the report\")" ] }, { @@ -1568,13 +1573,18 @@ "metadata": {}, "outputs": [], "source": [ - "# # Launch the Streamlit report depneding on the platform\n", - "# if not IN_COLAB:\n", - "# !streamlit run streamlit_report/sections/report_manager.py\n", - "# else: # https://discuss.streamlit.io/t/how-to-launch-streamlit-app-from-google-colab-notebook/42399\n", - "# print(\"Password/Enpoint IP for localtunnel is:\",urllib.request.urlopen('https://ipv4.icanhazip.com').read().decode('utf8').strip(\"\\n\"))\n", - "# !streamlit run streamlit_report/sections/report_manager.py --server.address=localhost &>/content/logs.txt &\n", - "# !npx localtunnel --port 8501" + "run_streamlit = False\n", + "# run_streamlit = True # uncomment line to run the streamlit report\n", + "# Launch the Streamlit report depneding on the platform\n", + "if not IN_COLAB and run_streamlit:\n", + " !streamlit run streamlit_report/sections/report_manager.py\n", + "elif run_streamlit:\n", + " # see: https://discuss.streamlit.io/t/how-to-launch-streamlit-app-from-google-colab-notebook/42399\n", + " print(\"Password/Enpoint IP for localtunnel is:\",urllib.request.urlopen('https://ipv4.icanhazip.com').read().decode('utf8').strip(\"\\n\"))\n", + " !streamlit run streamlit_report/sections/report_manager.py --server.address=localhost &>/content/logs.txt &\n", + " !npx localtunnel --port 8501 --subdomain vuegen-demo\n", + "else:\n", + " print(\"Streamlit report not executed, set run_streamlit to True to run the report\")" ] }, { @@ -1598,7 +1608,7 @@ ], "metadata": { "kernelspec": { - "display_name": "vuegen-IFxaxej_-py3.12", + "display_name": "vuegen", "language": "python", "name": "python3" }, @@ -1612,7 +1622,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.6" + "version": "3.9.21" } }, "nbformat": 4, From fa9954abf4b5b97b6cd2931899e8a83414c507db Mon Sep 17 00:00:00 2001 From: sayalaruano Date: Fri, 14 Feb 2025 15:08:10 +0100 Subject: [PATCH 8/8] =?UTF-8?q?=F0=9F=93=9D=20Docs:=20Add=20instructions?= =?UTF-8?q?=20to=20launch=20the=20streamlit=20app=20from=20colab=20on=20th?= =?UTF-8?q?e=20two=20demo=20notebooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/vuegen_basic_case_study.ipynb | 28 ++++++++----------- docs/vuegen_case_study_earth_microbiome.ipynb | 12 ++++++-- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/docs/vuegen_basic_case_study.ipynb b/docs/vuegen_basic_case_study.ipynb index d847749..1268256 100644 --- a/docs/vuegen_basic_case_study.ipynb +++ b/docs/vuegen_basic_case_study.ipynb @@ -117,21 +117,9 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "ename": "ModuleNotFoundError", - "evalue": "No module named 'vuegen'", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)", - "Cell \u001b[0;32mIn[2], line 4\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mos\u001b[39;00m\n\u001b[1;32m 3\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01myaml\u001b[39;00m\n\u001b[0;32m----> 4\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mvuegen\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m report_generator\n\u001b[1;32m 5\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mvuegen\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mutils\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m get_logger, load_yaml_config\n\u001b[1;32m 7\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m IN_COLAB:\n", - "\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'vuegen'" - ] - } - ], + "outputs": [], "source": [ "# Imports\n", "import os\n", @@ -163,7 +151,9 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### 1.1. Streamlit report" + "### 1.1. Streamlit report\n", + "\n", + "To launch the Streamlit web application from Colab, open the generated URL and copy the localtunnel entry point IP into the corresponding field on the opened page. Once submited, you will be redirected to your Streamlit web application." ] }, { @@ -199,7 +189,9 @@ "elif run_streamlit:\n", " # see: https://discuss.streamlit.io/t/how-to-launch-streamlit-app-from-google-colab-notebook/42399\n", " print(\"Password/Enpoint IP for localtunnel is:\",urllib.request.urlopen('https://ipv4.icanhazip.com').read().decode('utf8').strip(\"\\n\"))\n", + " # Run the Streamlit app in the background\n", " !streamlit run streamlit_report/sections/report_manager.py --server.address=localhost &>/content/logs.txt &\n", + " # Expose the Streamlit app on port 8501\n", " !npx localtunnel --port 8501 --subdomain vuegen-demo\n", "else:\n", " print(\"Streamlit report not executed, set run_streamlit to True to run the report\")" @@ -319,7 +311,9 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### 2.5. Stremlit report with the extended configuration file" + "### 2.5. Stremlit report with the extended configuration file\n", + "\n", + "To launch the Streamlit web application from Colab, open the generated URL and copy the localtunnel entry point IP into the corresponding field on the opened page. Once submited, you will be redirected to your Streamlit web application." ] }, { @@ -347,7 +341,9 @@ "elif run_streamlit:\n", " # see: https://discuss.streamlit.io/t/how-to-launch-streamlit-app-from-google-colab-notebook/42399\n", " print(\"Password/Enpoint IP for localtunnel is:\",urllib.request.urlopen('https://ipv4.icanhazip.com').read().decode('utf8').strip(\"\\n\"))\n", + " # Run the Streamlit app in the background\n", " !streamlit run streamlit_report/sections/report_manager.py --server.address=localhost &>/content/logs.txt &\n", + " # Expose the Streamlit app on port 8501\n", " !npx localtunnel --port 8501 --subdomain vuegen-demo\n", "else:\n", " print(\"Streamlit report not executed, set run_streamlit to True to run the report\")" diff --git a/docs/vuegen_case_study_earth_microbiome.ipynb b/docs/vuegen_case_study_earth_microbiome.ipynb index af532ba..1dff5eb 100644 --- a/docs/vuegen_case_study_earth_microbiome.ipynb +++ b/docs/vuegen_case_study_earth_microbiome.ipynb @@ -1369,7 +1369,9 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### 4.1. Streamlit report" + "### 4.1. Streamlit report\n", + "\n", + "To launch the Streamlit web application from Colab, open the generated URL and copy the localtunnel entry point IP into the corresponding field on the opened page. Once submited, you will be redirected to your Streamlit web application." ] }, { @@ -1397,7 +1399,9 @@ "elif run_streamlit:\n", " # see: https://discuss.streamlit.io/t/how-to-launch-streamlit-app-from-google-colab-notebook/42399\n", " print(\"Password/Enpoint IP for localtunnel is:\",urllib.request.urlopen('https://ipv4.icanhazip.com').read().decode('utf8').strip(\"\\n\"))\n", + " # Run the Streamlit app in the background\n", " !streamlit run streamlit_report/sections/report_manager.py --server.address=localhost &>/content/logs.txt &\n", + " # Expose the Streamlit app on port 8501\n", " !npx localtunnel --port 8501 --subdomain vuegen-demo\n", "else:\n", " print(\"Streamlit report not executed, set run_streamlit to True to run the report\")" @@ -1553,7 +1557,9 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### 5.5. Stremlit report with the extended configuration file" + "### 5.5. Stremlit report with the extended configuration file\n", + "\n", + "To launch the Streamlit web application from Colab, open the generated URL and copy the localtunnel entry point IP into the corresponding field on the opened page. Once submited, you will be redirected to your Streamlit web application." ] }, { @@ -1581,7 +1587,9 @@ "elif run_streamlit:\n", " # see: https://discuss.streamlit.io/t/how-to-launch-streamlit-app-from-google-colab-notebook/42399\n", " print(\"Password/Enpoint IP for localtunnel is:\",urllib.request.urlopen('https://ipv4.icanhazip.com').read().decode('utf8').strip(\"\\n\"))\n", + " # Run the Streamlit app in the background\n", " !streamlit run streamlit_report/sections/report_manager.py --server.address=localhost &>/content/logs.txt &\n", + " # Expose the Streamlit app on port 8501\n", " !npx localtunnel --port 8501 --subdomain vuegen-demo\n", "else:\n", " print(\"Streamlit report not executed, set run_streamlit to True to run the report\")"