Skip to content

Commit 1a0e459

Browse files
committed
Adjust the way authors with unknown countries are counted and improve
the explanation of how the numbers have come to be - Legacy-Id: 12858
1 parent d2e85a3 commit 1a0e459

3 files changed

Lines changed: 27 additions & 10 deletions

File tree

ietf/stats/views.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,14 @@ def generate_canonical_names(docalias_qs):
433433
if c and c.in_eu:
434434
bins[eu_name].append(name)
435435

436+
# remove from the unknown bin all authors with a known country
437+
all_known = set(n for b, names in bins.iteritems() if b for n in names)
438+
unknown = []
439+
for name in bins[""]:
440+
if name not in all_known:
441+
unknown.append(name)
442+
bins[""] = unknown
443+
436444
series_data = []
437445
for country, names in sorted(bins.iteritems(), key=lambda t: t[0].lower()):
438446
percentage = len(names) * 100.0 / total_persons
@@ -470,6 +478,14 @@ def generate_canonical_names(docalias_qs):
470478
continent_name = country_to_continent.get(country_name, "")
471479
bins[continent_name].append(name)
472480

481+
# remove from the unknown bin all authors with a known continent
482+
all_known = set(n for b, names in bins.iteritems() if b for n in names)
483+
unknown = []
484+
for name in bins[""]:
485+
if name not in all_known:
486+
unknown.append(name)
487+
bins[""] = unknown
488+
473489
series_data = []
474490
for continent, names in sorted(bins.iteritems(), key=lambda t: t[0].lower()):
475491
percentage = len(names) * 100.0 / total_persons

ietf/templates/stats/document_stats_author_continent.html

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ <h3>Data</h3>
5858
</tbody>
5959
</table>
6060

61-
<p>The country information for an author can vary between documents,
62-
so the sum of the rows in the table can be more than 100%. This
63-
is especially true for the row with unknown continent information -
64-
many authors may have one or more author entries with an
65-
unrecognized country.</p>
61+
<p>The statistics are based entirely on the author addresses provided
62+
in each draft. Since this varies across documents, a travelling
63+
author may be counted in more than country, making the total sum
64+
more than 100%.</p>

ietf/templates/stats/document_stats_author_country.html

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,13 @@ <h3>Data</h3>
5858
</tbody>
5959
</table>
6060

61-
<p>The country information for an author can vary between documents,
62-
so the sum of multiple rows in the table can be more than 100%. This
63-
is especially true for the row with unknown country information -
64-
many authors may have one or more author entries with an
65-
unrecognized country.</p>
61+
<p>The statistics are based entirely on the author addresses provided
62+
in each draft. Since this varies across documents, a travelling
63+
author may be counted in more than country, making the total sum
64+
more than 100%.</p>
65+
66+
<p>In case no country information is found for an author in the time
67+
period, the author is counted as (unknown).</p>
6668

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

0 commit comments

Comments
 (0)