Spaces:
Running
Running
final version
Browse files
streamlit_simulation/app.py
CHANGED
@@ -247,11 +247,11 @@ def render_simulation_view(timestamp, prediction, actual, progress, fig, paused=
|
|
247 |
plot_container.pyplot(fig)
|
248 |
|
249 |
#st.markdown("<div style='margin-bottom: 0.5rem;'></div>", unsafe_allow_html=True)
|
250 |
-
x_axis_label.markdown(
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
)
|
255 |
|
256 |
with info_container.container():
|
257 |
st.markdown("<div style='margin-top: 5rem;'></div>", unsafe_allow_html=True)
|
@@ -305,20 +305,18 @@ max_date = test_df_full["date"].max().date()
|
|
305 |
|
306 |
# ============================== UI Controls ==============================
|
307 |
|
308 |
-
st.
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
st.markdown("**General Settings**")
|
313 |
model_choice = st.selectbox("Choose prediction model", ["LightGBM", "Transformer Model (moments)"])
|
314 |
if model_choice == "Transformer Model (moments)":
|
315 |
st.caption("⚠️ Note: Transformer model runs slower without GPU. (Use Speed = 10)")
|
316 |
window_days = st.selectbox("Display window (days)", options=[3, 5, 7], index=0)
|
317 |
window_hours = window_days * 24
|
318 |
speed = st.slider("Speed", 1, 10, 5)
|
319 |
-
|
320 |
-
|
321 |
-
st.markdown(f"**Date Range** (from {min_date} to {max_date})")
|
322 |
start_date = st.date_input("Start Date", value=min_date, min_value=min_date, max_value=max_date)
|
323 |
end_date = st.date_input("End Date", value=max_date, min_value=min_date, max_value=max_date)
|
324 |
|
@@ -337,14 +335,14 @@ total_steps_ui = len(test_df_filtered)
|
|
337 |
# ============================== Buttons ==============================
|
338 |
|
339 |
st.markdown("### Start Simulation")
|
340 |
-
col1, col2, col3 = st.columns([1, 1,
|
341 |
with col1:
|
342 |
play_pause_text = "▶️ Start" if not st.session_state.is_running else "⏸️ Pause"
|
343 |
-
if st.button(play_pause_text):
|
344 |
st.session_state.is_running = not st.session_state.is_running
|
345 |
st.rerun()
|
346 |
with col2:
|
347 |
-
reset_button = st.button("🔄 Reset")
|
348 |
|
349 |
# Reset logic
|
350 |
if reset_button:
|
|
|
247 |
plot_container.pyplot(fig)
|
248 |
|
249 |
#st.markdown("<div style='margin-bottom: 0.5rem;'></div>", unsafe_allow_html=True)
|
250 |
+
#x_axis_label.markdown(
|
251 |
+
# f"<div style='text-align: center; font-size: 14pt; color: {TEXT_COLOR}; margin-top: -0.5rem;'>"
|
252 |
+
# f"Time</div>",
|
253 |
+
# unsafe_allow_html=True
|
254 |
+
#)
|
255 |
|
256 |
with info_container.container():
|
257 |
st.markdown("<div style='margin-top: 5rem;'></div>", unsafe_allow_html=True)
|
|
|
305 |
|
306 |
# ============================== UI Controls ==============================
|
307 |
|
308 |
+
with st.sidebar:
|
309 |
+
st.header("⚙️ Simulation Settings")
|
310 |
+
|
311 |
+
st.subheader("General Settings")
|
|
|
312 |
model_choice = st.selectbox("Choose prediction model", ["LightGBM", "Transformer Model (moments)"])
|
313 |
if model_choice == "Transformer Model (moments)":
|
314 |
st.caption("⚠️ Note: Transformer model runs slower without GPU. (Use Speed = 10)")
|
315 |
window_days = st.selectbox("Display window (days)", options=[3, 5, 7], index=0)
|
316 |
window_hours = window_days * 24
|
317 |
speed = st.slider("Speed", 1, 10, 5)
|
318 |
+
|
319 |
+
st.subheader("Date Range")
|
|
|
320 |
start_date = st.date_input("Start Date", value=min_date, min_value=min_date, max_value=max_date)
|
321 |
end_date = st.date_input("End Date", value=max_date, min_value=min_date, max_value=max_date)
|
322 |
|
|
|
335 |
# ============================== Buttons ==============================
|
336 |
|
337 |
st.markdown("### Start Simulation")
|
338 |
+
col1, col2, col3 = st.columns([1, 1, 4])
|
339 |
with col1:
|
340 |
play_pause_text = "▶️ Start" if not st.session_state.is_running else "⏸️ Pause"
|
341 |
+
if st.button(play_pause_text, use_container_width=True):
|
342 |
st.session_state.is_running = not st.session_state.is_running
|
343 |
st.rerun()
|
344 |
with col2:
|
345 |
+
reset_button = st.button("🔄 Reset", use_container_width=True)
|
346 |
|
347 |
# Reset logic
|
348 |
if reset_button:
|
streamlit_simulation/config_streamlit.py
CHANGED
@@ -20,7 +20,7 @@ BUTTON_HOVER_BG = "#cbd9e6" # Hover color for buttons
|
|
20 |
BG_COLOR = "#ffffff" # Page background
|
21 |
INPUT_BG = "#f2f6fa" # Background for select boxes, inputs
|
22 |
PROGRESS_COLOR = "#0077B6" # Progress bar color
|
23 |
-
PLOT_COLOR = "
|
24 |
|
25 |
# Constants
|
26 |
TRAIN_RATIO = 0.7 # Train/test split ratio used by both models
|
|
|
20 |
BG_COLOR = "#ffffff" # Page background
|
21 |
INPUT_BG = "#f2f6fa" # Background for select boxes, inputs
|
22 |
PROGRESS_COLOR = "#0077B6" # Progress bar color
|
23 |
+
PLOT_COLOR = "#edf1f7" # Plot background color
|
24 |
|
25 |
# Constants
|
26 |
TRAIN_RATIO = 0.7 # Train/test split ratio used by both models
|