Skip to content

Commit e88a93b

Browse files
committed
🎨 format docs as they were adapted
- api changes needed to be reflected in docs. - format docs - enforce using action
1 parent da8bc30 commit e88a93b

File tree

3 files changed

+500
-305
lines changed

3 files changed

+500
-305
lines changed

.github/workflows/cdci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ jobs:
1818
steps:
1919
- uses: actions/checkout@v4
2020
- uses: psf/black@stable
21+
with:
22+
jupyter: true
2123
- uses: isort/isort-action@v1
2224
- name: Set up Python ${{ matrix.python-version }}
2325
uses: actions/setup-python@v5

docs/vuegen_basic_case_study.ipynb

Lines changed: 51 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
},
6868
"outputs": [],
6969
"source": [
70-
"# Vuegen library \n",
70+
"# Vuegen library\n",
7171
"%pip install vuegen"
7272
]
7373
},
@@ -78,6 +78,7 @@
7878
"outputs": [],
7979
"source": [
8080
"import os\n",
81+
"\n",
8182
"IN_COLAB = \"COLAB_GPU\" in os.environ"
8283
]
8384
},
@@ -181,14 +182,20 @@
181182
"# run_streamlit = True # uncomment line to run the streamlit report\n",
182183
"# Launch the Streamlit report depneding on the platform\n",
183184
"if not IN_COLAB and run_streamlit:\n",
184-
" !streamlit run streamlit_report/sections/report_manager.py\n",
185+
" !streamlit run streamlit_report/sections/report_manager.py\n",
185186
"elif run_streamlit:\n",
186-
" # see: https://discuss.streamlit.io/t/how-to-launch-streamlit-app-from-google-colab-notebook/42399\n",
187-
" print(\"Password/Enpoint IP for localtunnel is:\",urllib.request.urlopen('https://ipv4.icanhazip.com').read().decode('utf8').strip(\"\\n\"))\n",
188-
" # Run the Streamlit app in the background\n",
189-
" !streamlit run streamlit_report/sections/report_manager.py --server.address=localhost &>/content/logs.txt &\n",
190-
" # Expose the Streamlit app on port 8501\n",
191-
" !npx localtunnel --port 8501 --subdomain vuegen-demo\n",
187+
" # see: https://discuss.streamlit.io/t/how-to-launch-streamlit-app-from-google-colab-notebook/42399\n",
188+
" print(\n",
189+
" \"Password/Enpoint IP for localtunnel is:\",\n",
190+
" urllib.request.urlopen(\"https://ipv4.icanhazip.com\")\n",
191+
" .read()\n",
192+
" .decode(\"utf8\")\n",
193+
" .strip(\"\\n\"),\n",
194+
" )\n",
195+
" # Run the Streamlit app in the background\n",
196+
" !streamlit run streamlit_report/sections/report_manager.py --server.address=localhost &>/content/logs.txt &\n",
197+
" # Expose the Streamlit app on port 8501\n",
198+
" !npx localtunnel --port 8501 --subdomain vuegen-demo\n",
192199
"else:\n",
193200
" print(\"Streamlit report not executed, set run_streamlit to True to run the report\")"
194201
]
@@ -208,7 +215,9 @@
208215
"source": [
209216
"# Generate the report\n",
210217
"report_type = \"html\"\n",
211-
"report_dir, config_path = report_generator.get_report(dir_path = base_output_dir, report_type = report_type, logger = None)\n",
218+
"report_dir, config_path = report_generator.get_report(\n",
219+
" dir_path=base_output_dir, report_type=report_type, logger=None\n",
220+
")\n",
212221
"print(f\"Report generated at: {report_dir}\")"
213222
]
214223
},
@@ -236,11 +245,15 @@
236245
"vuegen_logo_path = \"https://raw.githubusercontent.com/Multiomics-Analytics-Group/vuegen/main/docs/images/vuegen_logo.svg\"\n",
237246
"\n",
238247
"# Load the YAML file\n",
239-
"print(f\"Loading the YAML config file from: {config_path}\") # generated based on directory path above\n",
248+
"print(\n",
249+
" f\"Loading the YAML config file from: {config_path}\"\n",
250+
") # generated based on directory path above\n",
240251
"config = load_yaml_config(config_path)\n",
241252
"\n",
242253
"# Update the logo and graphical abstract with the URL\n",
243-
"config[\"report\"].update({\"logo\": vuegen_logo_path, \"graphical_abstract\": vuegen_logo_path})"
254+
"config[\"report\"].update(\n",
255+
" {\"logo\": vuegen_logo_path, \"graphical_abstract\": vuegen_logo_path}\n",
256+
")"
244257
]
245258
},
246259
{
@@ -258,15 +271,17 @@
258271
"source": [
259272
"# Update the description for the EDA section\n",
260273
"for section in config[\"sections\"]:\n",
261-
" if section[\"title\"] == \"Plots\": \n",
274+
" if section[\"title\"] == \"Plots\":\n",
262275
" section[\"description\"] = \"This section contains example plots\"\n",
263276
"\n",
264277
"# Update the description for the alpha diversity subsection from the Metagenomics section\n",
265278
"for section in config[\"sections\"]:\n",
266279
" if section[\"title\"] == \"Dataframes\":\n",
267280
" for subsection in section[\"subsections\"]:\n",
268281
" if subsection[\"title\"] == \"All Formats\":\n",
269-
" subsection[\"description\"] = \"This subsection contains example dataframes.\"\n"
282+
" subsection[\"description\"] = (\n",
283+
" \"This subsection contains example dataframes.\"\n",
284+
" )"
270285
]
271286
},
272287
{
@@ -285,11 +300,11 @@
285300
"# Define new plot with a URL as the file path\n",
286301
"vuegen_abst_fig = {\n",
287302
" \"title\": \"Graphical overview of VueGen’s workflow and components\",\n",
288-
" \"file_path\": \"https://raw.githubusercontent.com/Multiomics-Analytics-Group/vuegen/main/docs/images/vuegen_graph_abstract.png\", \n",
303+
" \"file_path\": \"https://raw.githubusercontent.com/Multiomics-Analytics-Group/vuegen/main/docs/images/vuegen_graph_abstract.png\",\n",
289304
" \"description\": \"\",\n",
290305
" \"caption\": \"The diagram illustrates the processing pipeline of VueGen, starting from either a directory or a YAML configuration file. Reports consist of hierarchical sections and subsections, each containing various components such as plots, dataframes, Markdown, HTML, and data retrieved via API calls.\",\n",
291306
" \"component_type\": \"plot\",\n",
292-
" \"plot_type\": \"static\"\n",
307+
" \"plot_type\": \"static\",\n",
293308
"}\n",
294309
"\n",
295310
"# Add the plot to the Sample Provenance subsection in the EDA section\n",
@@ -321,7 +336,9 @@
321336
"source": [
322337
"# Test the changes by generarating the report from the modified YAML file\n",
323338
"report_type = \"streamlit\"\n",
324-
"_ = report_generator.get_report(config_path = config_path, report_type = report_type, logger = None)"
339+
"_ = report_generator.get_report(\n",
340+
" config_path=config_path, report_type=report_type, logger=None\n",
341+
")"
325342
]
326343
},
327344
{
@@ -334,14 +351,20 @@
334351
"# run_streamlit = True # uncomment line to run the streamlit report\n",
335352
"# Launch the Streamlit report depneding on the platform\n",
336353
"if not IN_COLAB and run_streamlit:\n",
337-
" !streamlit run streamlit_report/sections/report_manager.py\n",
354+
" !streamlit run streamlit_report/sections/report_manager.py\n",
338355
"elif run_streamlit:\n",
339-
" # see: https://discuss.streamlit.io/t/how-to-launch-streamlit-app-from-google-colab-notebook/42399\n",
340-
" print(\"Password/Enpoint IP for localtunnel is:\",urllib.request.urlopen('https://ipv4.icanhazip.com').read().decode('utf8').strip(\"\\n\"))\n",
341-
" # Run the Streamlit app in the background\n",
342-
" !streamlit run streamlit_report/sections/report_manager.py --server.address=localhost &>/content/logs.txt &\n",
343-
" # Expose the Streamlit app on port 8501\n",
344-
" !npx localtunnel --port 8501 --subdomain vuegen-demo\n",
356+
" # see: https://discuss.streamlit.io/t/how-to-launch-streamlit-app-from-google-colab-notebook/42399\n",
357+
" print(\n",
358+
" \"Password/Enpoint IP for localtunnel is:\",\n",
359+
" urllib.request.urlopen(\"https://ipv4.icanhazip.com\")\n",
360+
" .read()\n",
361+
" .decode(\"utf8\")\n",
362+
" .strip(\"\\n\"),\n",
363+
" )\n",
364+
" # Run the Streamlit app in the background\n",
365+
" !streamlit run streamlit_report/sections/report_manager.py --server.address=localhost &>/content/logs.txt &\n",
366+
" # Expose the Streamlit app on port 8501\n",
367+
" !npx localtunnel --port 8501 --subdomain vuegen-demo\n",
345368
"else:\n",
346369
" print(\"Streamlit report not executed, set run_streamlit to True to run the report\")"
347370
]
@@ -361,13 +384,15 @@
361384
"source": [
362385
"# Test the changes by generarating the report from the modified YAML file\n",
363386
"report_type = \"html\"\n",
364-
"_ = report_generator.get_report(config_path = config_path, report_type = report_type, logger = None)"
387+
"_ = report_generator.get_report(\n",
388+
" config_path=config_path, report_type=report_type, logger=None\n",
389+
")"
365390
]
366391
}
367392
],
368393
"metadata": {
369394
"kernelspec": {
370-
"display_name": "vuegen",
395+
"display_name": "vuegen_py312",
371396
"language": "python",
372397
"name": "python3"
373398
},
@@ -381,7 +406,7 @@
381406
"name": "python",
382407
"nbconvert_exporter": "python",
383408
"pygments_lexer": "ipython3",
384-
"version": "3.9.21"
409+
"version": "3.12.9"
385410
}
386411
},
387412
"nbformat": 4,

0 commit comments

Comments
 (0)