Skip to content

Commit

Permalink
fix bug with table path
Browse files Browse the repository at this point in the history
  • Loading branch information
donaldcampbelljr committed Oct 26, 2023
1 parent c1e8b2b commit 8c19cb2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 2 additions & 4 deletions pipestat/pipestat.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,7 @@ def __init__(

self.cfg[MULTI_PIPELINE] = multi_pipelines

self.cfg[OUTPUT_DIR] = self.cfg[CONFIG_KEY].priority_get(
"output_dir", override=output_dir
)
self.cfg[OUTPUT_DIR] = self.cfg[CONFIG_KEY].priority_get("output_dir", override=output_dir)

if self.cfg[FILE_KEY]:
# file backend
Expand Down Expand Up @@ -661,7 +659,7 @@ def table(
"""

pipeline_name = self.pipeline_name
pipeline_name = self.cfg[PIPELINE_NAME]
table_path_list = _create_stats_objs_summaries(self, pipeline_name)

return table_path_list
Expand Down
6 changes: 3 additions & 3 deletions pipestat/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -1012,11 +1012,11 @@ def get_file_for_table(prj, pipeline_name, appendix=None, directory=None):
# TODO make determining the output_dir its own small function since we use the same code in HTML report building.
results_file_path = getattr(prj.backend, "results_file_path", None)
config_path = prj.cfg.get("config_path", None)
output_dir = getattr(prj, "output_dir", None)
output_dir = prj.cfg.get("output_dir", None)
table_dir = output_dir or results_file_path or config_path
if not os.path.isdir(table_dir):
table_dir = os.path.dirname(table_dir)
fp = os.path.join(table_dir, directory or "", f"{prj[PROJECT_NAME]}_{pipeline_name}")
fp = os.path.join(table_dir, directory or "", f"{prj.cfg[PROJECT_NAME]}_{pipeline_name}")
if hasattr(prj, "amendments") and getattr(prj, "amendments"):
fp += f"_{'_'.join(prj.amendments)}"
fp += f"_{appendix}"
Expand Down Expand Up @@ -1058,7 +1058,7 @@ def _create_stats_objs_summaries(prj, pipeline_name) -> List[str]:
rep_data = prj.retrieve(record_identifier=record_name)
reported_stats = [
record_index,
prj.project_name or "No Project Name Supplied",
prj.cfg[PROJECT_NAME] or "No Project Name Supplied",
record_name,
]

Expand Down

0 comments on commit 8c19cb2

Please sign in to comment.