From e7ac26d745915482c069d0b396752ba7aa9e8c9e Mon Sep 17 00:00:00 2001 From: hh_itx_win10 Date: Sun, 7 Apr 2024 12:35:45 -0700 Subject: [PATCH 01/15] chore: remove unused func --- code/Home.py | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/code/Home.py b/code/Home.py index 33d3637..5db8982 100644 --- a/code/Home.py +++ b/code/Home.py @@ -125,19 +125,7 @@ if 'selected_points' not in st.session_state: st.session_state['selected_points'] = [] - -def _get_urls(): - cache_folder = 'aind-behavior-data/Han/ephys/report/st_cache/' - cache_session_level_fig_folder = 'aind-behavior-data/Han/ephys/report/all_sessions/' - cache_mouse_level_fig_folder = 'aind-behavior-data/Han/ephys/report/all_subjects/' - - fs = s3fs.S3FileSystem(anon=False) - - with fs.open('aind-behavior-data/Han/streamlit_CO_url.json', 'r') as f: - data = json.load(f) - - return data['behavior'], data['ephys'] @st.cache_data(ttl=24*3600) def load_data(tables=['sessions']): From 3e7c826b11b9dd5a7d01e6bfcd5a77cb8a0a402f Mon Sep 17 00:00:00 2001 From: hh_itx_win10 Date: Sun, 7 Apr 2024 13:09:43 -0700 Subject: [PATCH 02/15] feat: merge df_session from bpod! --- code/Home.py | 47 +++++++++++++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/code/Home.py b/code/Home.py index 5db8982..37db1d6 100644 --- a/code/Home.py +++ b/code/Home.py @@ -43,7 +43,7 @@ add_xy_selector, add_xy_setting, add_auto_train_manager, add_dot_property_mapper, _plot_population_x_y) from util.url_query_helper import ( - sync_widget_with_query, slider_wrapper_for_url_query, + sync_widget_with_query, slider_wrapper_for_url_query, checkbox_wrapper_for_url_query ) import extra_streamlit_components as stx @@ -57,6 +57,8 @@ # dict of "key": default pairs # Note: When creating the widget, add argument "value"/"index" as well as "key" for all widgets you want to sync with URL to_sync_with_url_query = { + 'if_load_bpod_sessions': True, + 'filter_subject_id': '', 'filter_session': [0.0, None], 'filter_finished_trials': [0.0, None], @@ -102,10 +104,10 @@ } -raw_nwb_folder = 'aind-behavior-data/foraging_nwb_bonsai/' -cache_folder = 'aind-behavior-data/foraging_nwb_bonsai_processed/' -# cache_session_level_fig_folder = 'aind-behavior-data/Han/ephys/report/all_sessions/' -# cache_mouse_level_fig_folder = 'aind-behavior-data/Han/ephys/report/all_subjects/' +data_sources = ['bonsai', 'bpod'] + +s3_nwb_folder = {data: f'aind-behavior-data/foraging_nwb_{data}/' for data in data_sources} +s3_processed_nwb_folder = {data: f'aind-behavior-data/foraging_nwb_{data}_processed/' for data in data_sources} fs = s3fs.S3FileSystem(anon=False) st.session_state.use_s3 = True @@ -124,14 +126,12 @@ if 'selected_points' not in st.session_state: st.session_state['selected_points'] = [] - - @st.cache_data(ttl=24*3600) -def load_data(tables=['sessions']): +def load_data(tables=['sessions'], data_source = 'bonsai'): df = {} for table in tables: - file_name = cache_folder + f'df_{table}.pkl' + file_name = s3_processed_nwb_folder[data_source] + f'df_{table}.pkl' if st.session_state.use_s3: with fs.open(file_name) as f: df[table + '_bonsai'] = pd.read_pickle(f) @@ -139,7 +139,7 @@ def load_data(tables=['sessions']): df[table + '_bonsai'] = pd.read_pickle(file_name) return df -def _fetch_img(glob_patterns, crop=None): +def _fetch_img(glob_patterns, crop=None): # Fetch the img that first matches the patterns for pattern in glob_patterns: file = fs.glob(pattern) if st.session_state.use_s3 else glob.glob(pattern) @@ -187,7 +187,7 @@ def show_session_level_img_by_key_and_prefix(key, prefix, column=None, other_pat # Convert session_date to 2024-04-01 format subject_session_date_str = f"{key['subject_id']}_{date_str}_{key['nwb_suffix']}".split('_0')[0] - glob_patterns = [cache_folder + f"{subject_session_date_str}/{subject_session_date_str}_{prefix}*"] + glob_patterns = [s3_processed_nwb_folder['bonsai'] + f"{subject_session_date_str}/{subject_session_date_str}_{prefix}*"] img, f_name = _fetch_img(glob_patterns, crop) @@ -515,8 +515,12 @@ def init(): for key, default in to_sync_with_url_query.items(): sync_widget_with_query(key, default) - df = load_data(['sessions', - ]) + df = load_data(['sessions'], data_source='bonsai') + + if st.session_state.if_load_bpod_sessions: + df_bpod = load_data(['sessions'], data_source='bpod') + # For historial reason, the suffix of df['sessions_bonsai'] just mean the data of the Home.py page + df['sessions_bonsai'] = pd.concat([df['sessions_bonsai'], df_bpod['sessions_bonsai']], axis=0) st.session_state.df = df st.session_state.df_selected_from_plotly = pd.DataFrame(columns=['h2o', 'session']) @@ -638,7 +642,7 @@ def app(): cols = st.columns([1, 1.2]) with cols[0]: - st.markdown('## 🌳🪴 Foraging sessions from Bonsai 🌳🪴') + st.markdown('## 🌳🪴 Dynamic Foraging Sessions 🌳🪴') with st.sidebar: @@ -670,8 +674,15 @@ def app(): cols[0].markdown(f'### Filter the sessions on the sidebar\n' f'##### {len(st.session_state.df_session_filtered)} sessions, ' f'{len(st.session_state.df_session_filtered.h2o.unique())} mice filtered') + + if_load_bpod_sessions = checkbox_wrapper_for_url_query( + st_prefix=cols[1], + label='Include old Bpod sessions', + key='if_load_bpod_sessions', + default=True, + ) + with cols[1]: - st.markdown('# ') if st.button(' Reload data ', type='primary'): st.cache_data.clear() init() @@ -885,7 +896,7 @@ def app(): for _ in range(10): st.write('\n') st.markdown('---\n##### Debug zone') with st.expander('CO processing NWB errors', expanded=False): - error_file = cache_folder + 'error_files.json' + error_file = s3_processed_nwb_folder['bonsai'] + 'error_files.json' if fs.exists(error_file): with fs.open(error_file) as file: st.json(json.load(file)) @@ -893,13 +904,13 @@ def app(): st.write('No NWB error files') with st.expander('CO Pipeline log', expanded=False): - with fs.open(cache_folder + 'pipeline.log') as file: + with fs.open(s3_processed_nwb_folder['bonsai'] + 'pipeline.log') as file: log_content = file.read().decode('utf-8') log_content = log_content.replace('\\n', '\n') st.text(log_content) with st.expander('NWB convertion and upload log', expanded=False): - with fs.open(raw_nwb_folder + 'bonsai_pipeline.log') as file: + with fs.open(s3_nwb_folder['bonsai'] + 'bonsai_pipeline.log') as file: log_content = file.read().decode('utf-8') st.text(log_content) From c17b07fd33d0fd9da05482052a5ec4b938dba98a Mon Sep 17 00:00:00 2001 From: hh_itx_win10 Date: Sun, 7 Apr 2024 13:35:55 -0700 Subject: [PATCH 03/15] feat: handle h2o --- code/Home.py | 59 ++++++++++++++++++++++++++---------------- code/util/streamlit.py | 2 +- 2 files changed, 37 insertions(+), 24 deletions(-) diff --git a/code/Home.py b/code/Home.py index 37db1d6..3e9f5ac 100644 --- a/code/Home.py +++ b/code/Home.py @@ -517,8 +517,10 @@ def init(): df = load_data(['sessions'], data_source='bonsai') + # --- Perform any data source-dependent preprocessing here --- if st.session_state.if_load_bpod_sessions: df_bpod = load_data(['sessions'], data_source='bpod') + # For historial reason, the suffix of df['sessions_bonsai'] just mean the data of the Home.py page df['sessions_bonsai'] = pd.concat([df['sessions_bonsai'], df_bpod['sessions_bonsai']], axis=0) @@ -588,51 +590,62 @@ 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) + _df = st.session_state.df['sessions_bonsai'] # temporary df alias + + _df.columns = _df.columns.get_level_values(1) + _df.sort_values(['session_start_time'], ascending=False, inplace=True) + _df = _df.reset_index().query('subject_id != "0"') + + # Fill in h2o (water restriction number, or mouse alias) + if 'bpod_backup_h2o' in _df.columns: + _df['h2o'] = np.where(_df['bpod_backup_h2o'].notnull(), _df['bpod_backup_h2o'], _df['subject_id']) + else: + _df['h2o'] = _df['subject_id'] + + # Handle session number + _df.dropna(subset=['session'], inplace=True) # Remove rows with no session number (only leave the nwb file with the largest finished_trials for now) + _df.drop(_df.query('session < 1').index, inplace=True) # # add something else # add abs(bais) to all terms that have 'bias' in name - for col in st.session_state.df['sessions_bonsai'].columns: + for col in _df.columns: if 'bias' in col: - st.session_state.df['sessions_bonsai'][f'abs({col})'] = np.abs(st.session_state.df['sessions_bonsai'][col]) + _df[f'abs({col})'] = np.abs(_df[col]) # # delta weight - # diff_relative_weight_next_day = st.session_state.df['sessions_bonsai'].set_index( + # diff_relative_weight_next_day = _df.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'].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.dayofweek + 1 + _df.session_date = pd.to_datetime(_df.session_date) + _df['weekday'] = _df.session_date.dt.dayofweek + 1 # map user_name - st.session_state.df['sessions_bonsai']['user_name'] = st.session_state.df['sessions_bonsai']['user_name'].apply(_user_name_mapper) + _df['user_name'] = _df['user_name'].apply(_user_name_mapper) # fill nan for autotrain fields filled_values = {'curriculum_name': 'None', 'curriculum_version': 'None', 'curriculum_schema_version': 'None', 'current_stage_actual': 'None'} - st.session_state.df['sessions_bonsai'].fillna(filled_values, inplace=True) + _df.fillna(filled_values, inplace=True) # 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( + if 'foraging_performance' not in _df.columns: + _df['foraging_performance'] = \ + _df['foraging_eff'] \ + * _df['finished_rate'] + _df['foraging_performance_random_seed'] = \ + _df['foraging_eff_random_seed'] \ + * _df['finished_rate'] + + # _df = _df.merge( # diff_relative_weight_next_day, how='left', on=['h2o', 'session']) - st.session_state.session_stats_names = [keys for keys in st.session_state.df['sessions_bonsai'].keys()] + st.session_state.df['sessions_bonsai'] = _df # Somehow _df loses the reference to the original dataframe + + st.session_state.session_stats_names = [keys for keys in _df.keys()] # Establish communication between pygwalker and streamlit init_streamlit_comm() diff --git a/code/util/streamlit.py b/code/util/streamlit.py index 662bdf3..f36785b 100644 --- a/code/util/streamlit.py +++ b/code/util/streamlit.py @@ -58,7 +58,7 @@ def aggrid_interactive_table_session(df: pd.DataFrame, table_height: int = 400): options.configure_side_bar() if 'session_end_time' in df.columns: - df = df.sort_values('session_end_time', ascending=False) + df = df.sort_values('session_start_time', ascending=False) else: df = df.sort_values('session_date', ascending=False) From 77620bf7250904775d55a6f4d0849585d0751dc3 Mon Sep 17 00:00:00 2001 From: hh_itx_win10 Date: Sun, 7 Apr 2024 13:41:26 -0700 Subject: [PATCH 04/15] feat: better handle user_name --- code/Home.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/code/Home.py b/code/Home.py index 3e9f5ac..1832c36 100644 --- a/code/Home.py +++ b/code/Home.py @@ -596,9 +596,10 @@ def init(): _df.sort_values(['session_start_time'], ascending=False, inplace=True) _df = _df.reset_index().query('subject_id != "0"') - # Fill in h2o (water restriction number, or mouse alias) + # Handle mouse and user name if 'bpod_backup_h2o' in _df.columns: _df['h2o'] = np.where(_df['bpod_backup_h2o'].notnull(), _df['bpod_backup_h2o'], _df['subject_id']) + _df['user_name'] = np.where(_df['bpod_backup_user_name'].notnull(), _df['bpod_backup_user_name'], _df['user_name']) else: _df['h2o'] = _df['subject_id'] @@ -628,7 +629,9 @@ def init(): filled_values = {'curriculum_name': 'None', 'curriculum_version': 'None', 'curriculum_schema_version': 'None', - 'current_stage_actual': 'None'} + 'current_stage_actual': 'None', + 'has_video': False, + 'has_ephys': False,} _df.fillna(filled_values, inplace=True) # foraging performance = foraing_eff * finished_rate From a9efe95a1f13891a5987d2b7732f18179a5d80a6 Mon Sep 17 00:00:00 2001 From: hh_itx_win10 Date: Sun, 7 Apr 2024 13:53:23 -0700 Subject: [PATCH 05/15] feat: show hover when dots are not shown --- code/util/streamlit.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/code/util/streamlit.py b/code/util/streamlit.py index f36785b..2ee4ab8 100644 --- a/code/util/streamlit.py +++ b/code/util/streamlit.py @@ -769,7 +769,7 @@ def _plot_population_x_y(df, x_name='session', y_name='foraging_eff', group_by=' font_size_scale=1.0, **kwarg): - def _add_agg(df_this, x_name, y_name, group, aggr_method, if_use_x_quantile, q_quantiles, col, line_width, **kwarg): + def _add_agg(df_this, x_name, y_name, group, aggr_method, if_use_x_quantile, q_quantiles, col, line_width, hoverinfo='skip', **kwarg): x = df_this.sort_values(x_name)[x_name].astype(float) y = df_this.sort_values(x_name)[y_name].astype(float) @@ -788,7 +788,7 @@ def _add_agg(df_this, x_name, y_name, group, aggr_method, if_use_x_quantile, q_q line_width=line_width, opacity=1, hoveron='points+fills', # Scattergl doesn't support this - hoverinfo='skip', + hoverinfo=hoverinfo, **kwarg, )) @@ -806,7 +806,7 @@ def _add_agg(df_this, x_name, y_name, group, aggr_method, if_use_x_quantile, q_q marker_color=col, opacity=1, hoveron='points+fills', # Scattergl doesn't support this - hoverinfo='skip', + hoverinfo=hoverinfo, **kwarg, )) @@ -853,7 +853,7 @@ def _add_agg(df_this, x_name, y_name, group, aggr_method, if_use_x_quantile, q_q marker_color=col, opacity=1, hoveron='points+fills', # Scattergl doesn't support this - hoverinfo='skip', + hoverinfo=hoverinfo, **kwarg, )) @@ -867,7 +867,7 @@ def _add_agg(df_this, x_name, y_name, group, aggr_method, if_use_x_quantile, q_q line=dict(width=0), legendgroup=f'group_{group}', showlegend=False, - hoverinfo='skip', + hoverinfo=hoverinfo, )) fig.add_trace(go.Scatter( # name='Upper Bound', @@ -880,7 +880,7 @@ def _add_agg(df_this, x_name, y_name, group, aggr_method, if_use_x_quantile, q_q fillcolor=f'rgba({plotly.colors.convert_colors_to_same_type(col)[0][0].split("(")[-1][:-1]}, 0.2)', legendgroup=f'group_{group}', showlegend=False, - hoverinfo='skip' + hoverinfo=hoverinfo )) elif aggr_method == 'linear fit': @@ -897,7 +897,7 @@ def _add_agg(df_this, x_name, y_name, group, aggr_method, if_use_x_quantile, q_q line=dict(dash='dot' if p_value > 0.05 else 'solid', width=line_width if p_value > 0.05 else line_width*1.5), legendgroup=f'group_{group}', - hoverinfo='skip' + hoverinfo=hoverinfo ) ) except: @@ -982,10 +982,13 @@ def _add_agg(df_this, x_name, y_name, group, aggr_method, if_use_x_quantile, q_q )) if if_aggr_each_group: - _add_agg(this_session, x_name, y_name, group, aggr_method_group, if_use_x_quantile_group, q_quantiles_group, col, line_width=line_width) + _add_agg(this_session, x_name, y_name, group, aggr_method_group, + if_use_x_quantile_group, q_quantiles_group, col, line_width=line_width, + hoverinfo='all' if not if_show_dots else 'skip') if if_aggr_all: - _add_agg(df, x_name, y_name, 'all', aggr_method_all, if_use_x_quantile_all, q_quantiles_all, 'rgb(0, 0, 0)', line_width=line_width*1.5) + _add_agg(df, x_name, y_name, 'all', aggr_method_all, if_use_x_quantile_all, q_quantiles_all, 'rgb(0, 0, 0)', line_width=line_width*1.5, + hoverinfo='all' if not if_show_dots else 'skip') n_mice = len(df['h2o'].unique()) n_sessions = len(df.groupby(['h2o', 'session']).count()) From 760428ff0a8ab603b8a445876ace8a25022da5f7 Mon Sep 17 00:00:00 2001 From: hh_itx_win10 Date: Sun, 7 Apr 2024 14:37:59 -0700 Subject: [PATCH 06/15] feat: add data_source --- code/Home.py | 31 ++++++++++++++++++++++++++++++- code/util/streamlit.py | 2 +- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/code/Home.py b/code/Home.py index 1832c36..e80f047 100644 --- a/code/Home.py +++ b/code/Home.py @@ -602,6 +602,34 @@ def init(): _df['user_name'] = np.where(_df['bpod_backup_user_name'].notnull(), _df['bpod_backup_user_name'], _df['user_name']) else: _df['h2o'] = _df['subject_id'] + + + def _get_data_source(rig): + """From rig string, return "{institute}_{rig_type}_{room}_{hardware}" + """ + institute = 'Janelia' if ('bpod' in rig) and not ('AIND' in rig) else 'AIND' + hardware = 'bpod' if ('bpod' in rig) else 'bonsai' + rig_type = 'ephys' if ('ephys' in rig.lower()) else 'training' + + # This is a mess... + if institute == 'Janelia': + room = 'NA' + elif 'Ephys-Han' in rig: + room = '321' + elif hardware == 'bpod': + room = '347' + elif '447' in rig: + room = '447' + elif '323' in rig: + room = '323' + elif rig_type == 'ephys': + room = '323' + else: + room = '447' + return institute, rig_type, room, hardware, '_'.join([institute, rig_type, room, hardware]) + + # Add data source (Room + Hardware etc) + _df[['institute', 'rig_type', 'room', 'hardware', 'data_source']] = _df['rig'].apply(lambda x: pd.Series(_get_data_source(x))) # Handle session number _df.dropna(subset=['session'], inplace=True) # Remove rows with no session number (only leave the nwb file with the largest finished_trials for now) @@ -631,7 +659,8 @@ def init(): 'curriculum_schema_version': 'None', 'current_stage_actual': 'None', 'has_video': False, - 'has_ephys': False,} + 'has_ephys': False, + } _df.fillna(filled_values, inplace=True) # foraging performance = foraing_eff * finished_rate diff --git a/code/util/streamlit.py b/code/util/streamlit.py index 2ee4ab8..cdd6e64 100644 --- a/code/util/streamlit.py +++ b/code/util/streamlit.py @@ -396,7 +396,7 @@ def add_session_filter(if_bonsai=False, url_query={}): @st.cache_data(ttl=3600*24) def _get_grouped_by_fields(if_bonsai): if if_bonsai: - options = ['h2o', 'task', 'user_name', 'rig', 'weekday'] + options = ['h2o', 'task', 'user_name', 'rig', 'weekday', 'data_source'] options += [col for col in st.session_state.df_session_filtered.columns if is_categorical_dtype(st.session_state.df_session_filtered[col]) From ad76247bf65cb16572092944d052b19e194479ee Mon Sep 17 00:00:00 2001 From: hh_itx_win10 Date: Sun, 7 Apr 2024 14:39:22 -0700 Subject: [PATCH 07/15] minor --- code/util/streamlit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/util/streamlit.py b/code/util/streamlit.py index cdd6e64..3c0a1ed 100644 --- a/code/util/streamlit.py +++ b/code/util/streamlit.py @@ -396,7 +396,7 @@ def add_session_filter(if_bonsai=False, url_query={}): @st.cache_data(ttl=3600*24) def _get_grouped_by_fields(if_bonsai): if if_bonsai: - options = ['h2o', 'task', 'user_name', 'rig', 'weekday', 'data_source'] + options = ['h2o', 'task', 'user_name', 'rig', 'data_source', 'weekday'] options += [col for col in st.session_state.df_session_filtered.columns if is_categorical_dtype(st.session_state.df_session_filtered[col]) From 1b3a9c219e74599ca05ed319d2f2e516e83a3235 Mon Sep 17 00:00:00 2001 From: hh_itx_win10 Date: Sun, 7 Apr 2024 14:57:22 -0700 Subject: [PATCH 08/15] feat: connect to bpod processed folder! --- code/Home.py | 79 ++++++++++++++++++++++++++-------------------------- 1 file changed, 40 insertions(+), 39 deletions(-) diff --git a/code/Home.py b/code/Home.py index e80f047..51c2875 100644 --- a/code/Home.py +++ b/code/Home.py @@ -12,7 +12,7 @@ """ -#%% +# %% import pandas as pd import streamlit as st from pathlib import Path @@ -57,7 +57,7 @@ # dict of "key": default pairs # Note: When creating the widget, add argument "value"/"index" as well as "key" for all widgets you want to sync with URL to_sync_with_url_query = { - 'if_load_bpod_sessions': True, + 'if_load_bpod_sessions': False, 'filter_subject_id': '', 'filter_session': [0.0, None], @@ -126,7 +126,7 @@ if 'selected_points' not in st.session_state: st.session_state['selected_points'] = [] - + @st.cache_data(ttl=24*3600) def load_data(tables=['sessions'], data_source = 'bonsai'): df = {} @@ -179,7 +179,7 @@ def _user_name_mapper(user_name): return user_name # @st.cache_data(ttl=24*3600, max_entries=20) -def show_session_level_img_by_key_and_prefix(key, prefix, column=None, other_patterns=[''], crop=None, caption=True, **kwargs): +def show_session_level_img_by_key_and_prefix(key, prefix, column=None, other_patterns=[''], crop=None, caption=True, data_source='bonsai', **kwargs): try: date_str = key["session_date"].strftime(r'%Y-%m-%d') except: @@ -187,7 +187,7 @@ def show_session_level_img_by_key_and_prefix(key, prefix, column=None, other_pat # Convert session_date to 2024-04-01 format subject_session_date_str = f"{key['subject_id']}_{date_str}_{key['nwb_suffix']}".split('_0')[0] - glob_patterns = [s3_processed_nwb_folder['bonsai'] + f"{subject_session_date_str}/{subject_session_date_str}_{prefix}*"] + glob_patterns = [s3_processed_nwb_folder[data_source] + f"{subject_session_date_str}/{subject_session_date_str}_{prefix}*"] img, f_name = _fetch_img(glob_patterns, crop) @@ -231,7 +231,7 @@ def show_mouse_level_img_by_key_and_prefix(key, prefix, column=None, other_patte def get_pyg_renderer(df, spec="./gw_config.json", **kwargs) -> "StreamlitRenderer": return StreamlitRenderer(df, spec=spec, debug=False, **kwargs) - + def draw_session_plots(df_to_draw_session): # Setting up layout for each session @@ -264,8 +264,9 @@ def draw_session_plots(df_to_draw_session): except: date_str = key["session_date"].split("T")[0] - st.markdown(f'''

