James McCool
commited on
Commit
·
b60e0d6
1
Parent(s):
a4d375f
Refactor portfolio reset functionality in app.py: modify the reset button logic to delete the working_frame from session state, ensuring a clearer reset process, and update working_frame initialization to consistently reference the origin_portfolio.
Browse files
app.py
CHANGED
@@ -738,7 +738,7 @@ with tab2:
|
|
738 |
with col1:
|
739 |
site_var = st.selectbox("Select Site", ['Draftkings', 'Fanduel'])
|
740 |
if st.button('Reset Portfolio', key='reset_port'):
|
741 |
-
st.session_state['working_frame']
|
742 |
|
743 |
if st.button('Clear data', key='reset3'):
|
744 |
st.session_state.clear()
|
@@ -752,7 +752,7 @@ with tab2:
|
|
752 |
strength_var = st.selectbox("Select field strength", ['Average', 'Sharp', 'Weak'])
|
753 |
|
754 |
if 'working_frame' not in st.session_state:
|
755 |
-
st.session_state['working_frame'] = st.session_state['
|
756 |
if site_var == 'Draftkings':
|
757 |
if type_var == 'Classic':
|
758 |
if sport_var == 'CS2':
|
|
|
738 |
with col1:
|
739 |
site_var = st.selectbox("Select Site", ['Draftkings', 'Fanduel'])
|
740 |
if st.button('Reset Portfolio', key='reset_port'):
|
741 |
+
del st.session_state['working_frame']
|
742 |
|
743 |
if st.button('Clear data', key='reset3'):
|
744 |
st.session_state.clear()
|
|
|
752 |
strength_var = st.selectbox("Select field strength", ['Average', 'Sharp', 'Weak'])
|
753 |
|
754 |
if 'working_frame' not in st.session_state:
|
755 |
+
st.session_state['working_frame'] = st.session_state['origin_portfolio'].copy()
|
756 |
if site_var == 'Draftkings':
|
757 |
if type_var == 'Classic':
|
758 |
if sport_var == 'CS2':
|