Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cdolfi committed Dec 12, 2023
1 parent 3b3391e commit 3bde828
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions 8Knot/pages/codebase/visualizations/cntrb_file_heatmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
id=f"directory-{PAGE}-{VIZ_ID}",
classNames={"values": "dmc-multiselect-custom"},
searchable=True,
clearable=True,
clearable=False,
),
],
className="me-2",
Expand Down Expand Up @@ -192,7 +192,9 @@ def directory_dropdown(repo_id):

# take all of the files, split on the last instance of a / to get directories and top level files
directories = df["file_path"].str.rsplit("/", n=1).str[0].tolist()
directories = list(set(directories))
# applies another rsplit to make sure directories that only have folders are included
folder_only_directories = [x.rsplit("/", 1)[0] for x in directories]
directories = list(set(directories + folder_only_directories))

# get all of the file names to filter out of the directory set
top_level_files = df["file_name"][df[1].isnull()].tolist()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
id=f"directory-{PAGE}-{VIZ_ID}",
classNames={"values": "dmc-multiselect-custom"},
searchable=True,
clearable=True,
clearable=False,
),
],
className="me-2",
Expand Down Expand Up @@ -210,7 +210,9 @@ def directory_dropdown(repo_id):

# get all of the file names to filter out of the directory set
top_level_files = df["file_name"][df[1].isnull()].tolist()
directories = [f for f in directories if f not in top_level_files]
# applies another rsplit to make sure directories that only have folders are included
folder_only_directories = [x.rsplit("/", 1)[0] for x in directories]
directories = list(set(directories + folder_only_directories))

# sort alphabetically
directories = sorted(directories)
Expand Down

0 comments on commit 3bde828

Please sign in to comment.