fixed filter to none

This commit is contained in:
2026-02-03 18:19:06 +01:00
parent 1e76a82f24
commit 495b56307c

View File

@@ -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: