Skip to content

Commit 984b032

Browse files
committed
.
1 parent 52ca534 commit 984b032

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

behavior_data_visualizer/utils.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ def display_click_data(clickData, df):
4242
return 'No date selected'
4343
# select the dataset
4444
sdf = df[df['year_month_day'] == date]
45-
return ut.get_text_from_subset_df(sdf)
45+
try:
46+
text_to_return = ut.get_text_from_subset_df(sdf)
47+
except:
48+
text_to_return = 'Error retrieving data'
49+
return text_to_return
4650

4751
# # Update the performance figure
4852
# @app.callback(
@@ -60,6 +64,8 @@ def update_performance_figure(clickData, df):
6064
sdf = dft.get_performance_through_trials(sdf, window=50)
6165
# find the index of the session changes and add as vertical lines to the performance plot
6266
session_changes = sdf[sdf.session != sdf.session.shift(1)].index
67+
if "stimulus_modality" not in sdf.columns:
68+
sdf['stimulus_modality'] = 'unknown'
6369
fig = px.scatter(
6470
sdf,
6571
x='total_trial',

0 commit comments

Comments
 (0)