Skip to content
This repository was archived by the owner on Sep 12, 2024. It is now read-only.

Commit eac736d

Browse files
committed
counting "6"s: micb25/dka#5 (comment)
1 parent c9ca67a commit eac736d

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

generate_data.py

+3-8
Original file line numberDiff line numberDiff line change
@@ -72,20 +72,15 @@
7272

7373
usersByCount = []
7474

75+
for val in values:
76+
val["users_published"] = int(sum([1 / k["multiplier"] for k in keys if k["publishedOn"] == val["date"] and k["transmissionRiskLevel"] == 6]))
77+
7578
for f in sorted(Path("page/users_hourly").iterdir()):
7679
if f.name == ".gitkeep":
7780
continue
7881
print(f)
7982
with open(f) as tmp:
8083
last_line = tmp.readlines()[-1]
81-
user_count = int(last_line.split("/")[0].strip())
82-
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
83-
if "old Android app" in last_line:
84-
to_be_ignored = int(last_line.split("(")[1].split(" ")[0])
85-
user_count -= to_be_ignored
86-
for val in values:
87-
if val["date"] == f.stem[: f.stem.rfind("-")]:
88-
val["users_published"] += user_count
8984

9085
user_dist = last_line.split("/")[1].split(",")
9186
if "(" in user_dist[-1]:

page/plots/usercount.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
3-
"title": "number of users publishing keys (approx.)",
3+
"title": "number of users publishing keys",
44
"width": 550,
55
"height": 250,
66
"data": {

0 commit comments

Comments
 (0)