Evenly distributed tagset (all counts the same) cause div/0 error in defscale
mindsocket opened this issue · comments
Roger Barnes commented
The default scaling function has this expression:
1.0 / (maxcount - mincount)
When maxcount == mincount, things blow up. As a workaround I've used a hacky alternative that avoids this well enough for my needs...
def tagscale(count, mincount, maxcount, minsize, maxsize):
if maxcount == mincount:
return defscale(count, mincount, maxcount + 1, minsize, maxsize)
return defscale(count, mincount, maxcount, minsize, maxsize)
There's probably a better way though
Reto Aebersold commented
Thanks for the hint. It will be fixed in 0.3.5.