Skip to content

Commit

Permalink
fix: fixing a bug causing dictionaries to crash
Browse files Browse the repository at this point in the history
  • Loading branch information
dbirman committed Nov 26, 2024
1 parent 9923861 commit cd3e89f
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/aind_qc_portal/panel/metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,13 @@ def metric_panel(self):
for v in value.values()
]
):
auto_value = True
df = pd.DataFrame(value)
value_widget = pn.pane.DataFrame(df)
elif all([isinstance(v, str) or isinstance(v, int) or isinstance(v, float) for v in value.values()]):
auto_value = True
df = pd.DataFrame([value])
value_widget = pn.pane.DataFrame(df)
else:
try:
custom_value = CustomMetricValue(
Expand All @@ -159,10 +164,14 @@ def metric_panel(self):
options=["Pass", "Fail", "Pending"],
name="Metric status",
)
if auto_state:

if pn.state.user == "guest":
self.state_selector.disabled = True
else:
self.state_selector.param.watch(self.set_status, "value")
if auto_state:
self.state_selector.disabled = True
else:
self.state_selector.param.watch(self.set_status, "value")

header = pn.pane.Markdown(md)

Expand Down

0 comments on commit cd3e89f

Please sign in to comment.