]> Piment Noir Git Repositories - freqai-strategies.git/commitdiff
test(reforcexy): fix np.isclose() invocation
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Thu, 9 Oct 2025 20:24:19 +0000 (22:24 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Thu, 9 Oct 2025 20:24:19 +0000 (22:24 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
ReforceXY/reward_space_analysis/reward_space_analysis.py

index c9c88e0e949b93f83dca08e06ccaea67cada3504..eaf9b4f759ab30fbbfe6b6a1a6b6571d96774387 100644 (file)
@@ -1378,7 +1378,7 @@ def compute_distribution_shift_metrics(
         # Guard against degenerate distributions (all values identical)
         if not np.isfinite(min_val) or not np.isfinite(max_val):
             continue
-        if np.isclose(max_val, min_val, rel_tol=0, abs_tol=1e-12):
+        if np.isclose(max_val, min_val, rtol=0, atol=1e-12):
             # All mass at a single point -> shift metrics are all zero by definition
             metrics[f"{feature}_kl_divergence"] = 0.0
             metrics[f"{feature}_js_distance"] = 0.0