1+ """Main API entry point for generating reports using VueGen."""
2+
13import logging
24import shutil
35import sys
@@ -28,23 +30,25 @@ def get_report(
2830 report_type : str
2931 The report type. It should be one of the values of the ReportType Enum.
3032 logger : logging.Logger, optional
31- A logger object to track warnings, errors, and info messages. If not provided, a default logger will be created.
33+ A logger object to track warnings, errors, and info messages. If not provided,
34+ a default logger will be created.
3235 config_path : str, optional
3336 Path to the YAML configuration file.
3437 dir_path : str, optional
3538 Path to the directory from which to generate the configuration file.
3639 streamlit_autorun : bool, optional
37- Whether to automatically run the Streamlit report after generation (default is False).
38- quarto_checks : bool, optional
39- Whether to perform checks for Quarto report generation for TeX and Chromium installation
40+ Whether to automatically run the Streamlit report after generation
4041 (default is False).
42+ quarto_checks : bool, optional
43+ Whether to perform checks for Quarto report generation for TeX and Chromium
44+ installation (default is False).
4145 output_dir : Path, optional
4246 The directory where the report folder will be generated.
4347 If not provided, the current directory will be used.
4448 max_depth : int, optional
45- The maximum depth of the directory structure to consider when generating the report.
46- The default is 2, which means it will include sections and subsections. The parater
47- is only used when 'dir_path' is used.
49+ The maximum depth of the directory structure to consider when generating the
50+ report. The default is 2, which means it will include sections and subsections.
51+ The parater is only used when 'dir_path' is used.
4852
4953 Raises
5054 ------
@@ -80,7 +84,7 @@ def get_report(
8084
8185 if dir_path :
8286 # Generate configuration from the provided directory
83- yaml_data , base_folder_path = config_manager .create_yamlconfig_fromdir (dir_path )
87+ yaml_data , _ = config_manager .create_yamlconfig_fromdir (dir_path )
8488 # yaml_data has under report a title created based on the directory name
8589 config_path = write_yaml_config (yaml_data , output_dir )
8690 logger .info ("Configuration file generated at %s" , config_path )
@@ -89,7 +93,7 @@ def get_report(
8993 report_config = load_yaml_config (config_path )
9094
9195 # Load report object and metadata
92- report , report_metadata = config_manager .initialize_report (report_config )
96+ report , _ = config_manager .initialize_report (report_config )
9397
9498 # Validate and convert the report type to its enum value
9599 report_type = assert_enum_value (ReportType , report_type , logger )
@@ -112,12 +116,12 @@ def get_report(
112116 if shutil .which ("quarto" ) is None and not hasattr (
113117 sys , "_MEIPASS"
114118 ): # ? and not getattr(sys, "frozen", False)
115- logger .error (
116- "Quarto is not installed. Please install Quarto before generating this report type."
117- )
118- raise RuntimeError (
119- "Quarto is not installed. Please install Quarto before generating this report type."
119+ msg = (
120+ "Quarto is not installed. Please install Quarto before generating this "
121+ "report type."
120122 )
123+ logger .error (msg )
124+ raise RuntimeError (msg )
121125 report_dir = output_dir / "quarto_report"
122126 static_files_dir = report_dir / "static"
123127 quarto_report = QuartoReportView (
0 commit comments