From 93ec0137668240023d34497f51e167ea76482b0e Mon Sep 17 00:00:00 2001 From: Bea <66849242+beawitcht@users.noreply.github.com> Date: Mon, 25 Sep 2023 09:47:12 +0100 Subject: [PATCH 1/2] update under18 filter --- app/scripts/gics.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/scripts/gics.py b/app/scripts/gics.py index a830da2..b0aa69b 100644 --- a/app/scripts/gics.py +++ b/app/scripts/gics.py @@ -72,8 +72,8 @@ async def on_ready(): options.append((country, f"{service} - Wait time (months): {to_be_seen}" if pd.notna(to_be_seen) else "Unknown")) -# Filter out specific services -options = [gic for gic in options if "GIDS" not in gic[1] and "KOI" not in gic[1] and "Youth" not in gic[1]] +# Filter out under 18 services +options = [gic for gic in options if "GIDS" not in gic[1] and "KOI" not in gic[1] and "Youth" not in gic[1] and "Hub" not in gic[1]] # Sort options by months remaining options.sort(key=lambda x: int(x[1].split(': ')[1][-2:]) if x[1].split(': ')[1] != 'nan' else 9999) From 45135a9ed14a3d3d2b68618fb53dcfc85263d934 Mon Sep 17 00:00:00 2001 From: Bea <66849242+beawitcht@users.noreply.github.com> Date: Mon, 25 Sep 2023 09:54:42 +0100 Subject: [PATCH 2/2] make youth service logic easier to modify --- app/scripts/gics.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/scripts/gics.py b/app/scripts/gics.py index b0aa69b..9e2df3a 100644 --- a/app/scripts/gics.py +++ b/app/scripts/gics.py @@ -73,7 +73,8 @@ async def on_ready(): options.append((country, f"{service} - Wait time (months): {to_be_seen}" if pd.notna(to_be_seen) else "Unknown")) # Filter out under 18 services -options = [gic for gic in options if "GIDS" not in gic[1] and "KOI" not in gic[1] and "Youth" not in gic[1] and "Hub" not in gic[1]] +youth_services = ["GIDS", "KOI", "Youth", "Hub"] +options = [gic for gic in options if all(service not in gic[1] for service in youth_services)] # Sort options by months remaining options.sort(key=lambda x: int(x[1].split(': ')[1][-2:]) if x[1].split(': ')[1] != 'nan' else 9999)