Skip to content

Commit

Permalink
Fix mypy issues
Browse files Browse the repository at this point in the history
  • Loading branch information
stephane-caron committed Dec 16, 2024
1 parent 713418c commit fb01b78
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions qpbenchmark/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def __init__(

self.__complementary_df = complementary_df
self.df = test_set_df
self.file_path = file_path
self.file_path = Path(file_path) if file_path is not None else None
self.test_set = test_set

@property
Expand All @@ -132,9 +132,10 @@ def write(self, path: Optional[Union[str, Path]] = None) -> None:
Args:
path: Optional path to a separate file to write to.
"""
if path is None and self.file_path is None:
path_check = path or self.file_path
if path_check is None:
raise BenchmarkError("no path to save results to")
save_path = Path(path or self.file_path)
save_path = Path(path_check)
save_df = pandas.concat([self.df, self.__complementary_df])
save_df = save_df.sort_values(by=["problem", "solver", "settings"])
if save_path.suffix == ".csv":
Expand Down

0 comments on commit fb01b78

Please sign in to comment.