Skip to content

Commit

Permalink
fixes for new status types
Browse files Browse the repository at this point in the history
  • Loading branch information
brandomr committed Oct 24, 2023
1 parent e834520 commit f154cf7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
19 changes: 14 additions & 5 deletions dashboard/sections.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,18 @@ def highlight_empty(val):

def render_scenario_viewer(scenarios):
st.write(f"### Scenario Viewer")
st.write(">**Note**: tasks marked as grey were not run due to an upstream failure.")
scenario_name = st.selectbox("Select a pipeline:", sorted(list(scenarios.keys())))
scenario = scenarios[scenario_name]

graph = nx.DiGraph()
steps = scenario["steps"]
total_time = 0
for step_name, step_details in steps.items():
# Check if the success value is "N/A" and skip this iteration
if step_details["success"] == "N/A":
continue

total_time += step_details["time"] if step_details["time"] is not None else 0
if step_details["success"] is not None:
status_color = 'green' if step_details['success'] else 'red'
Expand All @@ -31,7 +36,9 @@ def render_scenario_viewer(scenarios):
graph.add_node(step_name, color=status_color)
shape = scenario["shape"]
for link in shape:
graph.add_edge(link["from"], link["to"])
# Ensure both nodes exist before adding an edge
if link["from"] in graph.nodes and link["to"] in graph.nodes:
graph.add_edge(link["from"], link["to"])
nx.set_node_attributes(graph, "box", "shape")
pipeline = Network(notebook=False, directed=True)
pipeline.from_nx(graph)
Expand All @@ -47,9 +54,8 @@ def render_scenario_viewer(scenarios):
display = pipeline.generate_html()


st.write(f"### {scenario_name}")
st.text(scenario["description"])
st.metric("Total Time", round(total_time,2))
st.write(f"**Scenario description**: `{scenario['description']}`")
st.write(f"**Total Time** `{round(total_time,2)}`")
components.html(display, height=800, width=800)


Expand Down Expand Up @@ -83,8 +89,11 @@ def get_feature_table(scenarios, feature):

def render_section_integration_status(scenarios):
st.write(f"### Integration Status")
st.write(">**Note**: tasks are marked with a ✅ if they succeed and a ❌ if they fail. "\
"⚪ indicates that a task was not run due to an upstream task failure. "\
"Empty cells indicate that a task was not applicable/relevant to a given scenario.")
df = get_feature_table(scenarios, "success")
df.replace({False: "❌", True: "✅", None: ""}, inplace=True)
df.replace({False: "❌", True: "✅", "N/A": "", None: ""}, inplace=True)
st.dataframe(df)

def render_section_time(scenarios):
Expand Down
6 changes: 0 additions & 6 deletions dashboard/ui/Home.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,4 @@
Terarium regularly uploads new reports to S3. See [here](https://github.com/DARPA-ASKEM/simulation-integration)
to add TA1 scenarios and [here](https://github.com/DARPA-ASKEM/simulation-integration) for TA3.
"""

st.sidebar.markdown("""
Integration Dashboard
Homepage for the Integration Dashboard
""")

5 changes: 4 additions & 1 deletion dashboard/ui/pages/1_TA1.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@

services = report["services"]
st.write("## Service Info")
st.write(">**Note**: if the `Version` for any service is unavailable it indicates that the report"\
"runner was unable to communicate with the service. In that case, substantial failures"\
"are expected across the board.")
service_names = list(services.keys())
service_data = {
"Service": service_names,
Expand All @@ -48,4 +51,4 @@
render_section_time(scenarios)
render_section_accuracy(scenarios)
render_section_errors(scenarios)
render_scenario_viewer(scenarios)
render_scenario_viewer(scenarios)

0 comments on commit f154cf7

Please sign in to comment.