refactor: remove erosion radio buttons and FMP API testing section from navbar
This commit is contained in:
parent
7db493893e
commit
5775d25e72
@ -1427,7 +1427,6 @@ def test_fmp_connection() -> bool:
|
|||||||
logger.info(f"FMP API call count: {st.session_state.api_calls}")
|
logger.info(f"FMP API call count: {st.session_state.api_calls}")
|
||||||
|
|
||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
st.success("Successfully connected to FMP API")
|
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
st.error(f"Failed to connect to FMP API: {response.status_code}")
|
st.error(f"Failed to connect to FMP API: {response.status_code}")
|
||||||
@ -1866,23 +1865,15 @@ with st.sidebar:
|
|||||||
index=1
|
index=1
|
||||||
)
|
)
|
||||||
|
|
||||||
# Erosion options
|
|
||||||
enable_erosion = st.radio(
|
|
||||||
"Enable NAV & Yield Erosion",
|
|
||||||
["Yes", "No"],
|
|
||||||
index=1
|
|
||||||
)
|
|
||||||
|
|
||||||
# Run simulation button
|
# Run simulation button
|
||||||
if st.button("Run Portfolio Simulation", type="primary", use_container_width=True):
|
if st.button("Run Portfolio Simulation", type="primary", use_container_width=True):
|
||||||
if not st.session_state.etf_allocations:
|
if not st.session_state.etf_allocations:
|
||||||
st.error("Please add at least one ETF to your portfolio.")
|
st.error("Please add at least one ETF to your portfolio.")
|
||||||
else:
|
else:
|
||||||
try:
|
# Store simulation parameters in session state
|
||||||
# Store parameters in session state
|
|
||||||
st.session_state.mode = simulation_mode
|
st.session_state.mode = simulation_mode
|
||||||
st.session_state.enable_drip = enable_drip == "Yes"
|
st.session_state.enable_drip = enable_drip == "Yes"
|
||||||
st.session_state.enable_erosion = enable_erosion == "Yes"
|
st.session_state.enable_erosion = True
|
||||||
|
|
||||||
if simulation_mode == "Income Target":
|
if simulation_mode == "Income Target":
|
||||||
st.session_state.target = monthly_target
|
st.session_state.target = monthly_target
|
||||||
@ -1919,11 +1910,6 @@ with st.sidebar:
|
|||||||
else:
|
else:
|
||||||
st.error("Failed to fetch ETF data. Please check your tickers and try again.")
|
st.error("Failed to fetch ETF data. Please check your tickers and try again.")
|
||||||
|
|
||||||
except Exception as e:
|
|
||||||
st.error(f"Error running simulation: {str(e)}")
|
|
||||||
logger.error(f"Error in simulation: {str(e)}")
|
|
||||||
logger.error(traceback.format_exc())
|
|
||||||
|
|
||||||
# Add reset simulation button at the bottom of sidebar
|
# Add reset simulation button at the bottom of sidebar
|
||||||
if st.button("🔄 Reset Simulation", use_container_width=True, type="secondary"):
|
if st.button("🔄 Reset Simulation", use_container_width=True, type="secondary"):
|
||||||
reset_simulation()
|
reset_simulation()
|
||||||
@ -1983,12 +1969,6 @@ with st.sidebar:
|
|||||||
parallel_processing = st.checkbox("Enable Parallel Processing", value=True,
|
parallel_processing = st.checkbox("Enable Parallel Processing", value=True,
|
||||||
help="Fetch data for multiple ETFs simultaneously")
|
help="Fetch data for multiple ETFs simultaneously")
|
||||||
|
|
||||||
# Add FMP API test button
|
|
||||||
st.sidebar.subheader("FMP API Testing")
|
|
||||||
if st.sidebar.button("Test FMP API", key="test_fmp_api_button"):
|
|
||||||
test_fmp_data_fetching()
|
|
||||||
st.sidebar.success("Test completed. Check logs for details.")
|
|
||||||
|
|
||||||
# Display results and interactive allocation adjustment UI after simulation is run
|
# Display results and interactive allocation adjustment UI after simulation is run
|
||||||
if st.session_state.simulation_run and st.session_state.df_data is not None:
|
if st.session_state.simulation_run and st.session_state.df_data is not None:
|
||||||
df = st.session_state.df_data
|
df = st.session_state.df_data
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user