Skip to content

Commit 3522b9b

Browse files
committed
fix: multiple improvements
1 parent b1509cf commit 3522b9b

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

code/util/plot_autotrain_manager.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,13 @@ def plot_manager_all_progress_bokeh_source(
5555
df_to_draw["edge_color"] = ( # Use grey edge to indicate stage without suggestion
5656
df_to_draw["current_stage_suggested"].map(stage_color_mapper).fillna("#d3d3d3")
5757
)
58+
59+
# Convert session_date to string for URL generation
60+
df_to_draw["session_date_str"] = df_to_draw["session_date"].astype(str)
5861
df_to_draw["imgs_1"] = df_to_draw.apply(
5962
lambda x: get_s3_public_url(
6063
subject_id=x["subject_id"],
61-
session_date=x["session_date"],
64+
session_date=x["session_date_str"],
6265
nwb_suffix=x["nwb_suffix"],
6366
figure_suffix="choice_history.png",
6467
),
@@ -67,7 +70,7 @@ def plot_manager_all_progress_bokeh_source(
6770
df_to_draw["imgs_2"] = df_to_draw.apply(
6871
lambda x: get_s3_public_url(
6972
subject_id=x["subject_id"],
70-
session_date=x["session_date"],
73+
session_date=x["session_date_str"],
7174
nwb_suffix=x["nwb_suffix"],
7275
figure_suffix="logistic_regression_Su2022.png",
7376
),

code/util/streamlit.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,11 @@ def add_auto_train_manager():
816816
),
817817
default=True,
818818
)
819-
only_filtered_effective = only_filtered and len(st.session_state.df_session_filtered) < len(st.session_state.df["sessions_main"])
819+
only_filtered_effective = (
820+
only_filtered
821+
and len(st.session_state.df_session_filtered) < len(st.session_state.df["sessions_main"])
822+
and len(st.session_state.df_session_filtered) < 500 # Only if filtered down to less than 500 sessions
823+
)
820824

821825
recent_months = slider_wrapper_for_url_query(cols[6],
822826
label="only recent months",
@@ -888,7 +892,7 @@ def add_auto_train_manager():
888892
"current_stage_actual",
889893
"session_at_current_stage",
890894
"if_overriden_by_trainer",
891-
"foraging_efficiency",
895+
"foraging_eff",
892896
"finished_trials",
893897
"decision",
894898
"next_stage_suggested",

0 commit comments

Comments
 (0)