James McCool commited on
Commit
f051d8d
·
1 Parent(s): 066ac05

Update contest loading feedback and display data in app.py

Browse files

- Adjusted success message to inform users to wait for tables to load before switching tabs, enhancing clarity.
- Reintroduced the display of contest and portfolio data after loading, improving user visibility of loaded data.
- These changes enhance user experience by providing timely feedback and ensuring relevant data is accessible.

Files changed (1) hide show
  1. app.py +9 -10
app.py CHANGED
@@ -265,9 +265,9 @@ if selected_tab == 'Data Load':
265
  st.session_state['Contest'] = st.session_state['Contest'].dropna(how='all')
266
  st.session_state['Contest'] = st.session_state['Contest'].reset_index(drop=True)
267
  if st.session_state['Contest'] is not None:
268
- success_col, info_col, upload_col, message_col = st.columns([1, 3, 1, 2])
269
  with success_col:
270
- st.success('Contest file loaded successfully!')
271
  with info_col:
272
  st.warning("If you have confirmed that the data is correct, you can send the CSV to the database to enrich Paydirt's sources and help us create actionable tools and algorithms >>")
273
  with upload_col:
@@ -278,13 +278,6 @@ if selected_tab == 'Data Load':
278
  st.info(return_message)
279
  except:
280
  pass
281
- st.write('Contest data:')
282
- st.dataframe(st.session_state['Contest'].head(25))
283
- if st.session_state['portfolio_df'] is not None:
284
- st.write('Portfolio data:')
285
- st.dataframe(st.session_state['portfolio_df'].head(25))
286
- else:
287
- pass
288
 
289
  if 'Contest_file' in st.session_state:
290
  st.session_state['ownership_dict'] = dict(zip(st.session_state['ownership_df']['Player'], st.session_state['ownership_df']['Own']))
@@ -466,7 +459,13 @@ if selected_tab == 'Data Load':
466
  st.session_state['unique_players'] = pd.unique(st.session_state['display_contest_info'][st.session_state['player_columns']].values.ravel('K'))
467
  st.session_state['unique_players'] = [p for p in st.session_state['unique_players'] if p != 'nan']
468
 
469
- st.toast('Contest ready for analysis!', icon='🎉')
 
 
 
 
 
 
470
 
471
  if selected_tab == 'Contest Analysis':
472
  if 'sport_select' not in st.session_state:
 
265
  st.session_state['Contest'] = st.session_state['Contest'].dropna(how='all')
266
  st.session_state['Contest'] = st.session_state['Contest'].reset_index(drop=True)
267
  if st.session_state['Contest'] is not None:
268
+ success_col, info_col, upload_col, message_col = st.columns([2, 3, 1, 2])
269
  with success_col:
270
+ st.success('Contest file loaded, please wait for tables to load below before you switch tabs!')
271
  with info_col:
272
  st.warning("If you have confirmed that the data is correct, you can send the CSV to the database to enrich Paydirt's sources and help us create actionable tools and algorithms >>")
273
  with upload_col:
 
278
  st.info(return_message)
279
  except:
280
  pass
 
 
 
 
 
 
 
281
 
282
  if 'Contest_file' in st.session_state:
283
  st.session_state['ownership_dict'] = dict(zip(st.session_state['ownership_df']['Player'], st.session_state['ownership_df']['Own']))
 
459
  st.session_state['unique_players'] = pd.unique(st.session_state['display_contest_info'][st.session_state['player_columns']].values.ravel('K'))
460
  st.session_state['unique_players'] = [p for p in st.session_state['unique_players'] if p != 'nan']
461
 
462
+ st.write('Contest data:')
463
+ st.dataframe(st.session_state['Contest'].head(25))
464
+ if st.session_state['portfolio_df'] is not None:
465
+ st.write('Portfolio data:')
466
+ st.dataframe(st.session_state['portfolio_df'].head(25))
467
+ else:
468
+ pass
469
 
470
  if selected_tab == 'Contest Analysis':
471
  if 'sport_select' not in st.session_state: