James McCool commited on
Commit
edd8da4
·
1 Parent(s): 92e6a09

Refactor conditional statements for tab selection in streamlit_app.py to use 'if' instead of 'with' for improved clarity and functionality.

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +4 -4
src/streamlit_app.py CHANGED
@@ -312,7 +312,7 @@ selected_tab = st.segmented_control(
312
  key='tab_selector'
313
  )
314
 
315
- with selected_tab == 'Gamelogs':
316
  col1, col2 = st.columns([1, 9])
317
  with col1:
318
  if st.button("Reset Data", key='reset1'):
@@ -438,7 +438,7 @@ with selected_tab == 'Gamelogs':
438
  mime='text/csv',
439
  )
440
 
441
- with selected_tab == 'Correlation Matrix':
442
  col1, col2 = st.columns([1, 9])
443
  with col1:
444
  if st.button("Reset Data", key='reset2'):
@@ -530,7 +530,7 @@ with selected_tab == 'Correlation Matrix':
530
  mime='text/csv',
531
  )
532
 
533
- with selected_tab == 'Position vs. Opp':
534
  col1, col2 = st.columns([1, 9])
535
  with col1:
536
  if st.button("Reset Data", key='reset3'):
@@ -614,7 +614,7 @@ with selected_tab == 'Position vs. Opp':
614
  mime='text/csv',
615
  )
616
 
617
- with selected_tab == 'Game Rotations':
618
  col1, col2 = st.columns([1, 9])
619
  with col1:
620
  if st.button("Reset Data", key='reset5'):
 
312
  key='tab_selector'
313
  )
314
 
315
+ if selected_tab == 'Gamelogs':
316
  col1, col2 = st.columns([1, 9])
317
  with col1:
318
  if st.button("Reset Data", key='reset1'):
 
438
  mime='text/csv',
439
  )
440
 
441
+ if selected_tab == 'Correlation Matrix':
442
  col1, col2 = st.columns([1, 9])
443
  with col1:
444
  if st.button("Reset Data", key='reset2'):
 
530
  mime='text/csv',
531
  )
532
 
533
+ if selected_tab == 'Position vs. Opp':
534
  col1, col2 = st.columns([1, 9])
535
  with col1:
536
  if st.button("Reset Data", key='reset3'):
 
614
  mime='text/csv',
615
  )
616
 
617
+ if selected_tab == 'Game Rotations':
618
  col1, col2 = st.columns([1, 9])
619
  with col1:
620
  if st.button("Reset Data", key='reset5'):