]> Piment Noir Git Repositories - freqai-strategies.git/commitdiff
style(weights): use !r repr for strategy in compute_label_weights ValueError
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Mon, 25 May 2026 12:01:55 +0000 (14:01 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Mon, 25 May 2026 12:01:55 +0000 (14:01 +0200)
Replace hardcoded 'none' literal with f"{strategy!r}" to match the
codebase convention of !r-formatting external string identifiers in
error messages and avoid silent drift if WEIGHT_STRATEGIES[0] changes.

quickadapter/user_data/strategies/Utils.py

index 68d03d32ff686b11f5ed6ec32e399847e1546bab..fdfb4559971e226fb73e28f192cac6ad60231c6d 100644 (file)
@@ -1193,7 +1193,7 @@ def compute_label_weights(
 
     if strategy == WEIGHT_STRATEGIES[0]:  # "none"
         raise ValueError(
-            "compute_label_weights must not be called with strategy='none'; "
+            f"compute_label_weights must not be called with strategy={strategy!r}; "
             "callers must skip invocation when weighting is disabled"
         )