diff options
author | SVN-Git Migration <python-modules-team@lists.alioth.debian.org> | 2015-10-08 11:51:55 -0700 |
---|---|---|
committer | SVN-Git Migration <python-modules-team@lists.alioth.debian.org> | 2015-10-08 11:51:55 -0700 |
commit | 35be9c9e0402be9c2311371cdcaf145e36509503 (patch) | |
tree | 93e03d19b48e3244241d34978c4bf4dd271a10e5 /tagging/utils.py | |
parent | 3aa44e2aeb51a52cf63deb8c9537971a81b631fd (diff) | |
parent | 210bfd7f97afe0162e682cbd2530115cf09fd51d (diff) | |
download | python-django-tagging-35be9c9e0402be9c2311371cdcaf145e36509503.tar python-django-tagging-35be9c9e0402be9c2311371cdcaf145e36509503.tar.gz |
Initialize git-dpm
Diffstat (limited to 'tagging/utils.py')
-rw-r--r-- | tagging/utils.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tagging/utils.py b/tagging/utils.py index e89bab0..759e8d8 100644 --- a/tagging/utils.py +++ b/tagging/utils.py @@ -232,7 +232,7 @@ def _calculate_tag_weight(weight, max_weight, distribution): if distribution == LINEAR or max_weight == 1: return weight elif distribution == LOGARITHMIC: - return math.log(weight) * max_weight / math.log(max_weight) + return min((max_weight, math.log(weight) * max_weight / math.log(max_weight))) raise ValueError(_('Invalid distribution algorithm specified: %s.') % distribution) def calculate_cloud(tags, steps=4, distribution=LOGARITHMIC): |