From 495b56307c52f2fc982215c69f52164f1358dfee Mon Sep 17 00:00:00 2001 From: Luigi Maiorano Date: Tue, 3 Feb 2026 18:19:06 +0100 Subject: [PATCH] fixed filter to none --- 03_quant_report.script.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/03_quant_report.script.py b/03_quant_report.script.py index 96c7016..941e203 100644 --- a/03_quant_report.script.py +++ b/03_quant_report.script.py @@ -69,7 +69,7 @@ cli_args = parse_cli_args() # mo.stop(file_browser.path(index=0) is None, mo.md("**⚠️ Please select a `_Labels.csv` file above to proceed**")) # RESULTS_FILE = Path(file_browser.path(index=0)) -RESULTS_FILE = 'data/exports/2-3-26_Copy-2-2-26/JPMC_Chase Brand Personality_Quant Round 1_February 2, 2026_Labels.csv' +RESULTS_FILE = 'data/exports/debug/JPMC_Chase Brand Personality_Quant Round 1_February 2, 2026_Labels.csv' QSF_FILE = 'data/exports/OneDrive_2026-01-21/Soft Launch Data/JPMC_Chase_Brand_Personality_Quant_Round_1.qsf' # %% @@ -111,17 +111,16 @@ BEST_CHOSEN_CHARACTER = "the_coach" # {filter_form} # ''') +# %% +print(len(data_all.collect())) # %% # mo.stop(filter_form.value is None, mo.md("**Please submit filter above to proceed**")) -# CLI args: None means "all options selected" (use S.options_* defaults) +# CLI args: None means "no filter applied" - filter_data() will skip None filters # Build filter values dict dynamically from FILTER_CONFIG -_active_filters = {} -for filter_name, options_attr in FILTER_CONFIG.items(): - cli_value = getattr(cli_args, filter_name) - all_options = getattr(S, options_attr) - _active_filters[filter_name] = cli_value if cli_value is not None else all_options +_active_filters = {filter_name: getattr(cli_args, filter_name) for filter_name in FILTER_CONFIG} +# %% _d = S.filter_data(data_all, **_active_filters) # Write filter description file if filter-name is provided @@ -142,7 +141,8 @@ if cli_args.filter_name and S.fig_save_dir: all_options = getattr(S, options_attr) values = _active_filters[filter_name] display_name = filter_name.replace('_', ' ').title() - if values != all_options: + # None means no filter applied (same as "All") + if values is not None and values != all_options: _short_desc_parts.append(f"{display_name}: {', '.join(values)}") _filter_desc_lines.append(f" {display_name}: {', '.join(values)}") else: