New stats

This commit is contained in:
pietervdvn 2021-03-16 19:27:06 +01:00
parent c83f1fc09f
commit 0e8303acdb
31 changed files with 56 additions and 11 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 259 KiB

After

Width:  |  Height:  |  Size: 246 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 631 KiB

After

Width:  |  Height:  |  Size: 558 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 258 KiB

After

Width:  |  Height:  |  Size: 245 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 200 KiB

After

Width:  |  Height:  |  Size: 165 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 428 KiB

After

Width:  |  Height:  |  Size: 355 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 581 KiB

After

Width:  |  Height:  |  Size: 508 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 499 KiB

After

Width:  |  Height:  |  Size: 439 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 649 KiB

After

Width:  |  Height:  |  Size: 563 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 704 KiB

After

Width:  |  Height:  |  Size: 610 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 212 KiB

After

Width:  |  Height:  |  Size: 202 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 600 KiB

After

Width:  |  Height:  |  Size: 543 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 KiB

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

After

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 KiB

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 103 KiB

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 113 KiB

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 281 KiB

After

Width:  |  Height:  |  Size: 266 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 300 KiB

After

Width:  |  Height:  |  Size: 286 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 308 KiB

After

Width:  |  Height:  |  Size: 290 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 150 KiB

After

Width:  |  Height:  |  Size: 125 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 185 KiB

After

Width:  |  Height:  |  Size: 155 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 250 KiB

After

Width:  |  Height:  |  Size: 189 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 281 KiB

After

Width:  |  Height:  |  Size: 263 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 270 KiB

After

Width:  |  Height:  |  Size: 254 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 273 KiB

After

Width:  |  Height:  |  Size: 253 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 594 KiB

After

Width:  |  Height:  |  Size: 533 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 555 KiB

After

Width:  |  Height:  |  Size: 498 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 756 KiB

After

Width:  |  Height:  |  Size: 684 KiB

View file

