From 3adc0ffeb3b86a0f8ab49bb1e15396c90a18854f Mon Sep 17 00:00:00 2001 From: Lukasz Kolodziejczyk Date: Mon, 20 Jan 2025 10:41:35 +0100 Subject: [PATCH] default --- mostlyai/qa/reporting.py | 6 +----- mostlyai/qa/reporting_from_statistics.py | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/mostlyai/qa/reporting.py b/mostlyai/qa/reporting.py index c048134..60e3e31 100644 --- a/mostlyai/qa/reporting.py +++ b/mostlyai/qa/reporting.py @@ -71,7 +71,7 @@ def report( max_sample_size_accuracy: int | None = None, max_sample_size_embeddings: int | None = None, statistics_path: str | Path | None = None, - update_progress: ProgressCallback | None = None, + update_progress: ProgressCallback = lambda *args, **kwargs: None, ) -> tuple[Path, ModelMetrics | None]: """ Generate an HTML report and metrics for assessing synthetic data quality. @@ -120,10 +120,6 @@ def report( if hol_tgt_data is not None and hol_ctx_data is None: raise ValueError("If syn_ctx_data is provided, then hol_ctx_data must also be provided.") - if update_progress is None: - - def update_progress(*args, **kwargs): ... - with TemporaryWorkspace() as workspace: # ensure all columns are present and in the same order as training data syn_tgt_data = syn_tgt_data[trn_tgt_data.columns] diff --git a/mostlyai/qa/reporting_from_statistics.py b/mostlyai/qa/reporting_from_statistics.py index ca1ab7a..41ea7ab 100644 --- a/mostlyai/qa/reporting_from_statistics.py +++ b/mostlyai/qa/reporting_from_statistics.py @@ -47,7 +47,7 @@ def report_from_statistics( report_extra_info: str = "", max_sample_size_accuracy: int | None = None, max_sample_size_embeddings: int | None = None, - update_progress: ProgressCallback | None = None, + update_progress: ProgressCallback = lambda *args, **kwargs: None, ) -> Path: """ Generate an HTML report based on previously generated statistics and newly provided synthetic data samples. @@ -71,10 +71,6 @@ def report_from_statistics( The path to the generated HTML report. """ - if update_progress is None: - - def update_progress(*args, **kwargs): ... - with TemporaryWorkspace() as workspace: # prepare report_path if report_path is None: