From 9af062937e1b3700112a1b431a6db9297c18b93c Mon Sep 17 00:00:00 2001
From: Alejandro Moreo <alejandro.moreo@isti.cnr.it>
Date: Mon, 18 Dec 2023 17:17:59 +0100
Subject: [PATCH] bugfix in APP

---
 quapy/protocol.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/quapy/protocol.py b/quapy/protocol.py
index 9bb716a..c718368 100644
--- a/quapy/protocol.py
+++ b/quapy/protocol.py
@@ -257,8 +257,9 @@ class APP(AbstractStochasticSeededProtocol, OnLabelledCollectionProtocol):
         """
         dimensions = self.data.n_classes
         s = F.prevalence_linspace(self.n_prevalences, repeats=1, smooth_limits_epsilon=self.smooth_limits_epsilon)
+        eps = (s[1]-s[0])/2 # handling floating rounding
         s = [s] * (dimensions - 1)
-        prevs = [p for p in itertools.product(*s, repeat=1) if (sum(p) <= 1.0)]
+        prevs = [p for p in itertools.product(*s, repeat=1) if (sum(p) < (1.+eps))]
         prevs = np.asarray(prevs).reshape(len(prevs), -1)
         if self.repeats > 1:
             prevs = np.repeat(prevs, self.repeats, axis=0)