Ignore selection length deviating twice from the standard deviation

issue10089
review332251002
This commit is contained in:
Cédric Krier committed 2021-03-23 23:48:32 +01:00
1 parent 3133ee3bf2
commit 5438cb2f45
1 file changed
+4 -1
+4 -1
View File
@@ -170,7 +170,10 @@ class PopdownMixin(object):
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)