New stats
Before Width: | Height: | Size: 259 KiB After Width: | Height: | Size: 246 KiB |
Before Width: | Height: | Size: 631 KiB After Width: | Height: | Size: 558 KiB |
Before Width: | Height: | Size: 258 KiB After Width: | Height: | Size: 245 KiB |
Before Width: | Height: | Size: 200 KiB After Width: | Height: | Size: 165 KiB |
Before Width: | Height: | Size: 428 KiB After Width: | Height: | Size: 355 KiB |
Before Width: | Height: | Size: 581 KiB After Width: | Height: | Size: 508 KiB |
Before Width: | Height: | Size: 499 KiB After Width: | Height: | Size: 439 KiB |
Before Width: | Height: | Size: 649 KiB After Width: | Height: | Size: 563 KiB |
Before Width: | Height: | Size: 704 KiB After Width: | Height: | Size: 610 KiB |
Before Width: | Height: | Size: 212 KiB After Width: | Height: | Size: 202 KiB |
Before Width: | Height: | Size: 600 KiB After Width: | Height: | Size: 543 KiB |
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 76 KiB |
Before Width: | Height: | Size: 116 KiB After Width: | Height: | Size: 116 KiB |
Before Width: | Height: | Size: 119 KiB After Width: | Height: | Size: 115 KiB |
Before Width: | Height: | Size: 104 KiB After Width: | Height: | Size: 102 KiB |
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 103 KiB |
Before Width: | Height: | Size: 113 KiB After Width: | Height: | Size: 112 KiB |
Before Width: | Height: | Size: 281 KiB After Width: | Height: | Size: 266 KiB |
Before Width: | Height: | Size: 300 KiB After Width: | Height: | Size: 286 KiB |
Before Width: | Height: | Size: 308 KiB After Width: | Height: | Size: 290 KiB |
Before Width: | Height: | Size: 150 KiB After Width: | Height: | Size: 125 KiB |
Before Width: | Height: | Size: 185 KiB After Width: | Height: | Size: 155 KiB |
Before Width: | Height: | Size: 250 KiB After Width: | Height: | Size: 189 KiB |
Before Width: | Height: | Size: 281 KiB After Width: | Height: | Size: 263 KiB |
Before Width: | Height: | Size: 270 KiB After Width: | Height: | Size: 254 KiB |
Before Width: | Height: | Size: 273 KiB After Width: | Height: | Size: 253 KiB |
Before Width: | Height: | Size: 594 KiB After Width: | Height: | Size: 533 KiB |
Before Width: | Height: | Size: 555 KiB After Width: | Height: | Size: 498 KiB |
Before Width: | Height: | Size: 756 KiB After Width: | Height: | Size: 684 KiB |
|
@ -1,7 +1,9 @@
|
||||||
import csv
|
import csv
|
||||||
|
import string
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
from matplotlib import pyplot
|
from matplotlib import pyplot
|
||||||
|
import re
|
||||||
|
|
||||||
|
|
||||||
def counts(lst):
|
def counts(lst):
|
||||||
|
@ -107,7 +109,6 @@ def cumulative_users(stats):
|
||||||
def pyplot_init():
|
def pyplot_init():
|
||||||
pyplot.figure(figsize=(14, 8), dpi=200)
|
pyplot.figure(figsize=(14, 8), dpi=200)
|
||||||
pyplot.xticks(rotation='vertical')
|
pyplot.xticks(rotation='vertical')
|
||||||
pyplot.tight_layout()
|
|
||||||
|
|
||||||
|
|
||||||
def create_usercount_graphs(stats, extra_text=""):
|
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.title("Unique contributors" + extra_text + ' with MapComplete (' + str(total) + ' contributors)')
|
||||||
pyplot.ylabel("Number of unique contributors")
|
pyplot.ylabel("Number of unique contributors")
|
||||||
pyplot.xlabel("Date")
|
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_init()
|
||||||
pyplot.plot(dates, cumul_uniq, label='Cumulative unique contributors')
|
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.title("Cumulative unique contributors" + extra_text + " with MapComplete - " + str(total) + " contributors")
|
||||||
pyplot.ylabel("Number of unique contributors")
|
pyplot.ylabel("Number of unique contributors")
|
||||||
pyplot.xlabel("Date")
|
pyplot.xlabel("Date")
|
||||||
pyplot.savefig("CumulativeContributors" + extra_text + ".png", dpi=400, facecolor='w', edgecolor='w',
|
pyplot.savefig("CumulativeContributors" + extra_text + ".png", dpi=400, facecolor='w', edgecolor='w')
|
||||||
bbox_inches='tight')
|
|
||||||
|
|
||||||
|
|
||||||
def create_theme_breakdown(stats, fileExtra="", cutoff=5):
|
def create_theme_breakdown(stats, fileExtra="", cutoff=5):
|
||||||
|
@ -248,14 +248,20 @@ def contents_where(contents, index, starts_with, invert=False):
|
||||||
yield row
|
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):
|
def create_graphs(contents):
|
||||||
|
cumulative_changes_per(contents, 4, "version number", cutoff=1, sort=sortable_user_number)
|
||||||
create_usercount_graphs(contents)
|
create_usercount_graphs(contents)
|
||||||
create_theme_breakdown(contents)
|
create_theme_breakdown(contents)
|
||||||
cumulative_changes_per(contents, 3, "theme", cutoff=10)
|
cumulative_changes_per(contents, 3, "theme", cutoff=10)
|
||||||
cumulative_changes_per(contents, 3, "theme", cutoff=10, cumulative=False)
|
cumulative_changes_per(contents, 3, "theme", cutoff=10, cumulative=False)
|
||||||
cumulative_changes_per(contents, 1, "contributor", cutoff=15)
|
cumulative_changes_per(contents, 1, "contributor", cutoff=15)
|
||||||
cumulative_changes_per(contents, 2, "language", cutoff=1)
|
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)
|
cumulative_changes_per(contents, 8, "host", cutoff=1)
|
||||||
|
|
||||||
currentYear = datetime.now().year
|
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, 3, "theme", extratext, cutoff=5, cumulative=False)
|
||||||
cumulative_changes_per(contents_filtered, 1, "contributor", extratext, cutoff=10)
|
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, 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, cumulative=False,
|
||||||
cumulative_changes_per(contents_filtered, 4, "version number", extratext, cutoff=1, sort=lambda kv : kv[0])
|
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)
|
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 = {
|
theme_remappings = {
|
||||||
"metamap": "maps",
|
"metamap": "maps",
|
||||||
"groen": "buurtnatuur",
|
"groen": "buurtnatuur",
|
||||||
|
@ -282,10 +314,10 @@ theme_remappings = {
|
||||||
"pomp": "cyclofix",
|
"pomp": "cyclofix",
|
||||||
"wiki:user:joost_schouppe/campersite": "campersite",
|
"wiki:user:joost_schouppe/campersite": "campersite",
|
||||||
"wiki-user-joost_schouppe-geveltuintjes": "geveltuintjes",
|
"wiki-user-joost_schouppe-geveltuintjes": "geveltuintjes",
|
||||||
"wiki-user-joost_schouppe-campersite": "campersites",
|
"wiki-user-joost_schouppe-campersite": "campersite",
|
||||||
"wiki-User-joost_schouppe-campersite": "campersites",
|
"wiki-User-joost_schouppe-campersite": "campersite",
|
||||||
"wiki-User-joost_schouppe-geveltuintjes": "geveltuintjes",
|
"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"
|
"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:
|
if theme in theme_remappings:
|
||||||
theme = theme_remappings[theme]
|
theme = theme_remappings[theme]
|
||||||
row[3] = 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]
|
yield [data.strip().strip("\"") for data in row]
|
||||||
|
|
||||||
|
|
||||||
|
@ -310,6 +343,8 @@ def main():
|
||||||
stats = list(clean_input(csv.reader(csvfile, delimiter=',', quotechar='"')))
|
stats = list(clean_input(csv.reader(csvfile, delimiter=',', quotechar='"')))
|
||||||
print("Found " + str(len(stats)) + " changesets")
|
print("Found " + str(len(stats)) + " changesets")
|
||||||
create_graphs(stats)
|
create_graphs(stats)
|
||||||
|
create_per_theme_graphs(stats)
|
||||||
|
create_per_contributor_graphs(stats, 50)
|
||||||
print("All done!")
|
print("All done!")
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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", "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", "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-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", "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", "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"
|
||||||
|
|
|