Skip to content

Commit

Permalink
Add Results.nb_rows property
Browse files Browse the repository at this point in the history
  • Loading branch information
stephane-caron committed Dec 6, 2024
1 parent 28ff249 commit 091058b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ All notable changes to this project will be documented in this file.
- Add `ProblemList` class that can be saved to Parquet files
- Allow strings or paths as arguments to the main function
- CLI: Add `list_problems` command
- Optionally add a GPU summary line to reports
- New dependency: tqdm
- Optionally add a GPU summary line to reports
- Results property to get the number of result rows
- Very-verbose mode for extra debug messages

### Changed
Expand Down
5 changes: 5 additions & 0 deletions qpbenchmark/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ def __init__(self, csv_path: Optional[str], test_set: TestSet):
self.df = test_set_df
self.test_set = test_set

@property
def nb_rows(self) -> int:
"""Number of rows in the dataframe."""
return self.df.shape[0]

def write(self, path: Optional[str] = None) -> None:
"""Write results to their CSV file for persistence.
Expand Down

0 comments on commit 091058b

Please sign in to comment.