From 430a75e969558728e8e161087374eb06656f026c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Caron?= Date: Wed, 25 Sep 2024 15:12:19 +0200 Subject: [PATCH] Update skip logic in CPU info table --- CHANGELOG.md | 4 ++++ qpbenchmark/utils.py | 16 ++++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 96b7204..2ff5368 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/qpbenchmark/utils.py b/qpbenchmark/utils.py index 117d649..b5f9bc2 100644 --- a/qpbenchmark/utils.py +++ b/qpbenchmark/utils.py @@ -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)