Jan Mühlnikel
commited on
Commit
·
867f2d7
1
Parent(s):
63ba39b
changed filters
Browse files- similarity_page.py +18 -14
similarity_page.py
CHANGED
|
@@ -308,17 +308,6 @@ def show_single_matching_page():
|
|
| 308 |
)
|
| 309 |
|
| 310 |
with col3:
|
| 311 |
-
# COUNTRY SELECTION
|
| 312 |
-
country_option_s = st.multiselect(
|
| 313 |
-
'Country / Countries ',
|
| 314 |
-
COUNTRY_OPTION_LIST,
|
| 315 |
-
placeholder="All countries selected "
|
| 316 |
-
)
|
| 317 |
-
|
| 318 |
-
filterd_country_only_checkbox_s = st.checkbox("Only matches between filtered countries ", value=True)
|
| 319 |
-
|
| 320 |
-
|
| 321 |
-
with col4:
|
| 322 |
# ORGA SELECTION
|
| 323 |
orga_abbreviation = projects_df["orga_abbreviation"].unique()
|
| 324 |
orga_full_names = projects_df["orga_full_name"].unique()
|
|
@@ -332,7 +321,17 @@ def show_single_matching_page():
|
|
| 332 |
|
| 333 |
different_orga_checkbox_s = st.checkbox("Only matches between different organizations ", value=True)
|
| 334 |
|
| 335 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 336 |
#selected_index = None
|
| 337 |
if project_option:
|
| 338 |
selected_project_index = search_list.index(project_option)
|
|
@@ -344,7 +343,12 @@ def show_single_matching_page():
|
|
| 344 |
|
| 345 |
TOP_X_PROJECTS = 10
|
| 346 |
filtered_df_s = filter_single(projects_df, country_code_list, orga_code_list)
|
| 347 |
-
|
| 348 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 349 |
show_single_table(selected_project_index, projects_df, top_projects_df)
|
| 350 |
|
|
|
|
| 308 |
)
|
| 309 |
|
| 310 |
with col3:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 311 |
# ORGA SELECTION
|
| 312 |
orga_abbreviation = projects_df["orga_abbreviation"].unique()
|
| 313 |
orga_full_names = projects_df["orga_full_name"].unique()
|
|
|
|
| 321 |
|
| 322 |
different_orga_checkbox_s = st.checkbox("Only matches between different organizations ", value=True)
|
| 323 |
|
| 324 |
+
|
| 325 |
+
with col4:
|
| 326 |
+
# COUNTRY SELECTION
|
| 327 |
+
country_option_s = st.multiselect(
|
| 328 |
+
'Country / Countries ',
|
| 329 |
+
COUNTRY_OPTION_LIST,
|
| 330 |
+
placeholder="All countries selected "
|
| 331 |
+
)
|
| 332 |
+
|
| 333 |
+
st.write("--------------")
|
| 334 |
+
|
| 335 |
#selected_index = None
|
| 336 |
if project_option:
|
| 337 |
selected_project_index = search_list.index(project_option)
|
|
|
|
| 343 |
|
| 344 |
TOP_X_PROJECTS = 10
|
| 345 |
filtered_df_s = filter_single(projects_df, country_code_list, orga_code_list)
|
| 346 |
+
|
| 347 |
+
if isinstance(filtered_df_s, pd.DataFrame) and len(filtered_df_s) != 0:
|
| 348 |
+
if different_orga_checkbox_s:
|
| 349 |
+
top_projects_df = find_similar(selected_project_index, nonsameorgas_sim_matrix, filtered_df_s, 10)
|
| 350 |
+
else:
|
| 351 |
+
top_projects_df = find_similar(selected_project_index, sim_matrix, filtered_df_s, 10)
|
| 352 |
+
|
| 353 |
show_single_table(selected_project_index, projects_df, top_projects_df)
|
| 354 |
|