Skip to content

Commit

Permalink
implement more efficient suggestion using all
Browse files Browse the repository at this point in the history
  • Loading branch information
donaldcampbelljr committed Jan 25, 2024
1 parent 1680415 commit d3d4c13
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions pipestat/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,13 @@ def create_navbar_links(self, wd=None, context=None, project_index_html_relpath=
# Remove project level objects because they are stored at the bottom of the index
obj_to_remove = []
for obj in obj_result_ids:
if obj in list(self.prj.schema.project_level_data.keys()):
if obj not in list(self.prj.schema.sample_level_data.keys()):
# The object is not in sample level keys but it IS in project level
obj_to_remove.append(obj)
if all(
[
obj in list(self.prj.schema.project_level_data.keys()),
obj not in list(self.prj.schema.sample_level_data.keys()),
]
):
obj_to_remove.append(obj)

Check warning on line 282 in pipestat/reports.py

View check run for this annotation

Codecov / codecov/patch

pipestat/reports.py#L282

Added line #L282 was not covered by tests
obj_result_ids = list(set(obj_to_remove) ^ set(obj_result_ids))

dropdown_keys_objects = None
Expand Down

0 comments on commit d3d4c13

Please sign in to comment.