]> Piment Noir Git Repositories - freqai-strategies.git/commitdiff
refactor: code cleanups
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Fri, 21 Nov 2025 21:06:21 +0000 (22:06 +0100)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Fri, 21 Nov 2025 21:06:21 +0000 (22:06 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
ReforceXY/reward_space_analysis/reward_space_analysis.py
quickadapter/user_data/strategies/QuickAdapterV3.py

index 936ec9d92afff3c888e100a09a040425f90c6206..371c77c0a3d0531cf898e4e2cc9738483b0cc45f 100644 (file)
@@ -71,7 +71,7 @@ POTENTIAL_GAMMA_DEFAULT: float = 0.95
 
 # Supported attenuation modes
 ATTENUATION_MODES: Tuple[str, ...] = ("sqrt", "linear", "power", "half_life")
-ATTENUATION_MODES_WITH_LEGACY: Tuple[str, ...] = ATTENUATION_MODES + ("legacy",)
+ATTENUATION_MODES_WITH_LEGACY: Tuple[str, ...] = ("legacy",) + ATTENUATION_MODES
 
 # Internal numeric guards and behavior toggles
 INTERNAL_GUARDS: dict[str, float] = {
@@ -94,8 +94,8 @@ ALLOWED_TRANSFORMS = {
     "softsign",
     "arctan",
     "sigmoid",
-    "clip",
     "asinh",
+    "clip",
 }
 ALLOWED_EXIT_POTENTIAL_MODES = {
     "canonical",
index 6cf88b275dde7c4c57429733231226ffb8a620bf..f565126282341415a8a3043d6dbc8ff42de96ca7 100644 (file)
@@ -737,14 +737,14 @@ class QuickAdapterV3(IStrategy):
         amplitudes: list[float],
         amplitude_excesses: list[float],
     ) -> list[float]:
+        if strategy == WEIGHT_STRATEGIES[1]:  # "amplitude"
+            return amplitudes
         if strategy == WEIGHT_STRATEGIES[2]:  # "amplitude_excess"
             return (
                 amplitude_excesses
                 if len(amplitude_excesses) == len(amplitudes)
                 else amplitudes
             )
-        if strategy == WEIGHT_STRATEGIES[1]:  # "amplitude"
-            return amplitudes
         return []
 
     def set_freqai_targets(