Skip to content
This repository has been archived by the owner on Aug 20, 2023. It is now read-only.

Commit

Permalink
counting "6"s: micb25/dka#5 (comment)
Browse files Browse the repository at this point in the history
  • Loading branch information
janpf committed Jul 3, 2020
1 parent bd24d37 commit 610b66d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
11 changes: 3 additions & 8 deletions generate_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,15 @@

usersByCount = []

for val in values:
val["users_published"] = int(sum([1 / k["multiplier"] for k in keys if k["publishedOn"] == val["date"] and k["transmissionRiskLevel"] == 6]))

for f in sorted(Path("page/users_hourly").iterdir()):
if f.name == ".gitkeep":
continue
print(f)
with open(f) as tmp:
last_line = tmp.readlines()[-1]
user_count = int(last_line.split("/")[0].strip())
if datetime.datetime.fromisoformat(f.stem[: f.stem.rfind("-")]) >= datetime.datetime.fromisoformat("2020-07-02"): # ignoring old android apps since server version 1.0.9
if "old Android app" in last_line:
to_be_ignored = int(last_line.split("(")[1].split(" ")[0])
user_count -= to_be_ignored
for val in values:
if val["date"] == f.stem[: f.stem.rfind("-")]:
val["users_published"] += user_count

user_dist = last_line.split("/")[1].split(",")
if "(" in user_dist[-1]:
Expand Down
2 changes: 1 addition & 1 deletion page/plots/usercount.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"title": "number of users publishing keys (approx.)",
"title": "number of users publishing keys",
"width": 550,
"height": 250,
"data": {
Expand Down

0 comments on commit 610b66d

Please sign in to comment.