Skip to content

Commit

Permalink
Address issue with startup error
Browse files Browse the repository at this point in the history
  • Loading branch information
marjoleinvannuland committed Jul 30, 2024
1 parent c48044b commit 8d911c4
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions event_display/interactive_event_display/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ def load_file(n, file_path):
if n > 0 and file_path is not None:
_, num_events = parse_contents(file_path)
return file_path, file_path, 0, num_events
else:
return None, None, None, None


@app.callback(
Expand All @@ -238,7 +240,8 @@ def load_minerva(n, minerva_file_path):
if n > 0 and minerva_file_path is not None:
_, minerva_num_events = parse_minerva_contents(minerva_file_path)
return minerva_file_path, minerva_file_path, 0, minerva_num_events

else:
return None, None, None, None

# Callbacks to handle the event ID and time display
# ==================================================
Expand Down Expand Up @@ -347,12 +350,16 @@ def update_graph(filename, minerva_filename, evid):
"""Update the 3D graph when the event ID is changed"""
if minerva_filename is not None:
minerva_data, _ = parse_minerva_contents(minerva_filename)
else:
minerva_data = None
if filename is not None:
data, _ = parse_contents(filename)
graph, sim_version = create_3d_figure(minerva_data, data, filename, evid)
event_datetime = datetime.utcfromtimestamp(
data["charge/events", evid]["unix_ts"][0]
).strftime("%Y-%m-%d %H:%M:%S")
event_datetime = datetime.utcfromtimestamp(
data["charge/events", evid]["unix_ts"][0]
).strftime("%Y-%m-%d %H:%M:%S")
else:
raise PreventUpdate
return (
graph,
sim_version,
Expand Down

0 comments on commit 8d911c4

Please sign in to comment.