From 1a0e4599c530c197a73dabb919859d8f37d60b7a Mon Sep 17 00:00:00 2001 From: Ole Laursen Date: Thu, 16 Feb 2017 12:23:45 +0000 Subject: [PATCH] Adjust the way authors with unknown countries are counted and improve the explanation of how the numbers have come to be - Legacy-Id: 12858 --- ietf/stats/views.py | 16 ++++++++++++++++ .../stats/document_stats_author_continent.html | 9 ++++----- .../stats/document_stats_author_country.html | 12 +++++++----- 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/ietf/stats/views.py b/ietf/stats/views.py index 68e3f29d0..3466e329a 100644 --- a/ietf/stats/views.py +++ b/ietf/stats/views.py @@ -433,6 +433,14 @@ def document_stats(request, stats_type=None): if c and c.in_eu: bins[eu_name].append(name) + # remove from the unknown bin all authors with a known country + all_known = set(n for b, names in bins.iteritems() if b for n in names) + unknown = [] + for name in bins[""]: + if name not in all_known: + unknown.append(name) + bins[""] = unknown + series_data = [] for country, names in sorted(bins.iteritems(), key=lambda t: t[0].lower()): percentage = len(names) * 100.0 / total_persons @@ -470,6 +478,14 @@ def document_stats(request, stats_type=None): continent_name = country_to_continent.get(country_name, "") bins[continent_name].append(name) + # remove from the unknown bin all authors with a known continent + all_known = set(n for b, names in bins.iteritems() if b for n in names) + unknown = [] + for name in bins[""]: + if name not in all_known: + unknown.append(name) + bins[""] = unknown + series_data = [] for continent, names in sorted(bins.iteritems(), key=lambda t: t[0].lower()): percentage = len(names) * 100.0 / total_persons diff --git a/ietf/templates/stats/document_stats_author_continent.html b/ietf/templates/stats/document_stats_author_continent.html index d0327bf3a..b17d49552 100644 --- a/ietf/templates/stats/document_stats_author_continent.html +++ b/ietf/templates/stats/document_stats_author_continent.html @@ -58,8 +58,7 @@ -

The country information for an author can vary between documents, - so the sum of the rows in the table can be more than 100%. This - is especially true for the row with unknown continent information - - many authors may have one or more author entries with an - unrecognized country.

+

The statistics are based entirely on the author addresses provided + in each draft. Since this varies across documents, a travelling + author may be counted in more than country, making the total sum + more than 100%.

diff --git a/ietf/templates/stats/document_stats_author_country.html b/ietf/templates/stats/document_stats_author_country.html index 1b8911c4c..99c6d0152 100644 --- a/ietf/templates/stats/document_stats_author_country.html +++ b/ietf/templates/stats/document_stats_author_country.html @@ -58,11 +58,13 @@ -

The country information for an author can vary between documents, - so the sum of multiple rows in the table can be more than 100%. This - is especially true for the row with unknown country information - - many authors may have one or more author entries with an - unrecognized country.

+

The statistics are based entirely on the author addresses provided + in each draft. Since this varies across documents, a travelling + author may be counted in more than country, making the total sum + more than 100%.

+ +

In case no country information is found for an author in the time + period, the author is counted as (unknown).

An author is counted in EU if the country is a member of the EU now, even if that was not the case at publication.