Skip to content

Commit

Permalink
Update skip logic in CPU info table
Browse files Browse the repository at this point in the history
  • Loading branch information
stephane-caron committed Sep 25, 2024
1 parent 044f58a commit 430a75e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

### Changed

- Update skip logic in CPU info table

## [2.3.0] - 2024-09-03

### Added
Expand Down
16 changes: 10 additions & 6 deletions qpbenchmark/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,19 @@ def get_cpu_info_table() -> str:
CPU information as a Markdown table.
"""
info = OrderedDict(sorted(cpuinfo.get_cpu_info().items()))
skips = {
"cpuinfo_version": "cpuinfo_version_string",
"hz_actual": "hz_actual_friendly",
"hz_advertised": "hz_advertised_friendly",
}
skips = set(
[
"cpuinfo_version",
"cpuinfo_version_string",
"hz_actual",
"hz_actual_friendly",
"hz_advertised",
]
)
table = "| Property | Value |\n"
table += "|----------|-------|\n"
for key, value in info.items():
if key in skips and skips[key] in info.keys():
if key in skips:
continue
if key == "flags":
value = ", ".join(f"`{flag}`" for flag in value)
Expand Down

0 comments on commit 430a75e

Please sign in to comment.