{key["h2o"]}, Session {int(key["session"])}, {date_str}''', - unsafe_allow_html=True) + st.markdown(f'''

{key["h2o"]}, Session {int(key["session"])}, {date_str} ''' + f'''({key["user_name"]}@{key["data_source"]})''', + 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): rows.append(this_major_col.columns(column_setting)) @@ -278,33 +279,35 @@ def draw_session_plots(df_to_draw_session): prefix, position, setting = st.session_state.draw_type_mapper_session_level[draw_type] this_col = rows[position[0]][position[1]] if len(st.session_state.selected_draw_types) > 1 else rows[0] show_session_level_img_by_key_and_prefix(key, - column=this_col, - prefix=prefix, - **setting) + column=this_col, + prefix=prefix, + data_source=key['hardware'], + **setting) my_bar.progress(int((i + 1) / len(df_to_draw_session) * 100)) - + def draw_session_plots_quick_preview(df_to_draw_session): - + # Setting up layout for each session layout_definition = [[1], # columns in the first row [1, 1], ] draw_types_quick_preview = ['1. Choice history', '2. Logistic regression (Su2022)'] - + container_session_all_in_one = st.container() - + key = df_to_draw_session.to_dict(orient='records')[0] - + with container_session_all_in_one: try: date_str = key["session_date"].strftime('%Y-%m-%d') except: date_str = key["session_date"].split("T")[0] - - st.markdown(f'''

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

