Update app.py
Browse files
app.py
CHANGED
|
@@ -1963,21 +1963,44 @@ def update_scenario_display(scenario_name: str) -> tuple:
|
|
| 1963 |
# ===========================================
|
| 1964 |
# ENHANCED: Combined update function for scenario display + performance metrics
|
| 1965 |
# ===========================================
|
|
|
|
| 1966 |
def update_scenario_display_with_metrics(scenario_name: str) -> tuple:
|
| 1967 |
-
"""
|
| 1968 |
-
|
| 1969 |
-
|
| 1970 |
-
detection_time_html, mttr_html, auto_heal_html, savings_html)
|
| 1971 |
-
"""
|
| 1972 |
-
# Get the scenario display components (5 outputs)
|
| 1973 |
-
scenario_card, telemetry_fig, impact_fig, timeline_fig, realism_html = update_scenario_display(scenario_name)
|
| 1974 |
|
| 1975 |
-
# Get performance metrics (4 outputs)
|
| 1976 |
components = get_components()
|
| 1977 |
-
|
| 1978 |
|
| 1979 |
-
return (scenario_card, telemetry_fig, impact_fig, timeline_fig,
|
| 1980 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1981 |
|
| 1982 |
# ===========================================
|
| 1983 |
# FIXED EXECUTION FUNCTION - Returns DataFrames
|
|
|
|
| 1963 |
# ===========================================
|
| 1964 |
# ENHANCED: Combined update function for scenario display + performance metrics
|
| 1965 |
# ===========================================
|
| 1966 |
+
|
| 1967 |
def update_scenario_display_with_metrics(scenario_name: str) -> tuple:
|
| 1968 |
+
"""Combined update function - doctrinally compliant"""
|
| 1969 |
+
# Get scenario display components (5 outputs)
|
| 1970 |
+
scenario_card, telemetry_fig, impact_fig, timeline_fig, _ = update_scenario_display(scenario_name)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1971 |
|
| 1972 |
+
# Get doctrinally compliant performance metrics (4 outputs)
|
| 1973 |
components = get_components()
|
| 1974 |
+
detection_time, recall_quality, confidence_score, sequencing_stage = components["update_performance_metrics"](scenario_name)
|
| 1975 |
|
| 1976 |
+
return (scenario_card, telemetry_fig, impact_fig, timeline_fig,
|
| 1977 |
+
detection_time, recall_quality, confidence_score, sequencing_stage) # Changed
|
| 1978 |
+
|
| 1979 |
+
# In the create_demo_interface function, update outputs:
|
| 1980 |
+
demo_btn.click(
|
| 1981 |
+
fn=run_complete_demo_async,
|
| 1982 |
+
inputs=[scenario_dropdown],
|
| 1983 |
+
outputs=[
|
| 1984 |
+
scenario_card, telemetry_viz, impact_viz, timeline_viz,
|
| 1985 |
+
detection_time, recall_quality, confidence_score, sequencing_stage, # Changed
|
| 1986 |
+
detection_process, recall_process, decision_process,
|
| 1987 |
+
oss_results_display,
|
| 1988 |
+
enterprise_results_display,
|
| 1989 |
+
approval_display,
|
| 1990 |
+
incident_table,
|
| 1991 |
+
execution_table
|
| 1992 |
+
]
|
| 1993 |
+
)
|
| 1994 |
+
|
| 1995 |
+
# In the scenario_dropdown.change handler:
|
| 1996 |
+
scenario_dropdown.change(
|
| 1997 |
+
fn=update_scenario_display_with_metrics,
|
| 1998 |
+
inputs=[scenario_dropdown],
|
| 1999 |
+
outputs=[
|
| 2000 |
+
scenario_card, telemetry_viz, impact_viz, timeline_viz,
|
| 2001 |
+
detection_time, recall_quality, confidence_score, sequencing_stage # Changed
|
| 2002 |
+
]
|
| 2003 |
+
)
|
| 2004 |
|
| 2005 |
# ===========================================
|
| 2006 |
# FIXED EXECUTION FUNCTION - Returns DataFrames
|