From d4199ef4c34d30161d77e91e79f2db40b41cbcab Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Mon, 16 Jun 2025 15:03:32 +0200 Subject: [PATCH] refactor(qav3): rename variables to sensible name MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- .../user_data/freqaimodels/QuickAdapterRegressorV3.py | 8 +++++--- quickadapter/user_data/strategies/Utils.py | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/quickadapter/user_data/freqaimodels/QuickAdapterRegressorV3.py b/quickadapter/user_data/freqaimodels/QuickAdapterRegressorV3.py index 47f569f..304d206 100644 --- a/quickadapter/user_data/freqaimodels/QuickAdapterRegressorV3.py +++ b/quickadapter/user_data/freqaimodels/QuickAdapterRegressorV3.py @@ -1338,9 +1338,11 @@ def zigzag( @lru_cache(maxsize=4096) def calculate_slopes_ok_min_max(slopes_ok_threshold: float) -> tuple[int, int]: - raw_bound1 = math.ceil(1 / slopes_ok_threshold) - raw_bound2 = math.ceil(1 / (1 - slopes_ok_threshold)) - return min(raw_bound1, raw_bound2), max(raw_bound1, raw_bound2) + min_slope_bound1 = math.ceil(1 / slopes_ok_threshold) + min_slope_bound2 = math.ceil(1 / (1 - slopes_ok_threshold)) + return min(min_slope_bound1, min_slope_bound2), max( + min_slope_bound1, min_slope_bound2 + ) def calculate_min_slopes_ok(pos: int, slopes_ok_threshold: float) -> int: min_slopes_ok, max_slopes_ok = calculate_slopes_ok_min_max(slopes_ok_threshold) diff --git a/quickadapter/user_data/strategies/Utils.py b/quickadapter/user_data/strategies/Utils.py index f598b79..d4e61fe 100644 --- a/quickadapter/user_data/strategies/Utils.py +++ b/quickadapter/user_data/strategies/Utils.py @@ -467,9 +467,11 @@ def zigzag( @lru_cache(maxsize=4096) def calculate_slopes_ok_min_max(slopes_ok_threshold: float) -> tuple[int, int]: - raw_bound1 = math.ceil(1 / slopes_ok_threshold) - raw_bound2 = math.ceil(1 / (1 - slopes_ok_threshold)) - return min(raw_bound1, raw_bound2), max(raw_bound1, raw_bound2) + min_slope_bound1 = math.ceil(1 / slopes_ok_threshold) + min_slope_bound2 = math.ceil(1 / (1 - slopes_ok_threshold)) + return min(min_slope_bound1, min_slope_bound2), max( + min_slope_bound1, min_slope_bound2 + ) def calculate_min_slopes_ok(pos: int, slopes_ok_threshold: float) -> int: min_slopes_ok, max_slopes_ok = calculate_slopes_ok_min_max(slopes_ok_threshold) -- 2.43.0