James McCool
commited on
Commit
·
c572c45
1
Parent(s):
36e7807
Fix ownership and points dictionary updates in find_name_mismatches.py
Browse files- Corrected the logic for updating the ownership and fpts dictionaries to ensure that the correct projection names are mapped to their respective contest names.
- Added debug output to display the contents of 'actual_dict' and 'ownership_dict' from session state, aiding in debugging and providing visibility into key data during processing.
global_func/find_name_mismatches.py
CHANGED
@@ -82,9 +82,9 @@ def find_name_mismatches(contest_df, projections_df, ownership_dict, fpts_dict):
|
|
82 |
contest_df[col] = contest_df[col].replace(contest_name, projection_name)
|
83 |
|
84 |
if contest_name in ownership_dict:
|
85 |
-
ownership_dict[
|
86 |
if contest_name in fpts_dict:
|
87 |
-
fpts_dict[
|
88 |
|
89 |
# Process manual selections
|
90 |
for projection_name, selection in selections.items():
|
@@ -101,6 +101,8 @@ def find_name_mismatches(contest_df, projections_df, ownership_dict, fpts_dict):
|
|
101 |
st.success(f"Replaced '{selected_name}' with '{projection_name}'")
|
102 |
|
103 |
st.success("All changes applied successfully!")
|
|
|
|
|
104 |
return contest_df, projections_df, ownership_dict, fpts_dict
|
105 |
|
106 |
# Return the current state if form hasn't been submitted yet
|
|
|
82 |
contest_df[col] = contest_df[col].replace(contest_name, projection_name)
|
83 |
|
84 |
if contest_name in ownership_dict:
|
85 |
+
ownership_dict[projection_name] = ownership_dict.pop(contest_name)
|
86 |
if contest_name in fpts_dict:
|
87 |
+
fpts_dict[projection_name] = fpts_dict.pop(contest_name)
|
88 |
|
89 |
# Process manual selections
|
90 |
for projection_name, selection in selections.items():
|
|
|
101 |
st.success(f"Replaced '{selected_name}' with '{projection_name}'")
|
102 |
|
103 |
st.success("All changes applied successfully!")
|
104 |
+
st.write(st.session_state['actual_dict'])
|
105 |
+
st.write(st.session_state['ownership_dict'])
|
106 |
return contest_df, projections_df, ownership_dict, fpts_dict
|
107 |
|
108 |
# Return the current state if form hasn't been submitted yet
|