@ -1,7 +1,9 @@
import csv
import string
from datetime import datetime
from matplotlib import pyplot
import re
def counts(lst):
@ -107,7 +109,6 @@ def cumulative_users(stats):
def pyplot_init():
pyplot.figure(figsize=(14, 8), dpi=200)
pyplot.xticks(rotation='vertical')
pyplot.tight_layout()
def create_usercount_graphs(stats, extra_text=""):
@ -122,7 +123,7 @@ def create_usercount_graphs(stats, extra_text=""):
pyplot.title("Unique contributors" + extra_text + ' with MapComplete (' + str(total) + ' contributors)')
pyplot.ylabel("Number of unique contributors")
pyplot.xlabel("Date")
pyplot.savefig("Contributors" + extra_text + ".png", dpi=400, facecolor='w', edgecolor='w', bbox_inches='tight')
pyplot.savefig("Contributors" + extra_text + ".png", dpi=400, facecolor='w', edgecolor='w')
pyplot_init()
pyplot.plot(dates, cumul_uniq, label='Cumulative unique contributors')
@ -130,8 +131,7 @@ def create_usercount_graphs(stats, extra_text=""):
pyplot.title("Cumulative unique contributors" + extra_text + " with MapComplete - " + str(total) + " contributors")
pyplot.ylabel("Number of unique contributors")
pyplot.xlabel("Date")
pyplot.savefig("CumulativeContributors" + extra_text + ".png", dpi=400, facecolor='w', edgecolor='w',
bbox_inches='tight')
pyplot.savefig("CumulativeContributors" + extra_text + ".png", dpi=400, facecolor='w', edgecolor='w')
def create_theme_breakdown(stats, fileExtra="", cutoff=5):
@ -248,14 +248,20 @@ def contents_where(contents, index, starts_with, invert=False):
yield row
def sortable_user_number(kv):
str = kv[0]
ls = list(map(lambda str : "0"+str if len(str) < 2 else str, re.findall("[0-9]+", str)))
return ".".join(ls)
def create_graphs(contents):
cumulative_changes_per(contents, 4, "version number", cutoff=1, sort=sortable_user_number)
create_usercount_graphs(contents)
create_theme_breakdown(contents)
cumulative_changes_per(contents, 3, "theme", cutoff=10)
cumulative_changes_per(contents, 3, "theme", cutoff=10, cumulative=False)
cumulative_changes_per(contents, 1, "contributor", cutoff=15)
cumulative_changes_per(contents, 2, "language", cutoff=1)
cumulative_changes_per(contents, 4, "version number", cutoff=1, sort=lambda kv : kv[0])
cumulative_changes_per(contents, 8, "host", cutoff=1)
currentYear = datetime.now().year
@ -268,11 +274,37 @@ def create_graphs(contents):
cumulative_changes_per(contents_filtered, 3, "theme", extratext, cutoff=5, cumulative=False)
cumulative_changes_per(contents_filtered, 1, "contributor", extratext, cutoff=10)
cumulative_changes_per(contents_filtered, 2, "language", extratext, cutoff=1)
cumulative_changes_per(contents_filtered, 4, "version number", extratext, cutoff=1, cumulative=False, sort=lambda kv : kv[0])
cumulative_changes_per(contents_filtered, 4, "version number", extratext, cutoff=1, sort=lambda kv : kv[0])
cumulative_changes_per(contents_filtered, 4, "version number", extratext, cutoff=1, cumulative=False,
sort=sortable_user_number)
cumulative_changes_per(contents_filtered, 4, "version number", extratext, cutoff=1, sort=sortable_user_number)
cumulative_changes_per(contents_filtered, 8, "host", extratext, cutoff=1)
def create_per_theme_graphs(contents):
all_themes = set(map(lambda row: row[3], contents))
for theme in all_themes:
filtered = list(contents_where(contents, 3, theme))
if len(filtered) < 10:
# less then 10 changesets - we do not map it
continue
contributors = set(map(lambda row: row[1], filtered))
if len(contributors) < 2:
continue # one contributor makes a boring graph
cumulative_changes_per(filtered, 1, "contributor", " for theme " + theme, cutoff=1)
def create_per_contributor_graphs(contents, least_needed_changesets):
all_contributors = set(map(lambda row: row[1], contents))
for contrib in all_contributors:
filtered = list(contents_where(contents, 1, contrib))
if len(filtered) < least_needed_changesets:
continue
themes = set(map(lambda row: row[3], filtered))
if len(themes) < 2:
continue # one theme makes a boring graph
cumulative_changes_per(filtered, 3, "theme", " for contributor " + contrib, cutoff=1)
theme_remappings = {
"metamap": "maps",
"groen": "buurtnatuur",
@ -282,10 +314,10 @@ theme_remappings = {
"pomp": "cyclofix",
"wiki:user:joost_schouppe/campersite": "campersite",
"wiki-user-joost_schouppe-geveltuintjes": "geveltuintjes",
"wiki-user-joost_schouppe-campersite": "campersites",
"wiki-User-joost_schouppe-campersite": "campersites",
"wiki-user-joost_schouppe-campersite": "campersite",
"wiki-User-joost_schouppe-campersite": "campersite",
"wiki-User-joost_schouppe-geveltuintjes": "geveltuintjes",
"wiki:User:joost_schouppe/campersite": "campersites",
"wiki:User:joost_schouppe/campersite": "campersite",
"https://raw.githubusercontent.com/osmbe/play/master/mapcomplete/geveltuinen/geveltuinen.json": "geveltuintjes"
}
@ -300,7 +332,8 @@ def clean_input(contents):
if theme in theme_remappings:
theme = theme_remappings[theme]
row[3] = theme
row[4] = row[4].strip().strip("\"")[0:len("MapComplete x.x.x")]
row[4] = row[4].strip().strip("\"")[len("MapComplete "):]
row[4] = re.findall("[0-9]*\.[0-9]*\.[0-9]*", row[4])[0]
yield [data.strip().strip("\"") for data in row]
@ -310,6 +343,8 @@ def main():
stats = list(clean_input(csv.reader(csvfile, delimiter=',', quotechar='"')))
print("Found " + str(len(stats)) + " changesets")
create_graphs(stats)
create_per_theme_graphs(stats)
create_per_contributor_graphs(stats, 50)
print("All done!")

View file

@ -2876,5 +2876,15 @@
"2021-03-14", "Pieter Vander Vennet", "nl", "speelplekken", "MapComplete 0.5.10", 0, 1, "Adding data with #MapComplete for theme #speelplekken", "pietervdvn.github.io"
"2021-03-14", "whturner", "en", "benches", "MapComplete 0.5.9", 4, 8, "Adding data with #MapComplete for theme #benches", "mapcomplete.osm.be"
"2021-03-14", "WinstonSmith", "en", "drinking_water", "MapComplete 0.5.9", 0, 1, "Adding data with #MapComplete for theme #drinking_water", "mapcomplete.osm.be"
"2021-03-15", "joost schouppe", "en", "campersite", "MapComplete 0.5.12", 0, 4, "Adding data with #MapComplete for theme #campersite", "mapcomplete.osm.be"
"2021-03-15", "joost schouppe", "nl", "https://raw.githubusercontent.com/osmbe/play/master/mapcomplete/geveltuinen/geveltuinen.json", "MapComplete 0.5.5-unlocked", 0, 1, "Adding data with #MapComplete for theme #https://raw.githubusercontent.com/osmbe/play/master/mapcomplete/geveltuinen/geveltuinen.json", "pietervdvn.github.io"
"2021-03-15", "Pieter Nuytinck", "en", "bookcases", "MapComplete 0.5.10", 2, 4, "Adding data with #MapComplete for theme #bookcases", "pietervdvn.github.io"
"2021-03-15", "Technopolice_newBiE", "en", "surveillance", "MapComplete 0.5.5-unlocked", 68, 36, "Adding data with #MapComplete for theme #surveillance", "pietervdvn.github.io"
"2021-03-15", "WinstonSmith", "en", "toilets", "MapComplete 0.5.9", 0, 2, "Adding data with #MapComplete for theme #toilets", "mapcomplete.osm.be"
"2021-03-16", "Awo", "en", "trees", "MapComplete 0.5.12", 0, 5, "Adding data with #MapComplete for theme #trees", "pietervdvn.github.io"
"2021-03-16", "Awo", "en", "trees", "MapComplete 0.5.12", 3, 3, "Adding data with #MapComplete for theme #trees", "pietervdvn.github.io"
"2021-03-16", "bryceco", "en", "personal", "MapComplete 0.5.12", 0, 1, "Adding data with #MapComplete for theme #personal", "mapcomplete.osm.be"
"2021-03-16", "Koen Rijnsent", "en", "personal", "MapComplete 0.5.12", 1, 2, "Adding data with #MapComplete for theme #personal", "mapcomplete.osm.be"
"2021-03-16", "Pieter Vander Vennet", "nl", "speelplekken", "MapComplete 0.5.12", 0, 1, "Adding data with #MapComplete for theme #speelplekken", "mapcomplete.osm.be"
"2021-03-16", "Pieter Vander Vennet", "nl", "sport_pitches", "MapComplete 0.5.12", 1, 2, "Adding data with #MapComplete for theme #sport_pitches", "mapcomplete.osm.be"
"2021-03-16", "WinstonSmith", "en", "cyclofix", "MapComplete 0.5.12", 1, 1, "Adding data with #MapComplete for theme #cyclofix", "mapcomplete.osm.be"

1 2020-07-05 Pieter Vander Vennet null null MapComplete 0.0.0 0 1 Beantwoorden van vragen met MapComplete voor vragenset #grb null
2876 2021-03-14 Pieter Vander Vennet nl speelplekken MapComplete 0.5.10 0 1 Adding data with #MapComplete for theme #speelplekken pietervdvn.github.io
2877 2021-03-14 whturner en benches MapComplete 0.5.9 4 8 Adding data with #MapComplete for theme #benches mapcomplete.osm.be
2878 2021-03-14 WinstonSmith en drinking_water MapComplete 0.5.9 0 1 Adding data with #MapComplete for theme #drinking_water mapcomplete.osm.be
2879 2021-03-15 joost schouppe en campersite MapComplete 0.5.12 0 4 Adding data with #MapComplete for theme #campersite mapcomplete.osm.be
2880 2021-03-15 joost schouppe nl https://raw.githubusercontent.com/osmbe/play/master/mapcomplete/geveltuinen/geveltuinen.json MapComplete 0.5.5-unlocked 0 1 Adding data with #MapComplete for theme #https://raw.githubusercontent.com/osmbe/play/master/mapcomplete/geveltuinen/geveltuinen.json pietervdvn.github.io
2881 2021-03-15 Pieter Nuytinck en bookcases MapComplete 0.5.10 2 4 Adding data with #MapComplete for theme #bookcases pietervdvn.github.io
2882 2021-03-15 Technopolice_newBiE en surveillance MapComplete 0.5.5-unlocked 68 36 Adding data with #MapComplete for theme #surveillance pietervdvn.github.io
2883 2021-03-15 WinstonSmith en toilets MapComplete 0.5.9 0 2 Adding data with #MapComplete for theme #toilets mapcomplete.osm.be
2884 2021-03-16 Awo en trees MapComplete 0.5.12 0 5 Adding data with #MapComplete for theme #trees pietervdvn.github.io
2885 2021-03-16 Awo en trees MapComplete 0.5.12 3 3 Adding data with #MapComplete for theme #trees pietervdvn.github.io
2886 2021-03-16 bryceco en personal MapComplete 0.5.12 0 1 Adding data with #MapComplete for theme #personal mapcomplete.osm.be
2887 2021-03-16 Koen Rijnsent en personal MapComplete 0.5.12 1 2 Adding data with #MapComplete for theme #personal mapcomplete.osm.be
2888 2021-03-16 Pieter Vander Vennet nl speelplekken MapComplete 0.5.12 0 1 Adding data with #MapComplete for theme #speelplekken mapcomplete.osm.be
2889 2021-03-16 Pieter Vander Vennet nl sport_pitches MapComplete 0.5.12 1 2 Adding data with #MapComplete for theme #sport_pitches mapcomplete.osm.be
2890 2021-03-16 WinstonSmith en cyclofix MapComplete 0.5.12 1 1 Adding data with #MapComplete for theme #cyclofix mapcomplete.osm.be