Skip to content

Commit 8aa3908

Browse files
authored
Merge branch 'main' into add_base_demo_to_docs
2 parents c9bd934 + 0d8c5f8 commit 8aa3908

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

docs/vuegen_basic_case_study.ipynb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@
157157
"source": [
158158
"# Generate the report\n",
159159
"report_type = \"streamlit\"\n",
160-
"report_generator.get_report(dir_path = base_output_dir, report_type = report_type, logger = get_logger(f\"{report_type}_report_basic_example\"))"
160+
"report_generator.get_report(dir_path = base_output_dir, report_type = report_type, logger = None)"
161161
]
162162
},
163163
{
@@ -190,7 +190,7 @@
190190
"source": [
191191
"# Generate the report\n",
192192
"report_type = \"html\"\n",
193-
"report_generator.get_report(dir_path = base_output_dir, report_type = report_type, logger = get_logger(f\"{report_type}_report_basic_example\"))"
193+
"report_generator.get_report(dir_path = base_output_dir, report_type = report_type, logger = None)"
194194
]
195195
},
196196
{
@@ -246,7 +246,7 @@
246246
"for section in config[\"sections\"]:\n",
247247
" if section[\"title\"] == \"Dataframes\":\n",
248248
" for subsection in section[\"subsections\"]:\n",
249-
" if subsection[\"title\"] == \"All_formats\":\n",
249+
" if subsection[\"title\"] == \"All Formats\":\n",
250250
" subsection[\"description\"] = \"This subsection contains example dataframes.\"\n"
251251
]
252252
},
@@ -277,7 +277,7 @@
277277
"for section in config[\"sections\"]:\n",
278278
" if section[\"title\"] == \"Plots\":\n",
279279
" for subsection in section[\"subsections\"]:\n",
280-
" if subsection[\"title\"] == \"Static_plots\":\n",
280+
" if subsection[\"title\"] == \"Static Plots\":\n",
281281
" subsection[\"components\"].append(vuegen_abst_fig)\n",
282282
"\n",
283283
"# Save the modified YAML file\n",
@@ -300,7 +300,7 @@
300300
"source": [
301301
"# Test the changes by generarating the report from the modified YAML file\n",
302302
"report_type = \"streamlit\"\n",
303-
"report_generator.get_report(config_path = config_path, report_type = report_type, logger = get_logger(f\"{report_type}_report_basic_example_extended\"))"
303+
"report_generator.get_report(config_path = config_path, report_type = report_type, logger = None)"
304304
]
305305
},
306306
{
@@ -333,7 +333,7 @@
333333
"source": [
334334
"# Test the changes by generarating the report from the modified YAML file\n",
335335
"report_type = \"html\"\n",
336-
"report_generator.get_report(config_path = config_path, report_type = report_type, logger = get_logger(f\"{report_type}_report_basic_example_extended\"))"
336+
"report_generator.get_report(config_path = config_path, report_type = report_type, logger = None)"
337337
]
338338
}
339339
],

docs/vuegen_case_study_earth_microbiome.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1379,7 +1379,7 @@
13791379
"source": [
13801380
"# Generate the report\n",
13811381
"report_type = \"streamlit\"\n",
1382-
"report_generator.get_report(dir_path = base_output_dir, report_type = report_type, logger = get_logger(f\"{report_type}_report_EMP_example\"))"
1382+
"report_generator.get_report(dir_path = base_output_dir, report_type = report_type, logger = None)"
13831383
]
13841384
},
13851385
{
@@ -1412,7 +1412,7 @@
14121412
"source": [
14131413
"# Generate the report\n",
14141414
"report_type = \"html\"\n",
1415-
"report_generator.get_report(dir_path = base_output_dir, report_type = report_type, logger = get_logger(f\"{report_type}_report_EMP_example\"))"
1415+
"report_generator.get_report(dir_path = base_output_dir, report_type = report_type, logger = None)"
14161416
]
14171417
},
14181418
{
@@ -1558,7 +1558,7 @@
15581558
"source": [
15591559
"# Test the changes by generarating the report from the modified YAML file\n",
15601560
"report_type = \"streamlit\"\n",
1561-
"report_generator.get_report(config_path = config_path, report_type = report_type, logger = get_logger(f\"{report_type}_report_EMP_example_extended\"))"
1561+
"report_generator.get_report(config_path = config_path, report_type = report_type, logger = None)"
15621562
]
15631563
},
15641564
{
@@ -1591,7 +1591,7 @@
15911591
"source": [
15921592
"# Test the changes by generarating the report from the modified YAML file\n",
15931593
"report_type = \"html\"\n",
1594-
"report_generator.get_report(config_path = config_path, report_type = report_type, logger = get_logger(f\"{report_type}_report_EMP_example_extended\"))"
1594+
"report_generator.get_report(config_path = config_path, report_type = report_type, logger = None)"
15951595
]
15961596
}
15971597
],

src/vuegen/report_generator.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44
from .quarto_reportview import QuartoReportView
55
from .report import ReportType
66
from .streamlit_reportview import StreamlitReportView
7-
from .utils import assert_enum_value, load_yaml_config, write_yaml_config
7+
from .utils import assert_enum_value, load_yaml_config, write_yaml_config, get_logger
88

99

10-
def get_report(report_type: str, logger: logging.Logger, config_path: str = None, dir_path: str = None, streamlit_autorun: bool = False) -> None:
10+
def get_report(report_type: str, logger: logging.Logger = get_logger("report"), config_path: str = None, dir_path: str = None, streamlit_autorun: bool = False) -> None:
1111
"""
1212
Generate and run a report based on the specified engine.
1313
1414
Parameters
1515
----------
1616
report_type : str
1717
The report type. It should be one of the values of the ReportType Enum.
18-
logger : logging.Logger
19-
A logger object to track warnings, errors, and info messages.
18+
logger : logging.Logger, optional
19+
A logger object to track warnings, errors, and info messages. If not provided, a default logger will be created.
2020
config_path : str, optional
2121
Path to the YAML configuration file.
2222
dir_path : str, optional
@@ -29,7 +29,7 @@ def get_report(report_type: str, logger: logging.Logger, config_path: str = None
2929
ValueError
3030
If neither 'config_path' nor 'directory' is provided.
3131
"""
32-
# Initialize the config manager object
32+
# Initialize the config manager object
3333
config_manager = ConfigManager(logger)
3434

3535
if dir_path:

0 commit comments

Comments
 (0)