feat: Uncomment and define get_user_screener_selection function in user_input.py

This commit is contained in:
Bobby (aider) 2025-02-08 07:50:14 -08:00
parent b341bd53ce
commit 8cd2b39849

View File

@ -23,11 +23,42 @@ def get_interval_choice() -> str:
return "1hour"
else:
print("Invalid choice. Please try again.")
def get_user_screener_selection() -> dict:
"""Ask the user which screeners they want to run and whether to use defaults.
Returns a dictionary of selected screeners with default/customization choices.
"""
Ask the user which screeners they want to run and whether to use defaults.
Returns a dictionary of selected screeners with default/customization choices.
"""
selected_screeners = {}
print("\nAvailable Screener Categories:")
for category in SCREENERS:
print(f"- {category}")
selected_categories = input("\nEnter the categories you want to screen (comma-separated), or type 'all' for all: ").strip().lower()
if selected_categories == "all":
selected_categories = SCREENERS.keys()
else:
selected_categories = [c.strip().title() for c in selected_categories.split(",") if c.strip().title() in SCREENERS]
for category in selected_categories:
print(f"\nCategory: {category}")
use_defaults = input(f"Use default settings for {category}? (y/n): ").strip().lower()
selected_screeners[category] = {}
for screener, description in SCREENERS[category].items():
if use_defaults == "y":
selected_screeners[category][screener] = "default"
else:
custom_value = input(f"{screener} ({description}) - Enter custom threshold or press Enter to use default: ").strip()
selected_screeners[category][screener] = float(custom_value) if custom_value else "default"
print(f"\n✅ Selected Screeners: {selected_screeners}\n") # ✅ DEBUG LOG
return selected_screeners
print("\nAvailable Screener Categories:")
for category in SCREENERS: