Skip to content

Commit

Permalink
Merge pull request #182 from pepkit/dev_refactor_reporting
Browse files Browse the repository at this point in the history
Dev refactor reporting
  • Loading branch information
donaldcampbelljr committed Apr 23, 2024
2 parents b13299f + 66cdc2f commit 3a98b43
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions pipestat/reports.py
Expand Up @@ -704,7 +704,7 @@ def create_index_html(self, navbar, footer):
all_result_identifiers = input_sample_attributes + all_result_identifiers

if self.prj.cfg["multi_result_files"] is True:
pipeline_types = ["sample", "project"]
pipeline_types = ["sample"]
else:
pipeline_types = [self.prj.backend.pipeline_type]

Expand All @@ -731,6 +731,15 @@ def create_index_html(self, navbar, footer):
if key not in sample_stat_results.keys():
sample_stat_results[key] = ""

for key in self.schema.keys():
if "type" in self.schema[key]:
if (
self.schema[key]["type"] == "file"
or self.schema[key]["type"] == "image"
or self.schema[key]["type"] == "object"
):
del sample_stat_results[key]

# Sort to ensure alignment in the table
sorted_sample_stat_results = dict(sorted(sample_stat_results.items()))

Expand Down Expand Up @@ -780,13 +789,14 @@ def create_index_html(self, navbar, footer):
)

project_objects = self.create_project_objects()
columns = ["Record Identifiers"] + list(sorted_sample_stat_results.keys())
columns_table = ["Record Identifiers"] + list(sorted_sample_stat_results.keys())
columns_stats = list(sorted_sample_stat_results.keys())
template_vars = dict(
navbar=navbar,
stats_file_path=stats_file_path,
objs_file_path=objs_file_path,
columns=columns,
columns_json=dumps(columns),
columns=columns_table,
columns_json=dumps(columns_stats),
table_row_data=table_row_data,
project_name=self.prj.cfg[PROJECT_NAME],
pipeline_name=self.pipeline_name,
Expand Down Expand Up @@ -938,7 +948,7 @@ def get_nonhighlighted_results(self, types):
def _stats_to_json_str(self):
results = {}
if self.prj.cfg["multi_result_files"] is True:
pipeline_types = ["sample", "project"]
pipeline_types = ["sample"]
else:
pipeline_types = [self.prj.backend.pipeline_type]

Expand Down

0 comments on commit 3a98b43

Please sign in to comment.