From 57d4c0f31e4eb88fdb9943829f0b731095c94ce1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20Berland?= Date: Tue, 3 Sep 2024 11:30:31 +0200 Subject: [PATCH] Use KB instead of kB kB means 1000 bytes, KB means 1024 bytes (ref. Wikipedia) --- src/ert/__main__.py | 4 ++-- src/ert/shared/status/utils.py | 2 +- tests/unit_tests/gui/simulation/test_run_dialog.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ert/__main__.py b/src/ert/__main__.py index 65040fc1b59..c9c3e4dad50 100755 --- a/src/ert/__main__.py +++ b/src/ert/__main__.py @@ -635,9 +635,9 @@ def log_process_usage() -> None: "Socket messages Received": usage.ru_msgrcv, "Signals received": usage.ru_nsignals, "Swaps": usage.ru_nswap, - "Peak memory use (kB)": maxrss, + "Peak memory use (KB)": maxrss, } - logger.info(f"Peak memory use: {maxrss} kB", extra=usage_dict) + logger.info(f"Peak memory use: {maxrss} KB", extra=usage_dict) except Exception as exc: logger.warning( f"Exception while trying to log ERT process resource usage: {exc}" diff --git a/src/ert/shared/status/utils.py b/src/ert/shared/status/utils.py index 0be39de7a99..0836e695390 100644 --- a/src/ert/shared/status/utils.py +++ b/src/ert/shared/status/utils.py @@ -3,7 +3,7 @@ def byte_with_unit(byte_count: float) -> str: - suffixes = ["B", "kB", "MB", "GB", "TB", "PB"] + suffixes = ["B", "KB", "MB", "GB", "TB", "PB"] power = float(10**3) i = 0 diff --git a/tests/unit_tests/gui/simulation/test_run_dialog.py b/tests/unit_tests/gui/simulation/test_run_dialog.py index 83059b9cd24..964453d3623 100644 --- a/tests/unit_tests/gui/simulation/test_run_dialog.py +++ b/tests/unit_tests/gui/simulation/test_run_dialog.py @@ -515,7 +515,7 @@ def test_run_dialog_memory_usage_showing( max_memory_column_proxy_index = job_model.index(job_number, max_memory_column_index) max_memory_value = job_model.data(max_memory_column_proxy_index, Qt.DisplayRole) - assert max_memory_value == "60.00 kB" + assert max_memory_value == "60.00 KB" @pytest.mark.usefixtures("use_tmpdir")