Jan Mühlnikel commited on
Commit
83fabd0
1 Parent(s): 810c1ee

added checkboxes for single matches

Browse files
__pycache__/similarity_page.cpython-310.pyc CHANGED
Binary files a/__pycache__/similarity_page.cpython-310.pyc and b/__pycache__/similarity_page.cpython-310.pyc differ
 
functions/__pycache__/filter_projects.cpython-310.pyc CHANGED
Binary files a/functions/__pycache__/filter_projects.cpython-310.pyc and b/functions/__pycache__/filter_projects.cpython-310.pyc differ
 
similarity_page.py CHANGED
@@ -268,11 +268,24 @@ def show_single_matching_page():
268
  options = search_list,
269
  )
270
 
 
 
 
271
  if project_option:
272
 
 
 
 
 
 
 
273
  selected_index = search_list.index(project_option)
 
 
 
 
 
274
 
275
- top_projects_df = find_similar(selected_index, sim_matrix, projects_df, 10)
276
-
277
  show_single_table(top_projects_df)
278
 
 
268
  options = search_list,
269
  )
270
 
271
+ different_orga_checkbox_ = st.checkbox("Only matches for organisations other than the selected project")
272
+ filterd_country_only_checkbox_ = st.checkbox("Only matches in the same countries as project selection")
273
+
274
  if project_option:
275
 
276
+ if filterd_country_only_checkbox_:
277
+ country = projects_df.iloc[selected_index]["country"]
278
+ same_country_df = projects_df[projects_df['country'] == country]
279
+ else:
280
+ same_country_df = projects_df
281
+
282
  selected_index = search_list.index(project_option)
283
+ if different_orga_checkbox_:
284
+ orga = projects_df.iloc[selected_index]["orga_abbreviation"]
285
+ different_orga_df = same_country_df[same_country_df['orga_abbreviation'] != orga]
286
+ else:
287
+ different_orga_df = same_country_df
288
 
289
+ top_projects_df = find_similar(selected_index, sim_matrix, different_orga_df, 10)
 
290
  show_single_table(top_projects_df)
291