|
21 | 21 | }, |
22 | 22 | { |
23 | 23 | "cell_type": "code", |
24 | | - "execution_count": 1, |
| 24 | + "execution_count": null, |
25 | 25 | "metadata": {}, |
26 | 26 | "outputs": [], |
27 | 27 | "source": [ |
28 | | - "import sys\n", |
29 | | - "import os \n", |
30 | | - "# Get the absolute path to the root directory\n", |
31 | | - "working_dir = os.getcwd()\n", |
32 | | - "project_root = os.path.abspath(os.path.join(working_dir, '..'))\n", |
33 | | - "\n", |
34 | | - "# Check if the current directory is \"docs\" and change to project_root if true\n", |
35 | | - "if os.path.basename(working_dir) == 'docs':\n", |
36 | | - " os.chdir(project_root)\n", |
37 | | - "\n", |
38 | | - "# Add vuegen to the Python path\n", |
39 | | - "sys.path.append(os.path.join(project_root, 'vuegen'))\n", |
40 | | - "\n", |
41 | | - "import report_generator\n", |
42 | | - "from utils import get_logger, load_yaml_config" |
| 28 | + "from vuegen import report_generator\n", |
| 29 | + "from vuegen.utils import get_logger, load_yaml_config" |
43 | 30 | ] |
44 | 31 | }, |
45 | 32 | { |
|
60 | 47 | }, |
61 | 48 | { |
62 | 49 | "cell_type": "code", |
63 | | - "execution_count": 4, |
| 50 | + "execution_count": null, |
64 | 51 | "metadata": {}, |
65 | | - "outputs": [ |
66 | | - { |
67 | | - "name": "stdout", |
68 | | - "output_type": "stream", |
69 | | - "text": [ |
70 | | - "[2024-12-02 12:18:51,947] root: INFO - Path to log file: logs/2024122_121851_html_report_None.log\n", |
71 | | - "[2024-12-02 12:18:51,948] root: INFO - Report 'MicW2Graph' initialized with 3 sections.\n", |
72 | | - "[2024-12-02 12:18:51,948] root: DEBUG - Generating 'html' report in directory: 'quarto_report'\n", |
73 | | - "[2024-12-02 12:18:51,949] root: DEBUG - Output directory already existed: 'quarto_report'\n", |
74 | | - "[2024-12-02 12:18:51,949] root: INFO - Output directory for static content already existed: 'quarto_report/static'\n", |
75 | | - "[2024-12-02 12:18:51,950] root: INFO - Starting to generate sections for the report.\n", |
76 | | - "[2024-12-02 12:18:51,950] root: DEBUG - Processing section: 'Exploratory Data Analysis' - 3 subsection(s)\n", |
77 | | - "[2024-12-02 12:18:51,951] root: DEBUG - Processing subsection: 'Abundance data' - 4 component(s)\n", |
78 | | - "[2024-12-02 12:18:51,951] root: INFO - Successfully generated content for plot: 'Top 5 species by biome (plotly)'\n", |
79 | | - "[2024-12-02 12:18:51,952] root: INFO - Successfully generated content for plot: 'Multiline plot (altair)'\n", |
80 | | - "[2024-12-02 12:18:51,952] root: INFO - Successfully generated content for DataFrame: 'Abundance data for all studies (csv)'\n", |
81 | | - "[2024-12-02 12:18:51,953] root: INFO - Successfully generated content for DataFrame: 'Abundance data for all studies (excel)'\n", |
82 | | - "[2024-12-02 12:18:51,953] root: INFO - Generated content and imports for subsection: 'Abundance data'\n", |
83 | | - "[2024-12-02 12:18:51,954] root: DEBUG - Processing subsection: 'Sample data' - 4 component(s)\n", |
84 | | - "[2024-12-02 12:18:51,955] root: INFO - Successfully generated content for plot: 'Number of samples per study (png)'\n", |
85 | | - "[2024-12-02 12:18:51,955] root: INFO - Successfully generated content for plot: 'Sampling countries for all studies (plotly)'\n", |
86 | | - "[2024-12-02 12:18:51,955] root: INFO - Successfully generated content for DataFrame: 'Sample data for all studies (txt)'\n", |
87 | | - "[2024-12-02 12:18:51,956] root: INFO - Successfully generated content for DataFrame: 'Sample data for all studies (parquet)'\n", |
88 | | - "[2024-12-02 12:18:51,956] root: INFO - Generated content and imports for subsection: 'Sample data'\n", |
89 | | - "[2024-12-02 12:18:51,957] root: DEBUG - Processing subsection: 'Extra information' - 1 component(s)\n", |
90 | | - "[2024-12-02 12:18:51,958] root: INFO - Successfully generated content for Markdown: 'Markdown example'\n", |
91 | | - "[2024-12-02 12:18:51,959] root: INFO - Generated content and imports for subsection: 'Extra information'\n", |
92 | | - "[2024-12-02 12:18:51,959] root: DEBUG - Processing section: 'Microbial Association Networks' - 3 subsection(s)\n", |
93 | | - "[2024-12-02 12:18:51,960] root: DEBUG - Processing subsection: 'Network Visualization1' - 1 component(s)\n", |
94 | | - "[2024-12-02 12:18:51,963] root: INFO - Successfully read network from file: example_data/MicW2Graph/man_example.graphml.\n", |
95 | | - "[2024-12-02 12:18:51,979] root: INFO - PyVis network created and saved as: quarto_report/static/Network1_(graphml).html.\n", |
96 | | - "[2024-12-02 12:18:51,980] root: INFO - Successfully generated content for plot: 'Network1 (graphml)'\n", |
97 | | - "[2024-12-02 12:18:51,980] root: INFO - Generated content and imports for subsection: 'Network Visualization1'\n", |
98 | | - "[2024-12-02 12:18:51,980] root: DEBUG - Processing subsection: 'Network Visualization2' - 1 component(s)\n", |
99 | | - "[2024-12-02 12:18:51,983] root: INFO - Successfully read network from file: example_data/MicW2Graph/man_example.csv.\n", |
100 | | - "[2024-12-02 12:18:51,994] root: INFO - PyVis network created and saved as: quarto_report/static/Network2_(edge_list_csv).html.\n", |
101 | | - "[2024-12-02 12:18:51,994] root: INFO - Successfully generated content for plot: 'Network2 (edge list csv)'\n", |
102 | | - "[2024-12-02 12:18:51,994] root: INFO - Generated content and imports for subsection: 'Network Visualization2'\n", |
103 | | - "[2024-12-02 12:18:51,995] root: DEBUG - Processing subsection: 'Edge list' - 1 component(s)\n", |
104 | | - "[2024-12-02 12:18:51,995] root: INFO - Successfully generated content for DataFrame: 'Edge list (csv)'\n", |
105 | | - "[2024-12-02 12:18:51,995] root: INFO - Generated content and imports for subsection: 'Edge list'\n", |
106 | | - "[2024-12-02 12:18:51,995] root: DEBUG - Processing section: 'APICall test' - 1 subsection(s)\n", |
107 | | - "[2024-12-02 12:18:51,996] root: DEBUG - Processing subsection: 'Simple test' - 1 component(s)\n", |
108 | | - "[2024-12-02 12:18:51,996] root: WARNING - Unsupported component type 'apicall' in subsection: Simple test\n", |
109 | | - "[2024-12-02 12:18:51,996] root: INFO - Generated content and imports for subsection: 'Simple test'\n", |
110 | | - "[2024-12-02 12:18:51,997] root: INFO - Created qmd script to render the app: quarto_report.qmd\n" |
111 | | - ] |
112 | | - }, |
113 | | - { |
114 | | - "name": "stderr", |
115 | | - "output_type": "stream", |
116 | | - "text": [ |
117 | | - "\n", |
118 | | - "Starting python3 kernel...Done\n", |
119 | | - "\n", |
120 | | - "Executing 'quarto_report.quarto_ipynb'\n", |
121 | | - " Cell 1/10: 'Imports'.......................................Done\n", |
122 | | - " Cell 2/10: 'Top 5 species by biome (plotly)'...............Done\n", |
123 | | - " Cell 3/10: 'Multiline plot (altair)'.......................Done\n", |
124 | | - " Cell 4/10: 'Abundance data for all studies (csv)'..........Done\n", |
125 | | - " Cell 5/10: 'Abundance data for all studies (excel)'........Done\n", |
126 | | - " Cell 6/10: 'Sampling countries for all studies (plotly)'...Done\n", |
127 | | - " Cell 7/10: 'Sample data for all studies (txt)'.............Done\n", |
128 | | - " Cell 8/10: 'Sample data for all studies (parquet)'.........Done\n", |
129 | | - " Cell 9/10: 'Markdown example'..............................Done\n", |
130 | | - " Cell 10/10: 'Edge list (csv)'...............................Done\n", |
131 | | - "\n", |
132 | | - "\u001b[1mpandoc \u001b[22m\n", |
133 | | - " to: html\n", |
134 | | - " output-file: quarto_report.html\n", |
135 | | - " standalone: true\n", |
136 | | - " self-contained: true\n", |
137 | | - " section-divs: true\n", |
138 | | - " html-math-method: mathjax\n", |
139 | | - " wrap: none\n", |
140 | | - " default-image-extension: png\n", |
141 | | - " toc: true\n", |
142 | | - " toc-depth: 3\n", |
143 | | - " \n", |
144 | | - "\u001b[1mmetadata\u001b[22m\n", |
145 | | - " document-css: false\n", |
146 | | - " link-citations: true\n", |
147 | | - " date-format: long\n", |
148 | | - " lang: en\n", |
149 | | - " title: MicW2Graph\n", |
150 | | - " toc-location: left\n", |
151 | | - " page-layout: full\n", |
152 | | - " \n", |
153 | | - "\u001b[33mWARNING (/Applications/quarto/share/filters/main.lua:9305) Unable to parse table from raw html block: skipping.\n", |
154 | | - "\u001b[39m\u001b[33mWARNING (/Applications/quarto/share/filters/main.lua:9305) Unable to parse table from raw html block: skipping.\n", |
155 | | - "\u001b[39m\u001b[33mWARNING (/Applications/quarto/share/filters/main.lua:9305) Unable to parse table from raw html block: skipping.\n", |
156 | | - "\u001b[39m\u001b[33mWARNING (/Applications/quarto/share/filters/main.lua:9305) Unable to parse table from raw html block: skipping.\n", |
157 | | - "\u001b[39m\u001b[33mWARNING (/Applications/quarto/share/filters/main.lua:9305) Unable to parse table from raw html block: skipping.\n", |
158 | | - "\u001b[39m" |
159 | | - ] |
160 | | - }, |
161 | | - { |
162 | | - "name": "stdout", |
163 | | - "output_type": "stream", |
164 | | - "text": [ |
165 | | - "[2024-12-02 12:19:01,988] root: INFO - 'MicW2Graph' 'html' report rendered\n" |
166 | | - ] |
167 | | - }, |
168 | | - { |
169 | | - "name": "stderr", |
170 | | - "output_type": "stream", |
171 | | - "text": [ |
172 | | - "Output created: quarto_report.html\n", |
173 | | - "\n" |
174 | | - ] |
175 | | - } |
176 | | - ], |
| 52 | + "outputs": [], |
177 | 53 | "source": [ |
178 | 54 | "# Load the YAML configuration file with the report metadata\n", |
179 | | - "config_path = \"report_config_micw2graph.yaml\"\n", |
| 55 | + "config_path = \"../example_data/MicW2Graph/report_config_micw2graph.yaml\"\n", |
180 | 56 | "report_config = load_yaml_config(config_path)\n", |
181 | 57 | "\n", |
182 | 58 | "# Define logger suffix based on report engine, type and name\n", |
|
187 | 63 | "logger = get_logger(f\"{report_type}_report_{report_name}\")\n", |
188 | 64 | "\n", |
189 | 65 | "# Generate the report\n", |
190 | | - "report_generator.get_report(config = report_config, report_type = report_type, logger = logger)" |
| 66 | + "# report_generator.get_report(config = report_config, report_type = report_type, logger = logger)" |
191 | 67 | ] |
192 | 68 | } |
193 | 69 | ], |
194 | 70 | "metadata": { |
195 | 71 | "kernelspec": { |
196 | | - "display_name": "report-generator-IFxaxej_-py3.12", |
| 72 | + "display_name": "vuegen", |
197 | 73 | "language": "python", |
198 | 74 | "name": "python3" |
199 | 75 | }, |
|
207 | 83 | "name": "python", |
208 | 84 | "nbconvert_exporter": "python", |
209 | 85 | "pygments_lexer": "ipython3", |
210 | | - "version": "3.12.6" |
| 86 | + "version": "3.9.21" |
211 | 87 | } |
212 | 88 | }, |
213 | 89 | "nbformat": 4, |
|
0 commit comments