{key["h2o"]}, Session {int(key["session"])}, {date_str} ''' + f'''({key["user_name"]}@{key["data_source"]})''', unsafe_allow_html=True) - + rows = [] for row, column_setting in enumerate(layout_definition): rows.append(st.columns(column_setting)) @@ -313,14 +316,15 @@ def draw_session_plots_quick_preview(df_to_draw_session): if draw_type not in st.session_state.selected_draw_types: continue # To keep the draw order defined by st.session_state.draw_type_mapper_session_level prefix, position, setting = st.session_state.draw_type_mapper_session_level[draw_type] this_col = rows[position[0]][position[1]] if len(st.session_state.selected_draw_types) > 1 else rows[0] - show_session_level_img_by_key_and_prefix(key, - column=this_col, - prefix=prefix, - **setting) - - - - + show_session_level_img_by_key_and_prefix( + key, + column=this_col, + prefix=prefix, + data_source=key["hardware"], + **setting, + ) + + def draw_mice_plots(df_to_draw_mice): # Setting up layout for each session @@ -364,12 +368,8 @@ def draw_mice_plots(df_to_draw_mice): **setting) my_bar.progress(int((i + 1) / len(df_to_draw_mice) * 100)) - - - - def session_plot_settings(need_click=True): st.markdown('##### Show plots for individual sessions ') cols = st.columns([2, 1, 6]) @@ -499,11 +499,10 @@ def plot_x_y_session(): return df_selected_from_plotly, cols - def show_curriculums(): pass -# ------- Layout starts here -------- # +# ------- Layout starts here -------- # def init(): # Clear specific session state and all filters @@ -672,6 +671,9 @@ def _get_data_source(rig): _df['foraging_eff_random_seed'] \ * _df['finished_rate'] + # drop 'bpod_backup_' columns + _df.drop([col for col in _df.columns if 'bpod_backup_' in col], axis=1, inplace=True) + # _df = _df.merge( # diff_relative_weight_next_day, how='left', on=['h2o', 'session']) @@ -681,7 +683,7 @@ def _get_data_source(rig): # Establish communication between pygwalker and streamlit init_streamlit_comm() - + def app(): @@ -715,16 +717,16 @@ def app(): # with col1: # -- 1. unit dataframe -- - cols = st.columns([2, 1, 4, 1]) + cols = st.columns([2, 2, 4, 1]) cols[0].markdown(f'### Filter the sessions on the sidebar\n' f'##### {len(st.session_state.df_session_filtered)} sessions, ' f'{len(st.session_state.df_session_filtered.h2o.unique())} mice filtered') if_load_bpod_sessions = checkbox_wrapper_for_url_query( st_prefix=cols[1], - label='Include old Bpod sessions', + label='Include old Bpod sessions (reload after change)', key='if_load_bpod_sessions', - default=True, + default=False, ) with cols[1]: @@ -972,6 +974,5 @@ def app(): if 'df' not in st.session_state or 'sessions_bonsai' not in st.session_state.df.keys(): init() - -app() +app() From 900e4d62e07f7613952a81e77528b7668fc9a503 Mon Sep 17 00:00:00 2001 From: hh_itx_win10 Date: Sun, 7 Apr 2024 15:07:14 -0700 Subject: [PATCH 09/15] feat: show data_source in hovertop --- code/util/streamlit.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/util/streamlit.py b/code/util/streamlit.py index 3c0a1ed..7b88bd2 100644 --- a/code/util/streamlit.py +++ b/code/util/streamlit.py @@ -953,7 +953,8 @@ def _add_agg(df_this, x_name, y_name, group, aggr_method, if_use_x_quantile, q_q marker_color=this_session['colors'], opacity=dot_opacity, hovertemplate = '%{customdata[0]}, %{customdata[1]}, Session %{customdata[2]}' - '
%{customdata[3]}, %{customdata[4]}' + '
%{customdata[4]} @ %{customdata[9]}' + '
Rig: %{customdata[3]}' '
Task: %{customdata[5]}' '
AutoTrain: %{customdata[7]} @ %{customdata[6]}
' f'
{"-"*10}
X: {x_name} = %{{x}}' @@ -977,6 +978,7 @@ def _add_agg(df_this, x_name, y_name, group, aggr_method, if_use_x_quantile, q_q this_session[dot_size_mapping_name] if dot_size_mapping_name !='None' else [np.nan] * len(this_session.h2o), # 8 + this_session.data_source if 'data_source' in this_session else '', # 9 ), axis=-1), unselected=dict(marker_color='lightgrey') )) From 28131d7e21829cbc963e5b2349d2e05c50d41e41 Mon Sep 17 00:00:00 2001 From: hh_itx_win10 Date: Sun, 7 Apr 2024 16:33:16 -0700 Subject: [PATCH 10/15] feat: update gw_config --- gw_config.json | 449 ++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 421 insertions(+), 28 deletions(-) diff --git a/gw_config.json b/gw_config.json index fbc5f72..d79c209 100644 --- a/gw_config.json +++ b/gw_config.json @@ -198,6 +198,70 @@ "basename": "weekday", "dragId": "GW_k5CoqSta", "offset": 0 + }, + { + "fid": "has_video", + "name": "has_video", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "has_video", + "dragId": "GW_2WFpZTxq" + }, + { + "fid": "has_ephys", + "name": "has_ephys", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "has_ephys", + "dragId": "GW_zEX6LQVa" + }, + { + "fid": "old_bpod_session", + "name": "old_bpod_session", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "old_bpod_session", + "dragId": "GW_CxAuDhVz" + }, + { + "fid": "institute", + "name": "institute", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "institute", + "dragId": "GW_kZ3nBOU9" + }, + { + "fid": "rig_type", + "name": "rig_type", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "rig_type", + "dragId": "GW_qhiUSQPC" + }, + { + "fid": "room", + "name": "room", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "room", + "dragId": "GW_vN6TegxB" + }, + { + "fid": "hardware", + "name": "hardware", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "hardware", + "dragId": "GW_7vKJHUYO" + }, + { + "fid": "data_source", + "name": "data_source", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "data_source", + "dragId": "GW_B1xgPbEL" } ], "measures": [ @@ -1795,6 +1859,70 @@ "basename": "weekday", "dragId": "GW_xzAdpGWI", "offset": 0 + }, + { + "fid": "has_video", + "name": "has_video", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "has_video", + "dragId": "GW_Cdfo8s0e" + }, + { + "fid": "has_ephys", + "name": "has_ephys", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "has_ephys", + "dragId": "GW_E7NCF4ya" + }, + { + "fid": "old_bpod_session", + "name": "old_bpod_session", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "old_bpod_session", + "dragId": "GW_TIlKiJW1" + }, + { + "fid": "institute", + "name": "institute", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "institute", + "dragId": "GW_GiIbtKYo" + }, + { + "fid": "rig_type", + "name": "rig_type", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "rig_type", + "dragId": "GW_309LpyUt" + }, + { + "fid": "room", + "name": "room", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "room", + "dragId": "GW_PO5RApT8" + }, + { + "fid": "hardware", + "name": "hardware", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "hardware", + "dragId": "GW_JD8sn7fz" + }, + { + "fid": "data_source", + "name": "data_source", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "data_source", + "dragId": "GW_ts9aSd4z" } ], "measures": [ @@ -3292,6 +3420,70 @@ "analyticType": "dimension", "semanticType": "nominal", "offset": 0 + }, + { + "fid": "has_video", + "name": "has_video", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "has_video", + "dragId": "GW_xvZNz6ly" + }, + { + "fid": "has_ephys", + "name": "has_ephys", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "has_ephys", + "dragId": "GW_LfaGjIzQ" + }, + { + "fid": "old_bpod_session", + "name": "old_bpod_session", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "old_bpod_session", + "dragId": "GW_Gufaj7xo" + }, + { + "fid": "institute", + "name": "institute", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "institute", + "dragId": "GW_z1pxDdrJ" + }, + { + "fid": "rig_type", + "name": "rig_type", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "rig_type", + "dragId": "GW_aP9S0HbF" + }, + { + "fid": "room", + "name": "room", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "room", + "dragId": "GW_VwiJzWey" + }, + { + "fid": "hardware", + "name": "hardware", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "hardware", + "dragId": "GW_ITK4MUEk" + }, + { + "fid": "data_source", + "name": "data_source", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "data_source", + "dragId": "GW_8VmNjt1i" } ], "measures": [ @@ -4642,6 +4834,70 @@ "analyticType": "dimension", "semanticType": "nominal", "offset": 0 + }, + { + "fid": "has_video", + "name": "has_video", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "has_video", + "dragId": "GW_d0snox9X" + }, + { + "fid": "has_ephys", + "name": "has_ephys", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "has_ephys", + "dragId": "GW_Un7Ab4aD" + }, + { + "fid": "old_bpod_session", + "name": "old_bpod_session", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "old_bpod_session", + "dragId": "GW_0CRgMaA5" + }, + { + "fid": "institute", + "name": "institute", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "institute", + "dragId": "GW_3OcDsx8W" + }, + { + "fid": "rig_type", + "name": "rig_type", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "rig_type", + "dragId": "GW_X89EDH2b" + }, + { + "fid": "room", + "name": "room", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "room", + "dragId": "GW_8P3IN1fy" + }, + { + "fid": "hardware", + "name": "hardware", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "hardware", + "dragId": "GW_i0LKsTka" + }, + { + "fid": "data_source", + "name": "data_source", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "data_source", + "dragId": "GW_ovQlp534" } ], "measures": [ @@ -5755,23 +6011,12 @@ ], "color": [ { - "analyticType": "dimension", - "dragId": "gw_skdI", - "fid": "gw_87w6", - "name": "rig_type", + "fid": "data_source", + "name": "data_source", "semanticType": "nominal", - "computed": true, - "expression": { - "op": "expr", - "as": "gw_87w6", - "params": [ - { - "type": "sql", - "value": "CASE \n WHEN lower(rig) LIKE '%ephys%' THEN 'Ephys' \n WHEN rig LIKE '%447%' THEN '447'\n ELSE '347' \nEND" - } - ] - }, - "offset": 0 + "analyticType": "dimension", + "basename": "data_source", + "dragId": "gw_Xjam" } ], "opacity": [], @@ -5794,8 +6039,8 @@ "zeroScale": true, "size": { "mode": "fixed", - "width": 1400, - "height": 350 + "width": 1772, + "height": 563 }, "format": {}, "geoKey": "name", @@ -5806,6 +6051,13 @@ "opacity": false, "shape": false, "size": false + }, + "scaleIncludeUnmatchedChoropleth": false, + "colorPalette": "tableau20", + "useSvg": false, + "scale": { + "opacity": {}, + "size": {} } }, "visId": "gw_zWlp", @@ -5981,7 +6233,72 @@ "fid": "gw_mea_key_fid", "name": "Measure names", "analyticType": "dimension", - "semanticType": "nominal" + "semanticType": "nominal", + "offset": 0 + }, + { + "fid": "has_video", + "name": "has_video", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "has_video", + "dragId": "GW_bqFCZrpy" + }, + { + "fid": "has_ephys", + "name": "has_ephys", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "has_ephys", + "dragId": "GW_4xjIydG8" + }, + { + "fid": "old_bpod_session", + "name": "old_bpod_session", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "old_bpod_session", + "dragId": "GW_Xm5RBDsM" + }, + { + "fid": "institute", + "name": "institute", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "institute", + "dragId": "GW_Rzr945a3" + }, + { + "fid": "rig_type", + "name": "rig_type", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "rig_type", + "dragId": "GW_LUV0XbSs" + }, + { + "fid": "room", + "name": "room", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "room", + "dragId": "GW_ThuEasrW" + }, + { + "fid": "hardware", + "name": "hardware", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "hardware", + "dragId": "GW_lIN7svPj" + }, + { + "fid": "data_source", + "name": "data_source", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "data_source", + "dragId": "GW_eUVoHIi3" } ], "measures": [ @@ -7057,7 +7374,8 @@ "op": "one", "params": [], "as": "gw_count_fid" - } + }, + "offset": 0 }, { "dragId": "gw_mea_val_fid", @@ -7065,7 +7383,8 @@ "name": "Measure values", "analyticType": "measure", "semanticType": "quantitative", - "aggName": "sum" + "aggName": "sum", + "offset": 0 } ], "rows": [ @@ -7122,8 +7441,8 @@ "zeroScale": true, "size": { "mode": "fixed", - "width": 1464, - "height": 324 + "width": 1733, + "height": 507 }, "format": {}, "geoKey": "name", @@ -7316,7 +7635,72 @@ "fid": "gw_mea_key_fid", "name": "Measure names", "analyticType": "dimension", - "semanticType": "nominal" + "semanticType": "nominal", + "offset": 0 + }, + { + "fid": "has_video", + "name": "has_video", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "has_video", + "dragId": "GW_cIj0CiSl" + }, + { + "fid": "has_ephys", + "name": "has_ephys", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "has_ephys", + "dragId": "GW_SJwOhAXu" + }, + { + "fid": "old_bpod_session", + "name": "old_bpod_session", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "old_bpod_session", + "dragId": "GW_qFLmGBcS" + }, + { + "fid": "institute", + "name": "institute", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "institute", + "dragId": "GW_lK7zi5Vs" + }, + { + "fid": "rig_type", + "name": "rig_type", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "rig_type", + "dragId": "GW_6G7cNkPO" + }, + { + "fid": "room", + "name": "room", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "room", + "dragId": "GW_IzBiWfqh" + }, + { + "fid": "hardware", + "name": "hardware", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "hardware", + "dragId": "GW_4uXa8HfP" + }, + { + "fid": "data_source", + "name": "data_source", + "semanticType": "nominal", + "analyticType": "dimension", + "basename": "data_source", + "dragId": "GW_FTWywrJo" } ], "measures": [ @@ -8392,7 +8776,8 @@ "op": "one", "params": [], "as": "gw_count_fid" - } + }, + "offset": 0 }, { "dragId": "gw_mea_val_fid", @@ -8400,7 +8785,8 @@ "name": "Measure values", "analyticType": "measure", "semanticType": "quantitative", - "aggName": "sum" + "aggName": "sum", + "offset": 0 } ], "rows": [ @@ -8457,8 +8843,8 @@ "zeroScale": true, "size": { "mode": "fixed", - "width": 1448, - "height": 299 + "width": 1735, + "height": 521 }, "format": {}, "geoKey": "name", @@ -8469,6 +8855,13 @@ "opacity": false, "shape": false, "size": false + }, + "scaleIncludeUnmatchedChoropleth": false, + "colorPalette": "tableau20", + "useSvg": false, + "scale": { + "opacity": {}, + "size": {} } }, "visId": "gw_9Q9L", From 14713ab8fb56f7b6a237edea9028777a27698709 Mon Sep 17 00:00:00 2001 From: hh_itx_win10 Date: Sun, 7 Apr 2024 17:31:59 -0700 Subject: [PATCH 11/15] update gw_config --- gw_config.json | 2808 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 2808 insertions(+) diff --git a/gw_config.json b/gw_config.json index d79c209..11c9266 100644 --- a/gw_config.json +++ b/gw_config.json @@ -8866,5 +8866,2813 @@ }, "visId": "gw_9Q9L", "name": "Throughputs by user_name" + }, + { + "config": { + "defaultAggregated": true, + "geoms": [ + "bar" + ], + "coordSystem": "generic", + "limit": -1, + "timezoneDisplayOffset": 0 + }, + "encodings": { + "dimensions": [ + { + "dragId": "gw_PVs_", + "fid": "session_date", + "name": "session_date", + "basename": "session_date", + "semanticType": "temporal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_lOLo", + "fid": "subject_id", + "name": "subject_id", + "basename": "subject_id", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_-CKH", + "fid": "rig", + "name": "rig", + "basename": "rig", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_tU7P", + "fid": "user_name", + "name": "user_name", + "basename": "user_name", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_Dgmn", + "fid": "experiment_description", + "name": "experiment_description", + "basename": "experiment_description", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_3m8s", + "fid": "task", + "name": "task", + "basename": "task", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_d2KX", + "fid": "notes", + "name": "notes", + "basename": "notes", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_r6rB", + "fid": "session_start_time", + "name": "session_start_time", + "basename": "session_start_time", + "semanticType": "temporal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_dU0H", + "fid": "session_end_time", + "name": "session_end_time", + "basename": "session_end_time", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_p35y", + "fid": "curriculum_name", + "name": "curriculum_name", + "basename": "curriculum_name", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_P93d", + "fid": "curriculum_version", + "name": "curriculum_version", + "basename": "curriculum_version", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_FYmy", + "fid": "curriculum_schema_version", + "name": "curriculum_schema_version", + "basename": "curriculum_schema_version", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_2pY4", + "fid": "current_stage_actual", + "name": "current_stage_actual", + "basename": "current_stage_actual", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_vMbL", + "fid": "if_overriden_by_trainer", + "name": "if_overriden_by_trainer", + "basename": "if_overriden_by_trainer", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_EAel", + "fid": "if_consistent_within_session", + "name": "if_consistent_within_session", + "basename": "if_consistent_within_session", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_4jne", + "fid": "has_video", + "name": "has_video", + "basename": "has_video", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_AEQk", + "fid": "has_ephys", + "name": "has_ephys", + "basename": "has_ephys", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_lqN9", + "fid": "old_bpod_session", + "name": "old_bpod_session", + "basename": "old_bpod_session", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_Fin0", + "fid": "h2o", + "name": "h2o", + "basename": "h2o", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_j_1E", + "fid": "institute", + "name": "institute", + "basename": "institute", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_gniL", + "fid": "rig_type", + "name": "rig_type", + "basename": "rig_type", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_vzSl", + "fid": "room", + "name": "room", + "basename": "room", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_H4F3", + "fid": "hardware", + "name": "hardware", + "basename": "hardware", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw__ARv", + "fid": "data_source", + "name": "data_source", + "basename": "data_source", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_Xn84", + "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_DRMe", + "fid": "session", + "name": "session", + "basename": "session", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_UU2r", + "fid": "nwb_suffix", + "name": "nwb_suffix", + "basename": "nwb_suffix", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_tO8c", + "fid": "session_run_time_in_min", + "name": "session_run_time_in_min", + "basename": "session_run_time_in_min", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_3klA", + "fid": "water_in_session_foraging", + "name": "water_in_session_foraging", + "basename": "water_in_session_foraging", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_Cex8", + "fid": "water_in_session_manual", + "name": "water_in_session_manual", + "basename": "water_in_session_manual", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_PEI6", + "fid": "water_in_session_total", + "name": "water_in_session_total", + "basename": "water_in_session_total", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_ugWd", + "fid": "water_after_session", + "name": "water_after_session", + "basename": "water_after_session", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_z3jf", + "fid": "water_day_total", + "name": "water_day_total", + "basename": "water_day_total", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_RW0F", + "fid": "base_weight", + "name": "base_weight", + "basename": "base_weight", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_-Qrv", + "fid": "target_weight", + "name": "target_weight", + "basename": "target_weight", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_AdzI", + "fid": "target_weight_ratio", + "name": "target_weight_ratio", + "basename": "target_weight_ratio", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_naOi", + "fid": "weight_after", + "name": "weight_after", + "basename": "weight_after", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_H1nO", + "fid": "weight_after_ratio", + "name": "weight_after_ratio", + "basename": "weight_after_ratio", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_n9Pq", + "fid": "p_reward_sum_mean", + "name": "p_reward_sum_mean", + "basename": "p_reward_sum_mean", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_1qNb", + "fid": "p_reward_sum_std", + "name": "p_reward_sum_std", + "basename": "p_reward_sum_std", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_smjQ", + "fid": "p_reward_sum_median", + "name": "p_reward_sum_median", + "basename": "p_reward_sum_median", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_tbEi", + "fid": "p_reward_contrast_mean", + "name": "p_reward_contrast_mean", + "basename": "p_reward_contrast_mean", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_aYzC", + "fid": "p_reware_contrast_median", + "name": "p_reware_contrast_median", + "basename": "p_reware_contrast_median", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_HYhB", + "fid": "effective_block_length_mean", + "name": "effective_block_length_mean", + "basename": "effective_block_length_mean", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_XDx4", + "fid": "effective_block_length_std", + "name": "effective_block_length_std", + "basename": "effective_block_length_std", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_rGlv", + "fid": "effective_block_length_median", + "name": "effective_block_length_median", + "basename": "effective_block_length_median", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_icu6", + "fid": "effective_block_length_min", + "name": "effective_block_length_min", + "basename": "effective_block_length_min", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_CbYD", + "fid": "effective_block_length_max", + "name": "effective_block_length_max", + "basename": "effective_block_length_max", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_a3Bd", + "fid": "duration_gocue_stop_mean", + "name": "duration_gocue_stop_mean", + "basename": "duration_gocue_stop_mean", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_6jgL", + "fid": "duration_gocue_stop_std", + "name": "duration_gocue_stop_std", + "basename": "duration_gocue_stop_std", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_7xy5", + "fid": "duration_gocue_stop_median", + "name": "duration_gocue_stop_median", + "basename": "duration_gocue_stop_median", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_X6lg", + "fid": "duration_gocue_stop_min", + "name": "duration_gocue_stop_min", + "basename": "duration_gocue_stop_min", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_JDn2", + "fid": "duration_gocue_stop_max", + "name": "duration_gocue_stop_max", + "basename": "duration_gocue_stop_max", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_qpKa", + "fid": "duration_delay_period_mean", + "name": "duration_delay_period_mean", + "basename": "duration_delay_period_mean", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_0uNr", + "fid": "duration_delay_period_std", + "name": "duration_delay_period_std", + "basename": "duration_delay_period_std", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_fxlr", + "fid": "duration_delay_period_median", + "name": "duration_delay_period_median", + "basename": "duration_delay_period_median", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_LKWY", + "fid": "duration_delay_period_min", + "name": "duration_delay_period_min", + "basename": "duration_delay_period_min", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_npKZ", + "fid": "duration_delay_period_max", + "name": "duration_delay_period_max", + "basename": "duration_delay_period_max", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_Z0Dv", + "fid": "duration_iti_mean", + "name": "duration_iti_mean", + "basename": "duration_iti_mean", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_uiD5", + "fid": "duration_iti_std", + "name": "duration_iti_std", + "basename": "duration_iti_std", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_wLfO", + "fid": "duration_iti_median", + "name": "duration_iti_median", + "basename": "duration_iti_median", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_0QMc", + "fid": "duration_iti_min", + "name": "duration_iti_min", + "basename": "duration_iti_min", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_CkYI", + "fid": "duration_iti_max", + "name": "duration_iti_max", + "basename": "duration_iti_max", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_cIC4", + "fid": "reward_volume_left_mean", + "name": "reward_volume_left_mean", + "basename": "reward_volume_left_mean", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_ljWB", + "fid": "reward_volume_right_mean", + "name": "reward_volume_right_mean", + "basename": "reward_volume_right_mean", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_KRV2", + "fid": "lickspout_movement_range_x", + "name": "lickspout_movement_range_x", + "basename": "lickspout_movement_range_x", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_Nh8j", + "fid": "lickspout_movement_range_y", + "name": "lickspout_movement_range_y", + "basename": "lickspout_movement_range_y", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_i9-c", + "fid": "lickspout_movement_range_z", + "name": "lickspout_movement_range_z", + "basename": "lickspout_movement_range_z", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_GkJ2", + "fid": "lickspout_initial_pos_x", + "name": "lickspout_initial_pos_x", + "basename": "lickspout_initial_pos_x", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_6Dhb", + "fid": "lickspout_initial_pos_y", + "name": "lickspout_initial_pos_y", + "basename": "lickspout_initial_pos_y", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_iirU", + "fid": "lickspout_initial_pos_z", + "name": "lickspout_initial_pos_z", + "basename": "lickspout_initial_pos_z", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_N-qg", + "fid": "lickspout_median_pos_x", + "name": "lickspout_median_pos_x", + "basename": "lickspout_median_pos_x", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_aQTM", + "fid": "lickspout_median_pos_y", + "name": "lickspout_median_pos_y", + "basename": "lickspout_median_pos_y", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_muqm", + "fid": "lickspout_median_pos_z", + "name": "lickspout_median_pos_z", + "basename": "lickspout_median_pos_z", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_EWNi", + "fid": "total_trials_with_autowater", + "name": "total_trials_with_autowater", + "basename": "total_trials_with_autowater", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_xQXZ", + "fid": "finished_trials_with_autowater", + "name": "finished_trials_with_autowater", + "basename": "finished_trials_with_autowater", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_ZIqN", + "fid": "finished_rate_with_autowater", + "name": "finished_rate_with_autowater", + "basename": "finished_rate_with_autowater", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_Yhw7", + "fid": "ignore_rate_with_autowater", + "name": "ignore_rate_with_autowater", + "basename": "ignore_rate_with_autowater", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_wzjX", + "fid": "autowater_collected", + "name": "autowater_collected", + "basename": "autowater_collected", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_3WaC", + "fid": "autowater_ignored", + "name": "autowater_ignored", + "basename": "autowater_ignored", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_w58O", + "fid": "total_trials", + "name": "total_trials", + "basename": "total_trials", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_cZmN", + "fid": "finished_trials", + "name": "finished_trials", + "basename": "finished_trials", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_D4UE", + "fid": "ignored_trials", + "name": "ignored_trials", + "basename": "ignored_trials", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_KQRs", + "fid": "finished_rate", + "name": "finished_rate", + "basename": "finished_rate", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_dkJQ", + "fid": "ignore_rate", + "name": "ignore_rate", + "basename": "ignore_rate", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_uzFH", + "fid": "reward_trials", + "name": "reward_trials", + "basename": "reward_trials", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_p0hI", + "fid": "reward_rate", + "name": "reward_rate", + "basename": "reward_rate", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_nRBw", + "fid": "foraging_eff", + "name": "foraging_eff", + "basename": "foraging_eff", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_jBl8", + "fid": "foraging_eff_random_seed", + "name": "foraging_eff_random_seed", + "basename": "foraging_eff_random_seed", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_DahB", + "fid": "foraging_performance", + "name": "foraging_performance", + "basename": "foraging_performance", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw__79E", + "fid": "foraging_performance_random_seed", + "name": "foraging_performance_random_seed", + "basename": "foraging_performance_random_seed", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_oX44", + "fid": "bias_naive", + "name": "bias_naive", + "basename": "bias_naive", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_QfQT", + "fid": "reaction_time_median", + "name": "reaction_time_median", + "basename": "reaction_time_median", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_1jwi", + "fid": "reaction_time_mean", + "name": "reaction_time_mean", + "basename": "reaction_time_mean", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_avtO", + "fid": "early_lick_rate", + "name": "early_lick_rate", + "basename": "early_lick_rate", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_pPnM", + "fid": "invalid_lick_ratio", + "name": "invalid_lick_ratio", + "basename": "invalid_lick_ratio", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw__vvi", + "fid": "double_dipping_rate_finished_trials", + "name": "double_dipping_rate_finished_trials", + "basename": "double_dipping_rate_finished_trials", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_BLBw", + "fid": "double_dipping_rate_finished_reward_trials", + "name": "double_dipping_rate_finished_reward_trials", + "basename": "double_dipping_rate_finished_reward_trials", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_Sx1l", + "fid": "double_dipping_rate_finished_noreward_trials", + "name": "double_dipping_rate_finished_noreward_trials", + "basename": "double_dipping_rate_finished_noreward_trials", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_fLMy", + "fid": "lick_consistency_mean_finished_trials", + "name": "lick_consistency_mean_finished_trials", + "basename": "lick_consistency_mean_finished_trials", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_ufaN", + "fid": "lick_consistency_mean_finished_reward_trials", + "name": "lick_consistency_mean_finished_reward_trials", + "basename": "lick_consistency_mean_finished_reward_trials", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_O-Pn", + "fid": "lick_consistency_mean_finished_noreward_trials", + "name": "lick_consistency_mean_finished_noreward_trials", + "basename": "lick_consistency_mean_finished_noreward_trials", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_y9Tw", + "fid": "logistic_Su2022_RewC_tau", + "name": "logistic_Su2022_RewC_tau", + "basename": "logistic_Su2022_RewC_tau", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_qsGk", + "fid": "logistic_Su2022_RewC_amp", + "name": "logistic_Su2022_RewC_amp", + "basename": "logistic_Su2022_RewC_amp", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_yPrU", + "fid": "logistic_Su2022_UnrC_tau", + "name": "logistic_Su2022_UnrC_tau", + "basename": "logistic_Su2022_UnrC_tau", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_2I99", + "fid": "logistic_Su2022_UnrC_amp", + "name": "logistic_Su2022_UnrC_amp", + "basename": "logistic_Su2022_UnrC_amp", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_OBq6", + "fid": "logistic_Su2022_bias", + "name": "logistic_Su2022_bias", + "basename": "logistic_Su2022_bias", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_aIpo", + "fid": "logistic_Bari2019_RewC_tau", + "name": "logistic_Bari2019_RewC_tau", + "basename": "logistic_Bari2019_RewC_tau", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_KUmm", + "fid": "logistic_Bari2019_RewC_amp", + "name": "logistic_Bari2019_RewC_amp", + "basename": "logistic_Bari2019_RewC_amp", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_btxO", + "fid": "logistic_Bari2019_Choice_tau", + "name": "logistic_Bari2019_Choice_tau", + "basename": "logistic_Bari2019_Choice_tau", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_ctv8", + "fid": "logistic_Bari2019_Choice_amp", + "name": "logistic_Bari2019_Choice_amp", + "basename": "logistic_Bari2019_Choice_amp", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_tNuJ", + "fid": "logistic_Bari2019_bias", + "name": "logistic_Bari2019_bias", + "basename": "logistic_Bari2019_bias", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_0zHz", + "fid": "logistic_Hattori2019_RewC_tau", + "name": "logistic_Hattori2019_RewC_tau", + "basename": "logistic_Hattori2019_RewC_tau", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_VvKQ", + "fid": "logistic_Hattori2019_RewC_amp", + "name": "logistic_Hattori2019_RewC_amp", + "basename": "logistic_Hattori2019_RewC_amp", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_9gZR", + "fid": "logistic_Hattori2019_UnrC_tau", + "name": "logistic_Hattori2019_UnrC_tau", + "basename": "logistic_Hattori2019_UnrC_tau", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_ebSM", + "fid": "logistic_Hattori2019_UnrC_amp", + "name": "logistic_Hattori2019_UnrC_amp", + "basename": "logistic_Hattori2019_UnrC_amp", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_kG26", + "fid": "logistic_Hattori2019_Choice_tau", + "name": "logistic_Hattori2019_Choice_tau", + "basename": "logistic_Hattori2019_Choice_tau", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_rQ7Z", + "fid": "logistic_Hattori2019_Choice_amp", + "name": "logistic_Hattori2019_Choice_amp", + "basename": "logistic_Hattori2019_Choice_amp", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_A5tD", + "fid": "logistic_Hattori2019_bias", + "name": "logistic_Hattori2019_bias", + "basename": "logistic_Hattori2019_bias", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_nxbW", + "fid": "logistic_Miller2021_Choice_tau", + "name": "logistic_Miller2021_Choice_tau", + "basename": "logistic_Miller2021_Choice_tau", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_xMoE", + "fid": "logistic_Miller2021_Choice_amp", + "name": "logistic_Miller2021_Choice_amp", + "basename": "logistic_Miller2021_Choice_amp", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_7wYi", + "fid": "logistic_Miller2021_Reward_tau", + "name": "logistic_Miller2021_Reward_tau", + "basename": "logistic_Miller2021_Reward_tau", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_8MyX", + "fid": "logistic_Miller2021_Reward_amp", + "name": "logistic_Miller2021_Reward_amp", + "basename": "logistic_Miller2021_Reward_amp", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_GXsP", + "fid": "logistic_Miller2021_Choice_x_Reward_tau", + "name": "logistic_Miller2021_Choice_x_Reward_tau", + "basename": "logistic_Miller2021_Choice_x_Reward_tau", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_w3MF", + "fid": "logistic_Miller2021_Choice_x_Reward_amp", + "name": "logistic_Miller2021_Choice_x_Reward_amp", + "basename": "logistic_Miller2021_Choice_x_Reward_amp", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_6xHm", + "fid": "logistic_Miller2021_bias", + "name": "logistic_Miller2021_bias", + "basename": "logistic_Miller2021_bias", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_-joz", + "fid": "abs(bias_naive)", + "name": "abs(bias_naive)", + "basename": "abs(bias_naive)", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_lJmb", + "fid": "abs(logistic_Su2022_bias)", + "name": "abs(logistic_Su2022_bias)", + "basename": "abs(logistic_Su2022_bias)", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_Hxk4", + "fid": "abs(logistic_Bari2019_bias)", + "name": "abs(logistic_Bari2019_bias)", + "basename": "abs(logistic_Bari2019_bias)", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_aHL6", + "fid": "abs(logistic_Hattori2019_bias)", + "name": "abs(logistic_Hattori2019_bias)", + "basename": "abs(logistic_Hattori2019_bias)", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_uHT4", + "fid": "abs(logistic_Miller2021_bias)", + "name": "abs(logistic_Miller2021_bias)", + "basename": "abs(logistic_Miller2021_bias)", + "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_uAnD", + "fid": "session", + "name": "session", + "basename": "session", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "count", + "offset": 0 + } + ], + "columns": [], + "color": [ + { + "dragId": "gw_zf4t", + "fid": "data_source", + "name": "data_source", + "basename": "data_source", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + } + ], + "opacity": [], + "size": [], + "shape": [], + "radius": [ + { + "dragId": "gw_xETv", + "fid": "session", + "name": "session", + "basename": "session", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + } + ], + "theta": [ + { + "dragId": "gw_gg_E", + "fid": "data_source", + "name": "data_source", + "basename": "data_source", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + } + ], + "longitude": [], + "latitude": [], + "geoId": [], + "details": [], + "filters": [], + "text": [] + }, + "layout": { + "showActions": false, + "showTableSummary": false, + "stack": "stack", + "interactiveScale": false, + "zeroScale": true, + "size": { + "mode": "fixed", + "width": 295, + "height": 648 + }, + "format": {}, + "geoKey": "name", + "resolve": { + "x": false, + "y": false, + "color": false, + "opacity": false, + "shape": false, + "size": false + }, + "scaleIncludeUnmatchedChoropleth": false, + "colorPalette": "tableau20", + "useSvg": false, + "scale": { + "opacity": {}, + "size": {} + } + }, + "visId": "gw_43HM", + "name": "All sessions by room" + }, + { + "config": { + "defaultAggregated": true, + "geoms": [ + "bar" + ], + "coordSystem": "generic", + "limit": -1, + "timezoneDisplayOffset": 0 + }, + "encodings": { + "dimensions": [ + { + "dragId": "gw_2jcc", + "fid": "subject_id", + "name": "subject_id", + "basename": "subject_id", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_rj-w", + "fid": "session_date", + "name": "session_date", + "basename": "session_date", + "semanticType": "temporal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_haeO", + "fid": "rig", + "name": "rig", + "basename": "rig", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_PyDA", + "fid": "user_name", + "name": "user_name", + "basename": "user_name", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_4aHi", + "fid": "experiment_description", + "name": "experiment_description", + "basename": "experiment_description", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_aWAc", + "fid": "task", + "name": "task", + "basename": "task", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_FxEw", + "fid": "notes", + "name": "notes", + "basename": "notes", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_DBj8", + "fid": "session_start_time", + "name": "session_start_time", + "basename": "session_start_time", + "semanticType": "temporal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_cYiw", + "fid": "session_end_time", + "name": "session_end_time", + "basename": "session_end_time", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_QWvN", + "fid": "curriculum_name", + "name": "curriculum_name", + "basename": "curriculum_name", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_chUS", + "fid": "curriculum_version", + "name": "curriculum_version", + "basename": "curriculum_version", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_yHQe", + "fid": "curriculum_schema_version", + "name": "curriculum_schema_version", + "basename": "curriculum_schema_version", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_NZEt", + "fid": "current_stage_actual", + "name": "current_stage_actual", + "basename": "current_stage_actual", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_r-UU", + "fid": "if_overriden_by_trainer", + "name": "if_overriden_by_trainer", + "basename": "if_overriden_by_trainer", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_YvYg", + "fid": "if_consistent_within_session", + "name": "if_consistent_within_session", + "basename": "if_consistent_within_session", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_gHj_", + "fid": "has_video", + "name": "has_video", + "basename": "has_video", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_9Be2", + "fid": "has_ephys", + "name": "has_ephys", + "basename": "has_ephys", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_GAS4", + "fid": "old_bpod_session", + "name": "old_bpod_session", + "basename": "old_bpod_session", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_1HH8", + "fid": "h2o", + "name": "h2o", + "basename": "h2o", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_mwAw", + "fid": "institute", + "name": "institute", + "basename": "institute", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_KwT6", + "fid": "rig_type", + "name": "rig_type", + "basename": "rig_type", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_EebA", + "fid": "room", + "name": "room", + "basename": "room", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_dnlr", + "fid": "hardware", + "name": "hardware", + "basename": "hardware", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_c1aj", + "fid": "data_source", + "name": "data_source", + "basename": "data_source", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + }, + { + "dragId": "gw_n0c2", + "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_gu42", + "fid": "session", + "name": "session", + "basename": "session", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_pKfl", + "fid": "nwb_suffix", + "name": "nwb_suffix", + "basename": "nwb_suffix", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_YWE7", + "fid": "session_run_time_in_min", + "name": "session_run_time_in_min", + "basename": "session_run_time_in_min", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_Wvji", + "fid": "water_in_session_foraging", + "name": "water_in_session_foraging", + "basename": "water_in_session_foraging", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_GJxG", + "fid": "water_in_session_manual", + "name": "water_in_session_manual", + "basename": "water_in_session_manual", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_zFKJ", + "fid": "water_in_session_total", + "name": "water_in_session_total", + "basename": "water_in_session_total", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_gstS", + "fid": "water_after_session", + "name": "water_after_session", + "basename": "water_after_session", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_WsHd", + "fid": "water_day_total", + "name": "water_day_total", + "basename": "water_day_total", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_Uu0j", + "fid": "base_weight", + "name": "base_weight", + "basename": "base_weight", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_IYfA", + "fid": "target_weight", + "name": "target_weight", + "basename": "target_weight", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_WyKI", + "fid": "target_weight_ratio", + "name": "target_weight_ratio", + "basename": "target_weight_ratio", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_9Xq_", + "fid": "weight_after", + "name": "weight_after", + "basename": "weight_after", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_SW-A", + "fid": "weight_after_ratio", + "name": "weight_after_ratio", + "basename": "weight_after_ratio", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_Oryd", + "fid": "p_reward_sum_mean", + "name": "p_reward_sum_mean", + "basename": "p_reward_sum_mean", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_BGuC", + "fid": "p_reward_sum_std", + "name": "p_reward_sum_std", + "basename": "p_reward_sum_std", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_VOYk", + "fid": "p_reward_sum_median", + "name": "p_reward_sum_median", + "basename": "p_reward_sum_median", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_KvjV", + "fid": "p_reward_contrast_mean", + "name": "p_reward_contrast_mean", + "basename": "p_reward_contrast_mean", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_xA_i", + "fid": "p_reware_contrast_median", + "name": "p_reware_contrast_median", + "basename": "p_reware_contrast_median", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_GTqR", + "fid": "effective_block_length_mean", + "name": "effective_block_length_mean", + "basename": "effective_block_length_mean", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_kPyR", + "fid": "effective_block_length_std", + "name": "effective_block_length_std", + "basename": "effective_block_length_std", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_mliX", + "fid": "effective_block_length_median", + "name": "effective_block_length_median", + "basename": "effective_block_length_median", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_odhR", + "fid": "effective_block_length_min", + "name": "effective_block_length_min", + "basename": "effective_block_length_min", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_IPKk", + "fid": "effective_block_length_max", + "name": "effective_block_length_max", + "basename": "effective_block_length_max", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_iZhy", + "fid": "duration_gocue_stop_mean", + "name": "duration_gocue_stop_mean", + "basename": "duration_gocue_stop_mean", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_P0ne", + "fid": "duration_gocue_stop_std", + "name": "duration_gocue_stop_std", + "basename": "duration_gocue_stop_std", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_U1bu", + "fid": "duration_gocue_stop_median", + "name": "duration_gocue_stop_median", + "basename": "duration_gocue_stop_median", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_8jUd", + "fid": "duration_gocue_stop_min", + "name": "duration_gocue_stop_min", + "basename": "duration_gocue_stop_min", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_ywBj", + "fid": "duration_gocue_stop_max", + "name": "duration_gocue_stop_max", + "basename": "duration_gocue_stop_max", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_mRqT", + "fid": "duration_delay_period_mean", + "name": "duration_delay_period_mean", + "basename": "duration_delay_period_mean", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_rwez", + "fid": "duration_delay_period_std", + "name": "duration_delay_period_std", + "basename": "duration_delay_period_std", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_9O_p", + "fid": "duration_delay_period_median", + "name": "duration_delay_period_median", + "basename": "duration_delay_period_median", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_Dla4", + "fid": "duration_delay_period_min", + "name": "duration_delay_period_min", + "basename": "duration_delay_period_min", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_ZBKE", + "fid": "duration_delay_period_max", + "name": "duration_delay_period_max", + "basename": "duration_delay_period_max", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_PzVc", + "fid": "duration_iti_mean", + "name": "duration_iti_mean", + "basename": "duration_iti_mean", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_Yiam", + "fid": "duration_iti_std", + "name": "duration_iti_std", + "basename": "duration_iti_std", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_wtjC", + "fid": "duration_iti_median", + "name": "duration_iti_median", + "basename": "duration_iti_median", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_2Am4", + "fid": "duration_iti_min", + "name": "duration_iti_min", + "basename": "duration_iti_min", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_T6Hu", + "fid": "duration_iti_max", + "name": "duration_iti_max", + "basename": "duration_iti_max", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_8qEY", + "fid": "reward_volume_left_mean", + "name": "reward_volume_left_mean", + "basename": "reward_volume_left_mean", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_35Ib", + "fid": "reward_volume_right_mean", + "name": "reward_volume_right_mean", + "basename": "reward_volume_right_mean", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_uyS3", + "fid": "lickspout_movement_range_x", + "name": "lickspout_movement_range_x", + "basename": "lickspout_movement_range_x", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_ApuQ", + "fid": "lickspout_movement_range_y", + "name": "lickspout_movement_range_y", + "basename": "lickspout_movement_range_y", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_5fXB", + "fid": "lickspout_movement_range_z", + "name": "lickspout_movement_range_z", + "basename": "lickspout_movement_range_z", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_u2JV", + "fid": "lickspout_initial_pos_x", + "name": "lickspout_initial_pos_x", + "basename": "lickspout_initial_pos_x", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_C93E", + "fid": "lickspout_initial_pos_y", + "name": "lickspout_initial_pos_y", + "basename": "lickspout_initial_pos_y", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_1AvZ", + "fid": "lickspout_initial_pos_z", + "name": "lickspout_initial_pos_z", + "basename": "lickspout_initial_pos_z", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_I6us", + "fid": "lickspout_median_pos_x", + "name": "lickspout_median_pos_x", + "basename": "lickspout_median_pos_x", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_1bXp", + "fid": "lickspout_median_pos_y", + "name": "lickspout_median_pos_y", + "basename": "lickspout_median_pos_y", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_KCFy", + "fid": "lickspout_median_pos_z", + "name": "lickspout_median_pos_z", + "basename": "lickspout_median_pos_z", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_2xJA", + "fid": "total_trials_with_autowater", + "name": "total_trials_with_autowater", + "basename": "total_trials_with_autowater", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_aC1F", + "fid": "finished_trials_with_autowater", + "name": "finished_trials_with_autowater", + "basename": "finished_trials_with_autowater", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_33tf", + "fid": "finished_rate_with_autowater", + "name": "finished_rate_with_autowater", + "basename": "finished_rate_with_autowater", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_o1p3", + "fid": "ignore_rate_with_autowater", + "name": "ignore_rate_with_autowater", + "basename": "ignore_rate_with_autowater", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_H2wj", + "fid": "autowater_collected", + "name": "autowater_collected", + "basename": "autowater_collected", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_zHOt", + "fid": "autowater_ignored", + "name": "autowater_ignored", + "basename": "autowater_ignored", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_hkfy", + "fid": "total_trials", + "name": "total_trials", + "basename": "total_trials", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_Af_4", + "fid": "finished_trials", + "name": "finished_trials", + "basename": "finished_trials", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_xFfW", + "fid": "ignored_trials", + "name": "ignored_trials", + "basename": "ignored_trials", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_bb8o", + "fid": "finished_rate", + "name": "finished_rate", + "basename": "finished_rate", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_-aVl", + "fid": "ignore_rate", + "name": "ignore_rate", + "basename": "ignore_rate", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_5B3k", + "fid": "reward_trials", + "name": "reward_trials", + "basename": "reward_trials", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_jaZn", + "fid": "reward_rate", + "name": "reward_rate", + "basename": "reward_rate", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_jO37", + "fid": "foraging_eff", + "name": "foraging_eff", + "basename": "foraging_eff", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_qOgh", + "fid": "foraging_eff_random_seed", + "name": "foraging_eff_random_seed", + "basename": "foraging_eff_random_seed", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_6aQA", + "fid": "foraging_performance", + "name": "foraging_performance", + "basename": "foraging_performance", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_NjIu", + "fid": "foraging_performance_random_seed", + "name": "foraging_performance_random_seed", + "basename": "foraging_performance_random_seed", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_rrMg", + "fid": "bias_naive", + "name": "bias_naive", + "basename": "bias_naive", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_mkxT", + "fid": "reaction_time_median", + "name": "reaction_time_median", + "basename": "reaction_time_median", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_diG1", + "fid": "reaction_time_mean", + "name": "reaction_time_mean", + "basename": "reaction_time_mean", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_SRl5", + "fid": "early_lick_rate", + "name": "early_lick_rate", + "basename": "early_lick_rate", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_OT09", + "fid": "invalid_lick_ratio", + "name": "invalid_lick_ratio", + "basename": "invalid_lick_ratio", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_ph78", + "fid": "double_dipping_rate_finished_trials", + "name": "double_dipping_rate_finished_trials", + "basename": "double_dipping_rate_finished_trials", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_s32J", + "fid": "double_dipping_rate_finished_reward_trials", + "name": "double_dipping_rate_finished_reward_trials", + "basename": "double_dipping_rate_finished_reward_trials", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_SJPY", + "fid": "double_dipping_rate_finished_noreward_trials", + "name": "double_dipping_rate_finished_noreward_trials", + "basename": "double_dipping_rate_finished_noreward_trials", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_liGS", + "fid": "lick_consistency_mean_finished_trials", + "name": "lick_consistency_mean_finished_trials", + "basename": "lick_consistency_mean_finished_trials", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_eMOV", + "fid": "lick_consistency_mean_finished_reward_trials", + "name": "lick_consistency_mean_finished_reward_trials", + "basename": "lick_consistency_mean_finished_reward_trials", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_FAdi", + "fid": "lick_consistency_mean_finished_noreward_trials", + "name": "lick_consistency_mean_finished_noreward_trials", + "basename": "lick_consistency_mean_finished_noreward_trials", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_D8Gn", + "fid": "logistic_Su2022_RewC_tau", + "name": "logistic_Su2022_RewC_tau", + "basename": "logistic_Su2022_RewC_tau", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_kuX-", + "fid": "logistic_Su2022_RewC_amp", + "name": "logistic_Su2022_RewC_amp", + "basename": "logistic_Su2022_RewC_amp", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_ob1B", + "fid": "logistic_Su2022_UnrC_tau", + "name": "logistic_Su2022_UnrC_tau", + "basename": "logistic_Su2022_UnrC_tau", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_pWpq", + "fid": "logistic_Su2022_UnrC_amp", + "name": "logistic_Su2022_UnrC_amp", + "basename": "logistic_Su2022_UnrC_amp", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_KOV-", + "fid": "logistic_Su2022_bias", + "name": "logistic_Su2022_bias", + "basename": "logistic_Su2022_bias", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_LNxO", + "fid": "logistic_Bari2019_RewC_tau", + "name": "logistic_Bari2019_RewC_tau", + "basename": "logistic_Bari2019_RewC_tau", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_fjvW", + "fid": "logistic_Bari2019_RewC_amp", + "name": "logistic_Bari2019_RewC_amp", + "basename": "logistic_Bari2019_RewC_amp", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_4I_W", + "fid": "logistic_Bari2019_Choice_tau", + "name": "logistic_Bari2019_Choice_tau", + "basename": "logistic_Bari2019_Choice_tau", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_4gHg", + "fid": "logistic_Bari2019_Choice_amp", + "name": "logistic_Bari2019_Choice_amp", + "basename": "logistic_Bari2019_Choice_amp", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_gsF3", + "fid": "logistic_Bari2019_bias", + "name": "logistic_Bari2019_bias", + "basename": "logistic_Bari2019_bias", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_uZOb", + "fid": "logistic_Hattori2019_RewC_tau", + "name": "logistic_Hattori2019_RewC_tau", + "basename": "logistic_Hattori2019_RewC_tau", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_mJTD", + "fid": "logistic_Hattori2019_RewC_amp", + "name": "logistic_Hattori2019_RewC_amp", + "basename": "logistic_Hattori2019_RewC_amp", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_kqpC", + "fid": "logistic_Hattori2019_UnrC_tau", + "name": "logistic_Hattori2019_UnrC_tau", + "basename": "logistic_Hattori2019_UnrC_tau", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_r0FS", + "fid": "logistic_Hattori2019_UnrC_amp", + "name": "logistic_Hattori2019_UnrC_amp", + "basename": "logistic_Hattori2019_UnrC_amp", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_h2hg", + "fid": "logistic_Hattori2019_Choice_tau", + "name": "logistic_Hattori2019_Choice_tau", + "basename": "logistic_Hattori2019_Choice_tau", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_RWV5", + "fid": "logistic_Hattori2019_Choice_amp", + "name": "logistic_Hattori2019_Choice_amp", + "basename": "logistic_Hattori2019_Choice_amp", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_fzqT", + "fid": "logistic_Hattori2019_bias", + "name": "logistic_Hattori2019_bias", + "basename": "logistic_Hattori2019_bias", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_KW1K", + "fid": "logistic_Miller2021_Choice_tau", + "name": "logistic_Miller2021_Choice_tau", + "basename": "logistic_Miller2021_Choice_tau", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_wGc-", + "fid": "logistic_Miller2021_Choice_amp", + "name": "logistic_Miller2021_Choice_amp", + "basename": "logistic_Miller2021_Choice_amp", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_RT8m", + "fid": "logistic_Miller2021_Reward_tau", + "name": "logistic_Miller2021_Reward_tau", + "basename": "logistic_Miller2021_Reward_tau", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_Kg_Z", + "fid": "logistic_Miller2021_Reward_amp", + "name": "logistic_Miller2021_Reward_amp", + "basename": "logistic_Miller2021_Reward_amp", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_sPZn", + "fid": "logistic_Miller2021_Choice_x_Reward_tau", + "name": "logistic_Miller2021_Choice_x_Reward_tau", + "basename": "logistic_Miller2021_Choice_x_Reward_tau", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_I5Dc", + "fid": "logistic_Miller2021_Choice_x_Reward_amp", + "name": "logistic_Miller2021_Choice_x_Reward_amp", + "basename": "logistic_Miller2021_Choice_x_Reward_amp", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_Mf1w", + "fid": "logistic_Miller2021_bias", + "name": "logistic_Miller2021_bias", + "basename": "logistic_Miller2021_bias", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_SNkd", + "fid": "abs(bias_naive)", + "name": "abs(bias_naive)", + "basename": "abs(bias_naive)", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_gXY7", + "fid": "abs(logistic_Su2022_bias)", + "name": "abs(logistic_Su2022_bias)", + "basename": "abs(logistic_Su2022_bias)", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_WYNc", + "fid": "abs(logistic_Bari2019_bias)", + "name": "abs(logistic_Bari2019_bias)", + "basename": "abs(logistic_Bari2019_bias)", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_1jbY", + "fid": "abs(logistic_Hattori2019_bias)", + "name": "abs(logistic_Hattori2019_bias)", + "basename": "abs(logistic_Hattori2019_bias)", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "sum", + "offset": 0 + }, + { + "dragId": "gw_mpM7", + "fid": "abs(logistic_Miller2021_bias)", + "name": "abs(logistic_Miller2021_bias)", + "basename": "abs(logistic_Miller2021_bias)", + "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_NX0y", + "fid": "session", + "name": "session", + "basename": "session", + "analyticType": "measure", + "semanticType": "quantitative", + "aggName": "count", + "offset": 0 + } + ], + "columns": [], + "color": [ + { + "dragId": "gw_T0MT", + "fid": "task", + "name": "task", + "basename": "task", + "semanticType": "nominal", + "analyticType": "dimension", + "offset": 0 + } + ], + "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": 297, + "height": 567 + }, + "format": {}, + "geoKey": "name", + "resolve": { + "x": false, + "y": false, + "color": false, + "opacity": false, + "shape": false, + "size": false + } + }, + "visId": "gw_FW26", + "name": "All sessions by task" } ] \ No newline at end of file From 9317c31db4cc8741af6c7a2e1e6e6d6ebcdc4248 Mon Sep 17 00:00:00 2001 From: hh_itx_win10 Date: Sun, 7 Apr 2024 18:26:27 -0700 Subject: [PATCH 12/15] fix: xy plot for old mice --- code/util/streamlit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/util/streamlit.py b/code/util/streamlit.py index 7b88bd2..fcd1cd3 100644 --- a/code/util/streamlit.py +++ b/code/util/streamlit.py @@ -978,7 +978,7 @@ def _add_agg(df_this, x_name, y_name, group, aggr_method, if_use_x_quantile, q_q this_session[dot_size_mapping_name] if dot_size_mapping_name !='None' else [np.nan] * len(this_session.h2o), # 8 - this_session.data_source if 'data_source' in this_session else '', # 9 + this_session.data_source if 'data_source' in this_session else [''] * len(this_session.h2o), # 9 ), axis=-1), unselected=dict(marker_color='lightgrey') )) From d57f7a57bb2c34f74fd7b86fd1fc8ac49931a12e Mon Sep 17 00:00:00 2001 From: hh_itx_win10 Date: Sun, 7 Apr 2024 18:57:11 -0700 Subject: [PATCH 13/15] chore: remove abnormal weight --- code/Home.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/Home.py b/code/Home.py index 51c2875..39cfd2e 100644 --- a/code/Home.py +++ b/code/Home.py @@ -662,6 +662,9 @@ def _get_data_source(rig): } _df.fillna(filled_values, inplace=True) + # Remove abnormal values + _df.loc[_df['weight_after'] > 100, ['weight_after', 'weight_after_ratio']] = np.nan + # foraging performance = foraing_eff * finished_rate if 'foraging_performance' not in _df.columns: _df['foraging_performance'] = \ From 2b3f61ceed14bdb4d6d99a4416895ad0427727da Mon Sep 17 00:00:00 2001 From: hh_itx_win10 Date: Sun, 7 Apr 2024 19:46:35 -0700 Subject: [PATCH 14/15] more minor --- code/Home.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/code/Home.py b/code/Home.py index 39cfd2e..61a3f76 100644 --- a/code/Home.py +++ b/code/Home.py @@ -663,7 +663,12 @@ def _get_data_source(rig): _df.fillna(filled_values, inplace=True) # Remove abnormal values - _df.loc[_df['weight_after'] > 100, ['weight_after', 'weight_after_ratio']] = np.nan + _df.loc[_df['weight_after'] > 100, + ['weight_after', 'weight_after_ratio', 'water_in_session_total', 'water_after_session', 'water_day_total'] + ] = np.nan + + _df.loc[_df['water_in_session_manual'] > 100, + ['water_in_session_manual', 'water_in_session_total', 'water_after_session']] = np.nan # foraging performance = foraing_eff * finished_rate if 'foraging_performance' not in _df.columns: From e4af24f2e34c52c1f47f4a4b9f8e96cefa5d5d75 Mon Sep 17 00:00:00 2001 From: hh_itx_win10 Date: Sun, 7 Apr 2024 23:06:57 -0700 Subject: [PATCH 15/15] feat: allow user to select colormap --- code/Home.py | 5 ++++- code/util/streamlit.py | 13 +++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/code/Home.py b/code/Home.py index 61a3f76..ec029f3 100644 --- a/code/Home.py +++ b/code/Home.py @@ -88,6 +88,7 @@ 'x_y_plot_figure_width': 1300, 'x_y_plot_figure_height': 900, 'x_y_plot_font_size_scale': 1.0, + 'x_y_plot_selected_color_map': 'Plotly', 'x_y_plot_size_mapper': 'finished_trials', 'x_y_plot_size_mapper_gamma': 1.0, @@ -426,7 +427,8 @@ def plot_x_y_session(): with cols[1]: (if_show_dots, if_aggr_each_group, aggr_method_group, if_use_x_quantile_group, q_quantiles_group, if_aggr_all, aggr_method_all, if_use_x_quantile_all, q_quantiles_all, smooth_factor, if_show_diagonal, - dot_size, dot_opacity, line_width, x_y_plot_figure_width, x_y_plot_figure_height, font_size_scale) = add_xy_setting() + dot_size, dot_opacity, line_width, x_y_plot_figure_width, x_y_plot_figure_height, + font_size_scale, color_map) = add_xy_setting() if st.session_state.x_y_plot_if_show_dots: with cols[2]: @@ -478,6 +480,7 @@ def plot_x_y_session(): x_y_plot_figure_width=x_y_plot_figure_width, x_y_plot_figure_height=x_y_plot_figure_height, font_size_scale=font_size_scale, + color_map=color_map, ) # st.plotly_chart(fig) diff --git a/code/util/streamlit.py b/code/util/streamlit.py index fcd1cd3..17c68f0 100644 --- a/code/util/streamlit.py +++ b/code/util/streamlit.py @@ -571,10 +571,18 @@ def add_xy_setting(): step=0.1, key='x_y_plot_font_size_scale', default=1.0) + + available_color_maps = list(px.colors.qualitative.__dict__.keys()) + available_color_maps = [c for c in available_color_maps if not c.startswith("_") and c != 'swatches'] + color_map = selectbox_wrapper_for_url_query(c[0], + label='Color map', + options=available_color_maps, + key='x_y_plot_selected_color_map', + default=available_color_maps.index('Plotly')) return (if_show_dots, if_aggr_each_group, aggr_method_group, if_use_x_quantile_group, q_quantiles_group, if_aggr_all, aggr_method_all, if_use_x_quantile_all, q_quantiles_all, smooth_factor, if_show_diagonal, - dot_size, dot_opacity, line_width, figure_width, figure_height, font_size_scale) + dot_size, dot_opacity, line_width, figure_width, figure_height, font_size_scale, color_map) @st.cache_data(ttl=24*3600) def _get_min_max(x, size_mapper_gamma): @@ -767,6 +775,7 @@ def _plot_population_x_y(df, x_name='session', y_name='foraging_eff', group_by=' x_y_plot_figure_width=1300, x_y_plot_figure_height=900, font_size_scale=1.0, + color_map='Plotly', **kwarg): def _add_agg(df_this, x_name, y_name, group, aggr_method, if_use_x_quantile, q_quantiles, col, line_width, hoverinfo='skip', **kwarg): @@ -904,7 +913,7 @@ def _add_agg(df_this, x_name, y_name, group, aggr_method, if_use_x_quantile, q_q pass fig = go.Figure() - col_map = px.colors.qualitative.Plotly + col_map = px.colors.qualitative.__dict__[color_map] # Add some more columns if dot_size_mapping_name !='None' and dot_size_mapping_name in df.columns: