James McCool
commited on
Commit
·
f65755c
1
Parent(s):
95ba261
Update session state keys for game type and sport selection in app.py
Browse files- Changed references from 'type_var' to 'type_init' for game type selection and from 'sport_select' to 'sport_init' for sport selection, enhancing consistency in session state management.
- This update improves code clarity and prepares for future enhancements in user interaction.
app.py
CHANGED
|
@@ -321,7 +321,7 @@ if selected_tab == 'Data Load':
|
|
| 321 |
actual_map = st.session_state['actual_dict']
|
| 322 |
ownership_map = st.session_state['ownership_dict']
|
| 323 |
|
| 324 |
-
if st.session_state['
|
| 325 |
# Vectorized stack calculation
|
| 326 |
player_teams = working_df[st.session_state['stack_columns']].apply(
|
| 327 |
lambda x: x.map(team_map).fillna('')
|
|
@@ -383,7 +383,7 @@ if selected_tab == 'Data Load':
|
|
| 383 |
working_df['finish'] = working_df['index']
|
| 384 |
working_df = working_df.drop(['sorted', 'index'], axis=1)
|
| 385 |
|
| 386 |
-
elif st.session_state['
|
| 387 |
# Vectorized stack calculation for Showdown
|
| 388 |
player_teams = working_df.iloc[:, 2:].apply(
|
| 389 |
lambda x: x.map(team_map).fillna('')
|
|
@@ -403,7 +403,7 @@ if selected_tab == 'Data Load':
|
|
| 403 |
working_df['stack'] = [result[0] for result in stack_results]
|
| 404 |
working_df['stack_size'] = [result[1] for result in stack_results]
|
| 405 |
|
| 406 |
-
if st.session_state['
|
| 407 |
# Vectorized calculations for GOLF
|
| 408 |
player_salaries = working_df.apply(
|
| 409 |
lambda x: x.map(salary_map).fillna(0)
|
|
|
|
| 321 |
actual_map = st.session_state['actual_dict']
|
| 322 |
ownership_map = st.session_state['ownership_dict']
|
| 323 |
|
| 324 |
+
if st.session_state['type_init'] == 'Classic':
|
| 325 |
# Vectorized stack calculation
|
| 326 |
player_teams = working_df[st.session_state['stack_columns']].apply(
|
| 327 |
lambda x: x.map(team_map).fillna('')
|
|
|
|
| 383 |
working_df['finish'] = working_df['index']
|
| 384 |
working_df = working_df.drop(['sorted', 'index'], axis=1)
|
| 385 |
|
| 386 |
+
elif st.session_state['type_init'] == 'Showdown':
|
| 387 |
# Vectorized stack calculation for Showdown
|
| 388 |
player_teams = working_df.iloc[:, 2:].apply(
|
| 389 |
lambda x: x.map(team_map).fillna('')
|
|
|
|
| 403 |
working_df['stack'] = [result[0] for result in stack_results]
|
| 404 |
working_df['stack_size'] = [result[1] for result in stack_results]
|
| 405 |
|
| 406 |
+
if st.session_state['sport_init'] == 'GOLF':
|
| 407 |
# Vectorized calculations for GOLF
|
| 408 |
player_salaries = working_df.apply(
|
| 409 |
lambda x: x.map(salary_map).fillna(0)
|