annikwag commited on
Commit
aae060b
·
verified ·
1 Parent(s): 28c8e4b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -13
app.py CHANGED
@@ -94,18 +94,18 @@ else:
94
  with col2:
95
  country_filter = st.selectbox("Country", ["All/Not allocated"] + filtered_country_names) # Display filtered country names
96
 
97
- # Year range slider
98
- with col3:
99
- current_year = datetime.now().year
100
- default_start_year = current_year - 5
101
-
102
- # 3) The max_value is now the actual max end_year from collection
103
- end_year_range = st.slider(
104
- "Project End Year",
105
- min_value=2010,
106
- max_value=max_end_year,
107
- value=(default_start_year, max_end_year),
108
- )
109
 
110
  # Checkbox to control whether to show only exact matches
111
  show_exact_matches = st.checkbox("Show only exact matches", value=False)
@@ -145,7 +145,7 @@ def filter_results(results, country_filter, region_filter, end_year_range):
145
  if (
146
  (country_filter == "All/Not allocated" or selected_iso_code in c_list)
147
  and (region_filter == "All/Not allocated" or countries_in_region)
148
- and (end_year_range[0] <= end_year_val <= end_year_range[1])
149
  ):
150
  filtered.append(r)
151
  return filtered
 
94
  with col2:
95
  country_filter = st.selectbox("Country", ["All/Not allocated"] + filtered_country_names) # Display filtered country names
96
 
97
+ # # Year range slider # ToDo add end_year filter again
98
+ # with col3:
99
+ # current_year = datetime.now().year
100
+ # default_start_year = current_year - 5
101
+
102
+ # # 3) The max_value is now the actual max end_year from collection
103
+ # end_year_range = st.slider(
104
+ # "Project End Year",
105
+ # min_value=2010,
106
+ # max_value=max_end_year,
107
+ # value=(default_start_year, max_end_year),
108
+ # )
109
 
110
  # Checkbox to control whether to show only exact matches
111
  show_exact_matches = st.checkbox("Show only exact matches", value=False)
 
145
  if (
146
  (country_filter == "All/Not allocated" or selected_iso_code in c_list)
147
  and (region_filter == "All/Not allocated" or countries_in_region)
148
+ # and (end_year_range[0] <= end_year_val <= end_year_range[1]) # ToDo add end_year filter again
149
  ):
150
  filtered.append(r)
151
  return filtered