Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update skip logic in CPU info table #120

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading