From 0986060639a2c81abd24500f2939e7b894aad54f Mon Sep 17 00:00:00 2001 From: sayalaruano Date: Fri, 28 Feb 2025 12:11:15 +0100 Subject: [PATCH 1/6] =?UTF-8?q?=F0=9F=8E=A8=20Styile:=20print=20completion?= =?UTF-8?q?=20message=20in=20the=20terminal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/vuegen/__main__.py | 4 +++- src/vuegen/utils.py | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/src/vuegen/__main__.py b/src/vuegen/__main__.py index 5c853d5..493cd26 100644 --- a/src/vuegen/__main__.py +++ b/src/vuegen/__main__.py @@ -2,7 +2,7 @@ from pathlib import Path from vuegen import report_generator -from vuegen.utils import get_logger, get_parser +from vuegen.utils import get_logger, get_parser, print_completion_message def main(): @@ -47,6 +47,8 @@ def main(): streamlit_autorun=streamlit_autorun, ) + # Print completion message + print_completion_message(report_type) if __name__ == "__main__": main() diff --git a/src/vuegen/utils.py b/src/vuegen/utils.py index 6c85396..9d07e0f 100644 --- a/src/vuegen/utils.py +++ b/src/vuegen/utils.py @@ -743,6 +743,45 @@ def get_logger(log_suffix): return logger +def print_completion_message(report_type: str): + """ + Prints a formatted completion message after report generation. + """ + border = "─" * 65 # Creates a separator line + print(f"\n{border}\n🎉 Pipeline Execution Complete! 🎉\n") + + if report_type == "streamlit": + print( + """🚀 Streamlit Report Generated! + +📂 All scripts to build the Streamlit app are available at: + nf_container_results/streamlit_report/sections + +▶️ To run the Streamlit app, use the following command: + streamlit run nf_container_results/streamlit_report/sections/report_manager.py + +✨ You can extend the report by adding new files to the input directory or updating the config file. + +🛠️ Advanced users can modify the Python scripts directly in: + nf_container_results/streamlit_report/sections +""" + ) + else: + print( + f"""🚀 {report_type.capitalize()} Report Generated! + +📂 Your {report_type} report is available at: + nf_container_results/quarto_report + +✨ You can extend the report by adding new files to the input directory or updating the config file. + +🛠️ Advanced users can modify the report template directly in: + nf_container_results/quarto_report/quarto_report.qmd +""" + ) + + print(border) + ## REPORT FORMATTING def generate_footer() -> str: From 28fc74d28576f39bccef5e20ec79e49732a48e19 Mon Sep 17 00:00:00 2001 From: sayalaruano Date: Fri, 28 Feb 2025 12:12:51 +0100 Subject: [PATCH 2/6] =?UTF-8?q?=F0=9F=90=9B=20Fix(report=5Fgenerator.py):?= =?UTF-8?q?=20remove=20logger=20from=20the=20function=20definition=20to=20?= =?UTF-8?q?avoid=20creating=20a=20logger=20when=20there=20is=20not=20a=20r?= =?UTF-8?q?eport?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/vuegen/report_generator.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/vuegen/report_generator.py b/src/vuegen/report_generator.py index db06d10..d5b656c 100644 --- a/src/vuegen/report_generator.py +++ b/src/vuegen/report_generator.py @@ -10,7 +10,7 @@ def get_report( report_type: str, - logger: logging.Logger = get_logger("report"), + logger: logging.Logger = None, config_path: str = None, dir_path: str = None, streamlit_autorun: bool = False, @@ -36,7 +36,11 @@ def get_report( ValueError If neither 'config_path' nor 'directory' is provided. """ - # Initialize the config manager object + # Initialize logger only if it's not provided + if logger is None: + logger = get_logger("report") + + # Create the config manager object config_manager = ConfigManager(logger) if dir_path: From c2df2c9cef3a67a3c44e0a4989cf3df9bb349f52 Mon Sep 17 00:00:00 2001 From: sayalaruano Date: Fri, 28 Feb 2025 12:17:25 +0100 Subject: [PATCH 3/6] =?UTF-8?q?=F0=9F=8E=A8=20Ensure=20black=20format?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/vuegen/utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vuegen/utils.py b/src/vuegen/utils.py index 9d07e0f..e407d34 100644 --- a/src/vuegen/utils.py +++ b/src/vuegen/utils.py @@ -743,6 +743,7 @@ def get_logger(log_suffix): return logger + def print_completion_message(report_type: str): """ Prints a formatted completion message after report generation. From b326d93313d64240326d7e7e0a4cdf0c33feac77 Mon Sep 17 00:00:00 2001 From: sayalaruano Date: Fri, 28 Feb 2025 12:19:37 +0100 Subject: [PATCH 4/6] =?UTF-8?q?=F0=9F=8E=A8=20Black=20formsat=20on=20main?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/vuegen/__main__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vuegen/__main__.py b/src/vuegen/__main__.py index 493cd26..2f2565a 100644 --- a/src/vuegen/__main__.py +++ b/src/vuegen/__main__.py @@ -50,5 +50,6 @@ def main(): # Print completion message print_completion_message(report_type) + if __name__ == "__main__": main() From a06a9e4e837f450881d98976192ad7027ae9ae67 Mon Sep 17 00:00:00 2001 From: sayalaruano Date: Fri, 28 Feb 2025 12:31:14 +0100 Subject: [PATCH 5/6] =?UTF-8?q?=F0=9F=93=9D=20Docs(pyproject.toml):=20upda?= =?UTF-8?q?te=20vuegen=20description?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 0e0a006..17ab807 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,11 @@ name = "vuegen" dynamic = ["version"] [tool.poetry] -description = "Module to generate automatic web interface reports with visualizations" +description = """ +VueGen automates the creation of reports from bioinformatics outputs, supporting formats like PDF, HTML, DOCX, +ODT, PPTX, Reveal.js, Jupyter notebooks, and Streamlit web applications. Users simply provide a directory with +output files—such as plots, tables, networks, Markdown text, and HTML files—and VueGen compiles them into a structured report. +""" authors = ["MoNA group"] license = "MIT" readme = "README.md" From 3bc60bf06ef4903b253b655b5f909c2048b839e2 Mon Sep 17 00:00:00 2001 From: sayalaruano Date: Fri, 28 Feb 2025 12:38:00 +0100 Subject: [PATCH 6/6] =?UTF-8?q?=F0=9F=8E=A8=20Style(pyproject.toml):=20des?= =?UTF-8?q?cription=20in=20a=20single=20line?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 17ab807..0fb8f98 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,11 +3,7 @@ name = "vuegen" dynamic = ["version"] [tool.poetry] -description = """ -VueGen automates the creation of reports from bioinformatics outputs, supporting formats like PDF, HTML, DOCX, -ODT, PPTX, Reveal.js, Jupyter notebooks, and Streamlit web applications. Users simply provide a directory with -output files—such as plots, tables, networks, Markdown text, and HTML files—and VueGen compiles them into a structured report. -""" +description = "VueGen automates the creation of reports from bioinformatics outputs, supporting formats like PDF, HTML, DOCX, ODT, PPTX, Reveal.js, Jupyter notebooks, and Streamlit web applications. Users simply provide a directory with output files and VueGen compiles them into a structured report." authors = ["MoNA group"] license = "MIT" readme = "README.md"