Skip to content

Commit ab9c2d3

Browse files
committed
more bug fix...
1 parent 89cb595 commit ab9c2d3

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

code/pages/0_Data inventory.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ def load_presets():
6666

6767
QUERY_PRESET, VENN_PRESET = load_presets()
6868

69-
META_COLUMNS = [
70-
"PI",
69+
QUERY_COLUMNS = [
7170
"Han_temp_pipeline (bpod)",
7271
"Han_temp_pipeline (bonsai)",
7372
"VAST_raw_data_on_VAST",
@@ -80,6 +79,8 @@ def load_presets():
8079
"Quarterly": "M4",
8180
}
8281

82+
FIRST_SEVERAL_COLS = ["PI"]
83+
8384

8485
@st.cache_data(ttl=3600*12)
8586
def merge_queried_dfs(dfs, queries_to_merge):
@@ -416,8 +417,7 @@ def app():
416417
# Merging with df_merged (using the unique mouse-date dataframe)
417418
df_merged = df_merged.combine_first(df_raw_sessions_on_VAST_unique_mouse_date)
418419
df_merged.sort_index(level=["session_date", "subject_id"], ascending=[False, False], inplace=True)
419-
first_several_cols = ["PI"]
420-
df_merged = df_merged[first_several_cols + [col for col in df_merged.columns if col not in first_several_cols]]
420+
df_merged = df_merged[FIRST_SEVERAL_COLS + [col for col in df_merged.columns if col not in FIRST_SEVERAL_COLS]]
421421

422422
# --- Add sidebar ---
423423
add_sidebar(df_merged, dfs_docDB, df_Han_pipeline, dfs_raw_on_VAST, docDB_retrieve_time)
@@ -487,7 +487,7 @@ def add_venn_diagrms(df_merged):
487487
# -- Show and download df for this Venn --
488488
circle_columns = [c_s["column"] for c_s in venn_preset["circle_settings"]]
489489
# Show histogram over time for the columns and patches in preset
490-
df_this_preset = df_merged[["PI"] + circle_columns]
490+
df_this_preset = df_merged[circle_columns]
491491
# Filter out rows that have at least one True in this Venn
492492
df_this_preset = df_this_preset[df_this_preset.any(axis=1)]
493493

@@ -501,8 +501,9 @@ def add_venn_diagrms(df_merged):
501501

502502
# Join in other extra columns
503503
df_this_preset = df_this_preset.join(
504-
df_merged[[col for col in df_merged.columns if col not in META_COLUMNS]], how="left"
504+
df_merged[[col for col in df_merged.columns if col not in QUERY_COLUMNS]], how="left"
505505
)
506+
df_this_preset = df_this_preset[FIRST_SEVERAL_COLS + [col for col in df_this_preset.columns if col not in FIRST_SEVERAL_COLS]]
506507

507508
with cols[0]:
508509
download_df(

0 commit comments

Comments
 (0)