changeset 7d48c1888350 in tryton:default
details: https://hg.tryton.org/tryton?cmd=changeset&node=7d48c1888350
description:
        Ignore selection length deviating twice from the standard deviation

        issue10089
        review332251002
diffstat:

 tryton/common/selection.py |  5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diffs (15 lines):

diff -r 716075715463 -r 7d48c1888350 tryton/common/selection.py
--- a/tryton/common/selection.py        Sun Mar 21 22:34:00 2021 +0100
+++ b/tryton/common/selection.py        Tue Mar 23 23:48:32 2021 +0100
@@ -170,7 +170,10 @@
             deviation = int(
                 math.sqrt(sum((x - average) ** 2 for x in pop)
                     / len(pop)))
-            width = max(next((x for x in pop if x < (deviation * 4)), 10), 10)
+            width = max(next(
+                    (x for x in pop if abs(x - average) < (deviation * 2)),
+                    10),
+                10)
         else:
             width = 10
         child.set_width_chars(width)

Reply via email to