]> Piment Noir Git Repositories - freqai-strategies.git/commitdiff
refactor(qav3): error message cleanups
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Sun, 25 May 2025 15:19:09 +0000 (17:19 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Sun, 25 May 2025 15:19:09 +0000 (17:19 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
ReforceXY/user_data/freqaimodels/ReforceXY.py
quickadapter/user_data/freqaimodels/QuickAdapterRegressorV3.py

index ebc3b9dc15a1f6f3b451b64a1076e26c01b6efb9..0cbf4274108af169ad2b8237f8f3b66c5476c15c 100644 (file)
@@ -503,7 +503,7 @@ class ReforceXY(BaseReinforcementLearningModel):
             )
         else:
             raise ValueError(
-                f"Unsupported storage backend: {storage_backend}. Supported backends are: 'sqlite' and 'file'."
+                f"Unsupported storage backend: {storage_backend}. Supported backends are: 'sqlite' and 'file'"
             )
         return storage
 
index 981f717c63c07d30215d55c1de327806ddb1a9ee..19fbb756451d0121b05dc209bfed0e3ed2eda2b3 100644 (file)
@@ -398,7 +398,7 @@ class QuickAdapterRegressorV3(BaseRegressionModel):
         self, namespace: str, study: optuna.study.Study
     ) -> Optional[optuna.trial.FrozenTrial]:
         if namespace != "label":
-            raise ValueError(f"Unsupported namespace: {namespace}")
+            raise ValueError(f"Invalid namespace: {namespace}")
 
         if not QuickAdapterRegressorV3.optuna_study_has_best_trials(study):
             return None
@@ -414,7 +414,7 @@ class QuickAdapterRegressorV3(BaseRegressionModel):
         )
         if label_trials_selection not in ["quantile", "chebyshev"]:
             raise ValueError(
-                f"Unsupported label trials selection method: {label_trials_selection}. Supported methods are 'quantile' and 'chebyshev'."
+                f"Unsupported label trials selection method: {label_trials_selection}. Supported methods are 'quantile' and 'chebyshev'"
             )
 
         best_trials = [
@@ -611,7 +611,7 @@ class QuickAdapterRegressorV3(BaseRegressionModel):
             )
         else:
             raise ValueError(
-                f"Unsupported optuna storage backend: {storage_backend}. Supported backends are 'sqlite' and 'file'."
+                f"Unsupported optuna storage backend: {storage_backend}. Supported backends are 'sqlite' and 'file'"
             )
         return storage
 
@@ -1283,7 +1283,7 @@ def smoothed_max(series: pd.Series, temperature=1.0) -> float:
     if data_array.size == 0:
         return np.nan
     if temperature < 0:
-        raise ValueError("temperature must be non-negative.")
+        raise ValueError("temperature must be non-negative")
     if np.isclose(temperature, 0):
         return data_array.max()
     return sp.special.logsumexp(temperature * data_array) / temperature
@@ -1294,7 +1294,7 @@ def smoothed_min(series: pd.Series, temperature=1.0) -> float:
     if data_array.size == 0:
         return np.nan
     if temperature < 0:
-        raise ValueError("temperature must be non-negative.")
+        raise ValueError("temperature must be non-negative")
     if np.isclose(temperature, 0):
         return data_array.min()
     return -sp.special.logsumexp(-temperature * data_array) / temperature