Spaces:
Sleeping
Sleeping
James McCool
commited on
Commit
Β·
346309d
1
Parent(s):
cd997d2
Refactor streamlit_app.py to replace sport selection with a segmented control for tab navigation, enhancing UI clarity. Update button functionality for NHL updates and add placeholders for NFL, NBA, and MLB updates.
Browse files- src/streamlit_app.py +26 -26
src/streamlit_app.py
CHANGED
|
@@ -42,9 +42,6 @@ st.title("π Paydirt Model Updates")
|
|
| 42 |
st.markdown("### Update models and generate seed frames")
|
| 43 |
st.markdown("---")
|
| 44 |
|
| 45 |
-
# Sidebar Configuration
|
| 46 |
-
st.sidebar.header("βοΈ Configuration")
|
| 47 |
-
|
| 48 |
# Sport Selection
|
| 49 |
sport_icons = {
|
| 50 |
"NHL": "π",
|
|
@@ -53,20 +50,20 @@ sport_icons = {
|
|
| 53 |
"MLB": "βΎ"
|
| 54 |
}
|
| 55 |
|
| 56 |
-
|
| 57 |
-
"Select
|
| 58 |
-
options=["NHL
|
| 59 |
-
|
| 60 |
-
|
|
|
|
|
|
|
|
|
|
| 61 |
)
|
| 62 |
|
| 63 |
# Main content area
|
| 64 |
-
|
| 65 |
|
| 66 |
-
if st.button(f"{sport_icons[
|
| 67 |
-
|
| 68 |
-
# Route to sport-specific pipeline
|
| 69 |
-
if selected_sport == "NHL":
|
| 70 |
|
| 71 |
st.write("Starting prop betting table generation...")
|
| 72 |
build_prop_betting_table(nhl_db)
|
|
@@ -232,17 +229,20 @@ if st.button(f"{sport_icons[selected_sport]} Update {selected_sport} models and
|
|
| 232 |
except:
|
| 233 |
pass
|
| 234 |
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
elif selected_sport == "NBA":
|
| 242 |
-
run_nba_pipeline(nhl_db, gc, gc2, discord)
|
| 243 |
-
|
| 244 |
-
elif selected_sport == "MLB":
|
| 245 |
-
run_mlb_pipeline(nhl_db, gc, gc2, discord)
|
| 246 |
|
| 247 |
-
|
| 248 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
st.markdown("### Update models and generate seed frames")
|
| 43 |
st.markdown("---")
|
| 44 |
|
|
|
|
|
|
|
|
|
|
| 45 |
# Sport Selection
|
| 46 |
sport_icons = {
|
| 47 |
"NHL": "π",
|
|
|
|
| 50 |
"MLB": "βΎ"
|
| 51 |
}
|
| 52 |
|
| 53 |
+
selected_tab = st.segmented_control(
|
| 54 |
+
"Select Tab",
|
| 55 |
+
options=["NHL Updates", "NBA Updates", 'MLB Updates', 'NFL Updates'],
|
| 56 |
+
selection_mode='single',
|
| 57 |
+
default='NHL Updates',
|
| 58 |
+
width='stretch',
|
| 59 |
+
label_visibility='collapsed',
|
| 60 |
+
key='tab_selector'
|
| 61 |
)
|
| 62 |
|
| 63 |
# Main content area
|
| 64 |
+
if selected_tab == "NHL Updates":
|
| 65 |
|
| 66 |
+
if st.button(f"{sport_icons["NHL"]} Update NHL models and generate seed frames", type="primary", use_container_width=True):
|
|
|
|
|
|
|
|
|
|
| 67 |
|
| 68 |
st.write("Starting prop betting table generation...")
|
| 69 |
build_prop_betting_table(nhl_db)
|
|
|
|
| 229 |
except:
|
| 230 |
pass
|
| 231 |
|
| 232 |
+
st.success("β
NHL updates completed successfully!")
|
| 233 |
+
st.balloons()
|
| 234 |
+
|
| 235 |
+
if selected_tab == "NFL Updates":
|
| 236 |
+
st.info("NFL updates coming soon!")
|
| 237 |
+
st.write("NFL functionality will be added in a future update.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 238 |
|
| 239 |
+
if selected_tab == "NBA Updates":
|
| 240 |
+
st.info("NBA updates coming soon!")
|
| 241 |
+
st.write("NBA functionality will be added in a future update.")
|
| 242 |
+
|
| 243 |
+
if selected_tab == "MLB Updates":
|
| 244 |
+
st.info("MLB updates coming soon!")
|
| 245 |
+
st.write("MLB functionality will be added in a future update.")
|
| 246 |
+
|
| 247 |
+
# Close Mongonhl_db connection
|
| 248 |
+
client.close()
|