diff --git a/code/Home.py b/code/Home.py index b900e2d..fe12212 100644 --- a/code/Home.py +++ b/code/Home.py @@ -76,6 +76,8 @@ 'x_y_plot_dot_size': 10, 'x_y_plot_dot_opacity': 0.5, 'x_y_plot_line_width': 2.0, + + 'session_plot_mode': 'sessions selected from table or plot', 'auto_training_history_x_axis': 'date', 'auto_training_history_sort_by': 'subject_id', @@ -240,7 +242,7 @@ def draw_session_plots(df_to_draw_session): except: date_str = key["session_date"].split("T")[0] - st.markdown(f'''

{key["h2o"]}, Session {key["session"]}, {date_str}''', + st.markdown(f'''

{key["h2o"]}, Session {int(key["session"])}, {date_str}''', unsafe_allow_html=True) if len(st.session_state.selected_draw_types) > 1: # more than one types, use the pre-defined layout for row, column_setting in enumerate(layout_definition): @@ -314,11 +316,18 @@ def draw_mice_plots(df_to_draw_mice): def session_plot_settings(need_click=True): st.markdown('##### Show plots for individual sessions ') cols = st.columns([2, 1]) + + session_plot_modes = [f'sessions selected from table or plot', f'all sessions filtered from sidebar'] st.session_state.selected_draw_sessions = cols[0].selectbox('Which session(s) to draw?', - [f'selected from table/plot ({len(st.session_state.df_selected_from_plotly)} sessions)', - f'filtered from sidebar ({len(st.session_state.df_session_filtered)} sessions)'], - index=0 - ) + session_plot_modes, + index=session_plot_modes.index(st.session_state['session_plot_mode']) + if 'session_plot_mode' in st.session_state else + session_plot_modes.index(st.query_params['session_plot_mode']) + if 'session_plot_mode' in st.query_params + else 0, + key='session_plot_mode', + ) + st.session_state.num_cols = cols[1].number_input('Number of columns', 1, 10, 3 if 'num_cols' not in st.session_state else st.session_state.num_cols) @@ -515,20 +524,35 @@ def init(): # Some ad-hoc modifications on df_sessions st.session_state.df['sessions_bonsai'].columns = st.session_state.df['sessions_bonsai'].columns.get_level_values(1) + st.session_state.df['sessions_bonsai'].sort_values(['session_end_time'], ascending=False, inplace=True) st.session_state.df['sessions_bonsai'] = st.session_state.df['sessions_bonsai'].reset_index().query('subject_id != "0"') st.session_state.df['sessions_bonsai']['h2o'] = st.session_state.df['sessions_bonsai']['subject_id'] st.session_state.df['sessions_bonsai'].dropna(subset=['session'], inplace=True) # Remove rows with no session number (only leave the nwb file with the largest finished_trials for now) + st.session_state.df['sessions_bonsai'].drop(st.session_state.df['sessions_bonsai'].query('session < 1').index, inplace=True) # # add something else - # st.session_state.df['sessions_bonsai']['abs(bias)'] = np.abs(st.session_state.df['sessions_bonsai'].biasL) - + # add abs(bais) to all terms that have 'bias' in name + for col in st.session_state.df['sessions_bonsai'].columns: + if 'bias' in col: + st.session_state.df['sessions_bonsai'][f'abs({col})'] = np.abs(st.session_state.df['sessions_bonsai'][col]) + # # delta weight # diff_relative_weight_next_day = st.session_state.df['sessions_bonsai'].set_index( # ['session']).sort_values('session', ascending=True).groupby('h2o').apply( # lambda x: - x.relative_weight.diff(periods=-1)).rename("diff_relative_weight_next_day") # weekday - # st.session_state.df['sessions_bonsai']['weekday'] = st.session_state.df['sessions_bonsai'].session_date.dt.dayofweek + 1 + st.session_state.df['sessions_bonsai'].session_date = pd.to_datetime(st.session_state.df['sessions_bonsai'].session_date) + st.session_state.df['sessions_bonsai']['weekday'] = st.session_state.df['sessions_bonsai'].session_date.dt.day_name() + + # foraging performance = foraing_eff * finished_rate + if 'foraging_performance' not in st.session_state.df['sessions_bonsai'].columns: + st.session_state.df['sessions_bonsai']['foraging_performance'] = \ + st.session_state.df['sessions_bonsai']['foraging_eff'] \ + * st.session_state.df['sessions_bonsai']['finished_rate'] + st.session_state.df['sessions_bonsai']['foraging_performance_random_seed'] = \ + st.session_state.df['sessions_bonsai']['foraging_eff_random_seed'] \ + * st.session_state.df['sessions_bonsai']['finished_rate'] # st.session_state.df['sessions_bonsai'] = st.session_state.df['sessions_bonsai'].merge( # diff_relative_weight_next_day, how='left', on=['h2o', 'session']) @@ -563,7 +587,7 @@ def app(): if st.button('Reload data from AWS S3'): st.cache_data.clear() init() - st.experimental_rerun() + st.rerun() @@ -575,11 +599,11 @@ def app(): cols = st.columns([2, 2, 2]) cols[0].markdown(f'### Filter the sessions on the sidebar ({len(st.session_state.df_session_filtered)} filtered)') # if cols[1].button('Press this and then Ctrl + R to reload from S3'): - # st.experimental_rerun() + # st.rerun() if cols[1].button('Reload data '): st.cache_data.clear() init() - st.experimental_rerun() + st.rerun() # aggrid_outputs = aggrid_interactive_table_units(df=df['ephys_units']) # st.session_state.df_session_filtered = aggrid_outputs['data'] @@ -599,7 +623,7 @@ def app(): st.session_state.df_selected_from_dataframe = pd.DataFrame(aggrid_outputs['selected_rows']) st.session_state.df_selected_from_plotly = st.session_state.df_selected_from_dataframe # Sync selected on plotly # if st.session_state.tab_id == "tab_session_x_y": - st.experimental_rerun() + st.rerun() chosen_id = stx.tab_bar(data=[ stx.TabBarItemData(id="tab_session_x_y", title="📈 Session X-Y plot", description="Interactive session-wise scatter plot"), @@ -632,7 +656,7 @@ def app(): st.session_state.df_selected_from_plotly.set_index(['h2o', 'session']).index): st.session_state.df_selected_from_plotly = df_selected_from_plotly st.session_state.df_selected_from_dataframe = df_selected_from_plotly # Sync selected on dataframe - st.experimental_rerun() + st.rerun() elif chosen_id == "tab_pygwalker": with placeholder: @@ -667,10 +691,11 @@ def app(): elif chosen_id == "tab_session_inspector": with placeholder: - with st.columns([4, 10])[0]: + cols = st.columns([6, 3, 7]) + with cols[0]: if_draw_all_sessions = session_plot_settings(need_click=False) df_to_draw_sessions = st.session_state.df_selected_from_plotly if 'selected' in st.session_state.selected_draw_sessions else st.session_state.df_session_filtered - + if if_draw_all_sessions and len(df_to_draw_sessions): draw_session_plots(df_to_draw_sessions) diff --git a/code/pages/1_Old mice.py b/code/pages/1_Old mice.py index 5f506fc..cf910ec 100644 --- a/code/pages/1_Old mice.py +++ b/code/pages/1_Old mice.py @@ -24,6 +24,7 @@ import extra_streamlit_components as stx from aind_auto_train.auto_train_manager import DynamicForagingAutoTrainManager +from pygwalker.api.streamlit import StreamlitRenderer, init_streamlit_comm # Sync widgets with URL query params @@ -486,6 +487,7 @@ def init(): df_this_model = st.session_state.df['model_fitting_params'].query(f'model_id == {selected_id}') valid_field = df_this_model.columns[~np.all(~df_this_model.notna(), axis=0)] to_add_model = st.session_state.df['model_fitting_params'].query(f'model_id == {selected_id}')[valid_field] + st.session_state.df['sessions'].drop(st.session_state.df['sessions'].query('session < 1').index, inplace=True) st.session_state.df['sessions'] = st.session_state.df['sessions'].merge(to_add_model, on=('subject_id', 'session'), how='left') @@ -497,6 +499,12 @@ def init(): ['session']).sort_values('session', ascending=True).groupby('h2o').apply( lambda x: - x.relative_weight.diff(periods=-1)).rename("diff_relative_weight_next_day") + # foraging performance = foraing_eff * finished_ratio + if 'foraging_performance' not in st.session_state.df['sessions'].columns: + st.session_state.df['sessions']['foraging_performance'] = \ + st.session_state.df['sessions']['foraging_eff'] \ + * (1 - st.session_state.df['sessions']['ignore_rate']) + # weekday st.session_state.df['sessions']['weekday'] = st.session_state.df['sessions'].session_date.dt.dayofweek + 1 @@ -505,7 +513,9 @@ def init(): st.session_state.session_stats_names = [keys for keys in st.session_state.df['sessions'].keys()] - +@st.cache_resource(ttl=24*3600) +def get_pyg_renderer(df, spec="./gw_config.json", **kwargs) -> "StreamlitRenderer": + return StreamlitRenderer(df, spec=spec, debug=False, **kwargs) def app(): @@ -524,7 +534,7 @@ def app(): if st.button('Reload data from AWS S3'): st.cache_data.clear() init() - st.experimental_rerun() + st.rerun() @@ -536,11 +546,11 @@ def app(): cols = st.columns([2, 2, 2]) cols[0].markdown(f'### Filter the sessions on the sidebar ({len(st.session_state.df_session_filtered)} filtered)') # if cols[1].button('Press this and then Ctrl + R to reload from S3'): - # st.experimental_rerun() + # st.rerun() if cols[1].button('Reload data '): st.cache_data.clear() init() - st.experimental_rerun() + st.rerun() # aggrid_outputs = aggrid_interactive_table_units(df=df['ephys_units']) # st.session_state.df_session_filtered = aggrid_outputs['data'] @@ -560,11 +570,12 @@ def app(): st.session_state.df_selected_from_dataframe = pd.DataFrame(aggrid_outputs['selected_rows']) st.session_state.df_selected_from_plotly = st.session_state.df_selected_from_dataframe # Sync selected on plotly # if st.session_state.tab_id == "tab_session_x_y": - st.experimental_rerun() + st.rerun() chosen_id = stx.tab_bar(data=[ stx.TabBarItemData(id="tab_session_x_y", title="📈 Session X-Y plot", description="Interactive session-wise scatter plot"), stx.TabBarItemData(id="tab_session_inspector", title="👀 Session Inspector", description="Select sessions from the table and show plots"), + stx.TabBarItemData(id="tab_pygwalker", title="📊 PyGWalker (Tableau)", description="Interactive dataframe explorer"), stx.TabBarItemData(id="tab_auto_train_history", title="🎓 Automatic Training History", description="Track progress"), stx.TabBarItemData(id="tab_mouse_inspector", title="🐭 Mouse Model Fitting", description="Mouse-level model fitting results"), ], default="tab_session_inspector" if 'tab_id' not in st.session_state else st.session_state.tab_id) @@ -591,7 +602,7 @@ def app(): st.session_state.df_selected_from_plotly.set_index(['h2o', 'session']).index): st.session_state.df_selected_from_plotly = df_selected_from_plotly st.session_state.df_selected_from_dataframe = df_selected_from_plotly # Sync selected on dataframe - st.experimental_rerun() + st.rerun() elif chosen_id == "tab_session_inspector": st.session_state.tab_id = chosen_id @@ -602,6 +613,38 @@ def app(): if if_draw_all_sessions and len(df_to_draw_sessions): draw_session_plots(df_to_draw_sessions) + + elif chosen_id == "tab_pygwalker": + with placeholder: + cols = st.columns([1, 4]) + cols[0].markdown('##### Exploring data using [PyGWalker](https://docs.kanaries.net/pygwalker)') + with cols[1]: + with st.expander('Specify PyGWalker json'): + # Load json from ./gw_config.json + pyg_user_json = st.text_area("Export your plot settings to json by clicking `export_code` " + "button below and then paste your json here to reproduce your plots", + key='pyg_walker', height=100) + + # If pyg_user_json is not empty, use it; otherwise, use the default gw_config.json + if pyg_user_json: + try: + pygwalker_renderer = get_pyg_renderer( + df=st.session_state.df_session_filtered, + spec=pyg_user_json, + ) + except: + pygwalker_renderer = get_pyg_renderer( + df=st.session_state.df_session_filtered, + spec="./gw_config_old_mice.json", + ) + else: + pygwalker_renderer = get_pyg_renderer( + df=st.session_state.df_session_filtered, + spec="./gw_config_old_mice.json", + ) + + pygwalker_renderer.render_explore(height=1010, scrolling=False) + elif chosen_id == "tab_auto_train_history": # Automatic training history st.session_state.tab_id = chosen_id diff --git a/code/util/streamlit.py b/code/util/streamlit.py index 277db5b..7a87339 100644 --- a/code/util/streamlit.py +++ b/code/util/streamlit.py @@ -54,7 +54,10 @@ def aggrid_interactive_table_session(df: pd.DataFrame): options.configure_side_bar() - df = df.sort_values('session_date', ascending=False) + if 'session_end_time' in df.columns: + df = df.sort_values('session_end_time', ascending=False) + else: + df = df.sort_values('session_date', ascending=False) # preselect if (('df_selected_from_dataframe' in st.session_state and len(st.session_state.df_selected_from_dataframe)) @@ -390,7 +393,7 @@ def add_session_filter(if_bonsai=False, url_query={}): def add_xy_selector(if_bonsai): with st.expander("Select axes", expanded=True): # with st.form("axis_selection"): - cols = st.columns([1, 1, 1]) + cols = st.columns([1]) x_name = cols[0].selectbox("x axis", st.session_state.session_stats_names, index=st.session_state.session_stats_names.index(st.session_state['x_y_plot_xname']) @@ -400,7 +403,7 @@ def add_xy_selector(if_bonsai): else st.session_state.session_stats_names.index('session'), key='x_y_plot_xname' ) - y_name = cols[1].selectbox("y axis", + y_name = cols[0].selectbox("y axis", st.session_state.session_stats_names, index=st.session_state.session_stats_names.index(st.session_state['x_y_plot_yname']) if 'x_y_plot_yname' in st.session_state else @@ -410,12 +413,12 @@ def add_xy_selector(if_bonsai): key='x_y_plot_yname') if if_bonsai: - options = ['h2o', 'task', 'user_name', 'rig'] + options = ['h2o', 'task', 'user_name', 'rig', 'weekday'] else: options = ['h2o', 'task', 'photostim_location', 'weekday', 'headbar', 'user_name', 'sex', 'rig'] - group_by = cols[2].selectbox("grouped by", + group_by = cols[0].selectbox("grouped by", options=options, index=options.index(st.session_state['x_y_plot_group_by']) if 'x_y_plot_group_by' in st.session_state else @@ -574,7 +577,7 @@ def data_selector(): # if cols[1].button('❌'): # st.session_state.df_selected_from_dataframe = pd.DataFrame() - # st.experimental_rerun() + # st.rerun() cols = st.columns([5, 1, 1]) with cols[0].expander(f"Selected: {len(st.session_state.df_selected_from_plotly)} sessions, " @@ -582,13 +585,13 @@ def data_selector(): st.dataframe(st.session_state.df_selected_from_plotly) if cols[1].button('all'): st.session_state.df_selected_from_plotly = st.session_state.df_session_filtered - st.experimental_rerun() + st.rerun() if cols[2].button('❌ '): st.session_state.df_selected_from_plotly = pd.DataFrame(columns=['h2o', 'session']) st.session_state.df_selected_from_dataframe = pd.DataFrame(columns=['h2o', 'session']) - st.experimental_rerun() + st.rerun() def add_auto_train_manager(): diff --git a/gw_config_old_mice.json b/gw_config_old_mice.json new file mode 100644 index 0000000..f0057dc --- /dev/null +++ b/gw_config_old_mice.json @@ -0,0 +1,822 @@ +[ + { + "config": { + "defaultAggregated": false, + "geoms": [ + "boxplot" + ], + "coordSystem": "generic", + "limit": -1, + "timezoneDisplayOffset": 0 + }, + "encodings": { + "dimensions": [ + { + "dragId": "gw_uz5A", + "fid": "session_date", + "name": "session_date", + "basename": "session_date", + "semanticType": "temporal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_Ue21", + "fid": "h2o", + "name": "h2o", + "basename": "h2o", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_93uv", + "fid": "photostim", + "name": "photostim", + "basename": "photostim", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_2lYH", + "fid": "task", + "name": "task", + "basename": "task", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_3nIH", + "fid": "rig", + "name": "rig", + "basename": "rig", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_5E9q", + "fid": "sex", + "name": "sex", + "basename": "sex", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_DkN-", + "fid": "ephys_ins", + "name": "ephys_ins", + "basename": "ephys_ins", + "semanticType": "quantitative", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_tXjQ", + "fid": "histology", + "name": "histology", + "basename": "histology", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_8fDq", + "fid": "photostim_NI", + "name": "photostim_NI", + "basename": "photostim_NI", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_6ptm", + "fid": "user_name", + "name": "user_name", + "basename": "user_name", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_6XYE", + "fid": "photostim_location", + "name": "photostim_location", + "basename": "photostim_location", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_OgKh", + "fid": "photostim_aligned_to", + "name": "photostim_aligned_to", + "basename": "photostim_aligned_to", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_A6wd", + "fid": "bpod_timer_offset", + "name": "bpod_timer_offset", + "basename": "bpod_timer_offset", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_5VMu", + "fid": "not_pretrain", + "name": "not_pretrain", + "basename": "not_pretrain", + "semanticType": "quantitative", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_ZamT", + "fid": "headbar", + "name": "headbar", + "basename": "headbar", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_Kiu7", + "fid": "weekday", + "name": "weekday", + "basename": "weekday", + "semanticType": "quantitative", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_mea_key_fid", + "fid": "gw_mea_key_fid", + "name": "Measure names", + "analyticType": "dimension", + "semanticType": "nominal" + } + ], + "measures": [ + { + "dragId": "gw_F8cM", + "fid": "session", + "name": "session", + "basename": "session", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_tLuM", + "fid": "subject_id", + "name": "subject_id", + "basename": "subject_id", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_zAPk", + "fid": "finished_trials", + "name": "finished_trials", + "basename": "finished_trials", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_PVgs", + "fid": "foraging_eff", + "name": "foraging_eff", + "basename": "foraging_eff", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_Blod", + "fid": "start_weight", + "name": "start_weight", + "basename": "start_weight", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_FWjF", + "fid": "session_weight", + "name": "session_weight", + "basename": "session_weight", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_C5BJ", + "fid": "time_in_day", + "name": "time_in_day", + "basename": "time_in_day", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_195b", + "fid": "water_earned", + "name": "water_earned", + "basename": "water_earned", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_RtDl", + "fid": "water_extra", + "name": "water_extra", + "basename": "water_extra", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw__TMp", + "fid": "photostim_power_median", + "name": "photostim_power_median", + "basename": "photostim_power_median", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_ur7q", + "fid": "photostim_ramping_down", + "name": "photostim_ramping_down", + "basename": "photostim_ramping_down", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_xGVR", + "fid": "photostim_trials", + "name": "photostim_trials", + "basename": "photostim_trials", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_hvgF", + "fid": "photostim_interval_mean", + "name": "photostim_interval_mean", + "basename": "photostim_interval_mean", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_E7TM", + "fid": "total_trials", + "name": "total_trials", + "basename": "total_trials", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_EgJL", + "fid": "block_num", + "name": "block_num", + "basename": "block_num", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_cy9N", + "fid": "reward_trials", + "name": "reward_trials", + "basename": "reward_trials", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_VedB", + "fid": "early_lick_ratio", + "name": "early_lick_ratio", + "basename": "early_lick_ratio", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_eGTl", + "fid": "autowater_num", + "name": "autowater_num", + "basename": "autowater_num", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_GPn2", + "fid": "double_dipping_ratio", + "name": "double_dipping_ratio", + "basename": "double_dipping_ratio", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_mLVr", + "fid": "mean_reward_sum", + "name": "mean_reward_sum", + "basename": "mean_reward_sum", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_rDhh", + "fid": "mean_reward_contrast", + "name": "mean_reward_contrast", + "basename": "mean_reward_contrast", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_Gqin", + "fid": "reward_rate", + "name": "reward_rate", + "basename": "reward_rate", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_tm3u", + "fid": "miss_rate", + "name": "miss_rate", + "basename": "miss_rate", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_jTFj", + "fid": "ignore_rate", + "name": "ignore_rate", + "basename": "ignore_rate", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_gH6i", + "fid": "block_length", + "name": "block_length", + "basename": "block_length", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_AM_S", + "fid": "valid_trial_start", + "name": "valid_trial_start", + "basename": "valid_trial_start", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_dlIo", + "fid": "valid_trial_end", + "name": "valid_trial_end", + "basename": "valid_trial_end", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_Zyyd", + "fid": "valid_ratio", + "name": "valid_ratio", + "basename": "valid_ratio", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_2VWl", + "fid": "photostim_trial_ratio", + "name": "photostim_trial_ratio", + "basename": "photostim_trial_ratio", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_YsRU", + "fid": "age_in_weeks", + "name": "age_in_weeks", + "basename": "age_in_weeks", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_N-7l", + "fid": "session_length_in_hrs", + "name": "session_length_in_hrs", + "basename": "session_length_in_hrs", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_DrUf", + "fid": "relative_weight", + "name": "relative_weight", + "basename": "relative_weight", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_5aXC", + "fid": "water_total", + "name": "water_total", + "basename": "water_total", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_N6wE", + "fid": "water_per_trial_in_uL", + "name": "water_per_trial_in_uL", + "basename": "water_per_trial_in_uL", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_ge52", + "fid": "model_id", + "name": "model_id", + "basename": "model_id", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_DSHO", + "fid": "n_trials", + "name": "n_trials", + "basename": "n_trials", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_btIC", + "fid": "n_params", + "name": "n_params", + "basename": "n_params", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_lBDw", + "fid": "log_likelihood", + "name": "log_likelihood", + "basename": "log_likelihood", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_Qxyz", + "fid": "aic", + "name": "aic", + "basename": "aic", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_X7tT", + "fid": "bic", + "name": "bic", + "basename": "bic", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_OQb_", + "fid": "lpt", + "name": "lpt", + "basename": "lpt", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_HrC-", + "fid": "lpt_aic", + "name": "lpt_aic", + "basename": "lpt_aic", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_Ud4y", + "fid": "lpt_bic", + "name": "lpt_bic", + "basename": "lpt_bic", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_mEVv", + "fid": "prediction_accuracy", + "name": "prediction_accuracy", + "basename": "prediction_accuracy", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_M0aA", + "fid": "cross_valid_accuracy_fit", + "name": "cross_valid_accuracy_fit", + "basename": "cross_valid_accuracy_fit", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_BLsy", + "fid": "cross_valid_accuracy_test", + "name": "cross_valid_accuracy_test", + "basename": "cross_valid_accuracy_test", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_xp_G", + "fid": "cross_valid_accuracy_test_bias_only", + "name": "cross_valid_accuracy_test_bias_only", + "basename": "cross_valid_accuracy_test_bias_only", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_x4_-", + "fid": "biasL", + "name": "biasL", + "basename": "biasL", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_PFhD", + "fid": "softmax_temperature", + "name": "softmax_temperature", + "basename": "softmax_temperature", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_-UaT", + "fid": "forget_rate", + "name": "forget_rate", + "basename": "forget_rate", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_K6YW", + "fid": "learn_rate_rew", + "name": "learn_rate_rew", + "basename": "learn_rate_rew", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_dZdX", + "fid": "learn_rate_unrew", + "name": "learn_rate_unrew", + "basename": "learn_rate_unrew", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_fJCR", + "fid": "choice_softmax_temperature", + "name": "choice_softmax_temperature", + "basename": "choice_softmax_temperature", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_EGZR", + "fid": "choice_step_size", + "name": "choice_step_size", + "basename": "choice_step_size", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_IsMK", + "fid": "abs(bias)", + "name": "abs(bias)", + "basename": "abs(bias)", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_tsch", + "fid": "foraging_performance", + "name": "foraging_performance", + "basename": "foraging_performance", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_9uwz", + "fid": "diff_relative_weight_next_day", + "name": "diff_relative_weight_next_day", + "basename": "diff_relative_weight_next_day", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_count_fid", + "fid": "gw_count_fid", + "name": "Row count", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "computed": true, + "expression": { + "op": "one", + "params": [], + "as": "gw_count_fid" + } + }, + { + "dragId": "gw_mea_val_fid", + "fid": "gw_mea_val_fid", + "name": "Measure values", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum" + } + ], + "rows": [ + { + "dragId": "gw_XuBo", + "fid": "foraging_performance", + "name": "foraging_performance", + "basename": "foraging_performance", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + } + ], + "columns": [ + { + "dragId": "gw_CL-J", + "fid": "session", + "name": "session", + "basename": "session", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + } + ], + "color": [], + "opacity": [], + "size": [], + "shape": [], + "radius": [], + "theta": [], + "longitude": [], + "latitude": [], + "geoId": [], + "details": [], + "filters": [], + "text": [] + }, + "layout": { + "showActions": false, + "showTableSummary": false, + "stack": "stack", + "interactiveScale": false, + "zeroScale": true, + "size": { + "mode": "fixed", + "width": 898, + "height": 530 + }, + "format": {}, + "geoKey": "name", + "resolve": { + "x": false, + "y": false, + "color": false, + "opacity": false, + "shape": false, + "size": false + } + }, + "visId": "gw_FPy8", + "name": "Chart 1" + } + ] \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 23aab3b..cc1a790 100644 --- a/requirements.txt +++ b/requirements.txt @@ -72,8 +72,8 @@ six==1.16.0 smmap==5.0.0 statannotations==0.5.0 statsmodels==0.13.5 -streamlit==1.30.0 -streamlit-aggrid==0.3.3 +streamlit==1.32.2 +streamlit-aggrid==1.0.1 streamlit-nested-layout==0.1.1 streamlit-plotly-events==0.0.6 streamlit-profiler==0.2.4