bhoomi19 commited on
Commit
ec63ee0
·
verified ·
1 Parent(s): 885191f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -5
app.py CHANGED
@@ -786,6 +786,7 @@ with tabs[4]:
786
  for rec in analysis_data['recommendations']:
787
  st.write(f"• {rec}")
788
 
 
789
  # Tab 6: OPTIMIZED Future Risk Predictor
790
  # Tab 6: OPTIMIZED Future Risk Predictor
791
  with tabs[5]:
@@ -814,21 +815,28 @@ with tabs[5]:
814
  st.success(f"Risk analysis completed in {end_time - start_time:.1f} seconds")
815
  st.info(summary)
816
 
817
- # Yearly risk metrics - FIXED: Remove delta_color parameter
818
  st.subheader("Risk Timeline")
819
  cols = st.columns(5)
820
  for i, year_data in enumerate(timeline):
821
  with cols[i]:
822
- # Simple metric without delta_color
 
 
 
 
 
 
 
823
  st.metric(
824
- f"Year {year_data['year']}",
825
  f"{year_data['risk_score_0_100']}%",
826
  year_data["risk_level"]
827
  )
828
 
829
- # Detailed view
830
  for year_data in timeline:
831
- with st.expander(f"Year {year_data['year']} Details", key=f"year_{year_data['year']}"):
832
  col1, col2 = st.columns(2)
833
  with col1:
834
  st.write("**Risks:**")
 
786
  for rec in analysis_data['recommendations']:
787
  st.write(f"• {rec}")
788
 
789
+ # Tab 6: OPTIMIZED Future Risk Predictor
790
  # Tab 6: OPTIMIZED Future Risk Predictor
791
  # Tab 6: OPTIMIZED Future Risk Predictor
792
  with tabs[5]:
 
815
  st.success(f"Risk analysis completed in {end_time - start_time:.1f} seconds")
816
  st.info(summary)
817
 
818
+ # Yearly risk metrics
819
  st.subheader("Risk Timeline")
820
  cols = st.columns(5)
821
  for i, year_data in enumerate(timeline):
822
  with cols[i]:
823
+ # Determine badge color based on risk level
824
+ if year_data["risk_level"] == "High":
825
+ badge_color = "🔴"
826
+ elif year_data["risk_level"] == "Medium":
827
+ badge_color = "🟡"
828
+ else:
829
+ badge_color = "🟢"
830
+
831
  st.metric(
832
+ f"Year {year_data['year']} {badge_color}",
833
  f"{year_data['risk_score_0_100']}%",
834
  year_data["risk_level"]
835
  )
836
 
837
+ # Detailed view - FIXED: Remove 'key' parameter from expander
838
  for year_data in timeline:
839
+ with st.expander(f"Year {year_data['year']} Details"):
840
  col1, col2 = st.columns(2)
841
  with col1:
842
  st.write("**Risks:**")