pdstools.utils.report_utils¶
Attributes¶
Functions¶
|
Generate the output filename based on the report parameters. |
|
Copy the report quarto file to the temporary directory. |
|
Write parameters to a YAML file. |
|
Run the Quarto command to generate the report. |
|
Get command output in an OS-agnostic way. |
|
Extract version number from version string. |
|
Get Quarto executable path and version. |
|
Get Pandoc executable path and version. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Module Contents¶
- logger¶
- get_output_filename(name: str | None, report_type: str, model_id: str | None = None, output_type: str = 'html') str ¶
Generate the output filename based on the report parameters.
- copy_quarto_file(qmd_file: str, temp_dir: pathlib.Path) None ¶
Copy the report quarto file to the temporary directory.
- Parameters:
qmd_file (str)
temp_dir (pathlib.Path)
- Return type:
None
- _write_params_files(temp_dir: pathlib.Path, params: Dict = {}, project: Dict = {'type': 'default'}, analysis: Dict = {}) None ¶
Write parameters to a YAML file.
- Parameters:
temp_dir (pathlib.Path)
params (Dict)
project (Dict)
analysis (Dict)
- Return type:
None
- run_quarto(qmd_file: str, output_filename: str, output_type: str = 'html', params: Dict = {}, project: Dict = {'type': 'default'}, analysis: Dict = {}, temp_dir: pathlib.Path = Path('.'), verbose: bool = False) int ¶
Run the Quarto command to generate the report.
- get_quarto_with_version(verbose: bool = True) Tuple[pathlib.Path, str] ¶
Get Quarto executable path and version.
- Parameters:
verbose (bool)
- Return type:
Tuple[pathlib.Path, str]
- get_pandoc_with_version(verbose: bool = True) Tuple[pathlib.Path, str] ¶
Get Pandoc executable path and version.
- Parameters:
verbose (bool)
- Return type:
Tuple[pathlib.Path, str]
- quarto_print(text)¶
- quarto_callout_info(info)¶
- quarto_callout_important(info)¶
- quarto_callout_no_prediction_data_warning(extra='')¶
- quarto_callout_no_predictor_data_warning(extra='')¶
- polars_col_exists(df, col)¶
- polars_subset_to_existing_cols(all_columns, cols)¶
- table_standard_formatting(source_table, title=None, subtitle=None, rowname_col=None, groupname_col=None, cdh_guidelines=CDHGuidelines(), highlight_limits: Dict[str, str | List[str]] = {}, highlight_lists: Dict[str, List[str]] = {}, highlight_configurations: List[str] = [], rag_styler: callable = rag_background_styler)¶
- table_style_predictor_count(gt, flds, cdh_guidelines=CDHGuidelines(), rag_styler=rag_textcolor_styler)¶
- n_unique_values(dm, all_dm_cols, fld)¶
- max_by_hierarchy(dm, all_dm_cols, fld, grouping)¶
- avg_by_hierarchy(dm, all_dm_cols, fld, grouping)¶
- sample_values(dm, all_dm_cols, fld, n=6)¶