yeref 0.24.73__py3-none-any.whl → 0.24.75__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
yeref/yeref.py
CHANGED
@@ -16496,43 +16496,35 @@ async def return_retention_metrics(bot, PROJECT_USERNAME, EXTRA_D, BASE_P):
|
|
16496
16496
|
if not cohort_months:
|
16497
16497
|
return
|
16498
16498
|
|
16499
|
-
#
|
16500
|
-
|
16501
|
-
|
16502
|
-
|
16503
|
-
|
16504
|
-
new_m = (total - 1) % 12 + 1
|
16505
|
-
return f"{new_y:04d}-{new_m:02d}"
|
16506
|
-
|
16507
|
-
num_cohorts = len(cohort_months)
|
16508
|
-
first_cohort = cohort_months[0]
|
16499
|
+
# вычисляем максимальный offset (M-1)
|
16500
|
+
max_offset = 0
|
16501
|
+
for c in cohort_months:
|
16502
|
+
if rev_by_cohort[c]:
|
16503
|
+
max_offset = max(max_offset, max(rev_by_cohort[c].keys()))
|
16509
16504
|
|
16510
16505
|
path = os.path.join(EXTRA_D, "4_retention_metrics.csv")
|
16511
16506
|
with open(path, "w", newline="", encoding="utf-8") as f:
|
16512
16507
|
writer = csv.writer(f)
|
16508
|
+
|
16509
|
+
# заголовок
|
16513
16510
|
header = ["Месяц/Когорта"] + [
|
16514
|
-
f"{c} ({len(cohort_users[c])})"
|
16511
|
+
f"{c} ({len(cohort_users[c])})"
|
16512
|
+
for c in cohort_months
|
16515
16513
|
] + ["∑"]
|
16516
16514
|
writer.writerow(header)
|
16517
16515
|
|
16518
|
-
|
16519
|
-
|
16516
|
+
# строки M1..M{max_offset+1} по offset
|
16517
|
+
for i in range(max_offset + 1):
|
16520
16518
|
row = [f"M{i+1}"]
|
16521
16519
|
row_sum = 0.0
|
16522
16520
|
for c in cohort_months:
|
16523
|
-
|
16524
|
-
|
16525
|
-
|
16526
|
-
|
16527
|
-
|
16521
|
+
rev = rev_by_cohort[c].get(i, 0.0)
|
16522
|
+
if rev > 0:
|
16523
|
+
cell = f"{rev:.1f}"
|
16524
|
+
row.append(cell)
|
16525
|
+
row_sum += rev
|
16528
16526
|
else:
|
16529
|
-
|
16530
|
-
if rev > 0:
|
16531
|
-
cell = f"{rev:.1f}"
|
16532
|
-
row.append(cell)
|
16533
|
-
row_sum += rev
|
16534
|
-
else:
|
16535
|
-
row.append("")
|
16527
|
+
row.append("")
|
16536
16528
|
row.append(f"{row_sum:.1f}")
|
16537
16529
|
writer.writerow(row)
|
16538
16530
|
|
@@ -16543,7 +16535,6 @@ async def return_retention_metrics(bot, PROJECT_USERNAME, EXTRA_D, BASE_P):
|
|
16543
16535
|
logger.info(log_ % str(e))
|
16544
16536
|
await asyncio.sleep(round(random.uniform(0, 1), 2))
|
16545
16537
|
|
16546
|
-
|
16547
16538
|
# endregion
|
16548
16539
|
|
16549
16540
|
|
@@ -0,0 +1,8 @@
|
|
1
|
+
yeref/__init__.py,sha256=Qpv3o6Xa78VdLcsSRmctGtpnYE9btpAkCekgGhgJyXM,49
|
2
|
+
yeref/l_.py,sha256=LMX_olmJwq-tgoALJCnhV_fGrL_i_43yBLkLIcEVqGo,1176743
|
3
|
+
yeref/tonweb.js,sha256=Jf6aFOQ1OIY4q7fINYz-m5LsI3seMus124M5SYYZmtE,443659
|
4
|
+
yeref/yeref.py,sha256=kvDM8DViQJMT3WPDYBw2loFt1twrnA1Tec86WSuIplE,1053319
|
5
|
+
yeref-0.24.75.dist-info/METADATA,sha256=UJirxHsM6wl6rsp_aFHQBpf0JYb8wLO6OZWfy7jqzto,119
|
6
|
+
yeref-0.24.75.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
7
|
+
yeref-0.24.75.dist-info/top_level.txt,sha256=yCQKchWHbfV-3OuQPYRdi2loypD-nmbDJbtt3OuKKkY,6
|
8
|
+
yeref-0.24.75.dist-info/RECORD,,
|
yeref-0.24.73.dist-info/RECORD
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
yeref/__init__.py,sha256=Qpv3o6Xa78VdLcsSRmctGtpnYE9btpAkCekgGhgJyXM,49
|
2
|
-
yeref/l_.py,sha256=LMX_olmJwq-tgoALJCnhV_fGrL_i_43yBLkLIcEVqGo,1176743
|
3
|
-
yeref/tonweb.js,sha256=Jf6aFOQ1OIY4q7fINYz-m5LsI3seMus124M5SYYZmtE,443659
|
4
|
-
yeref/yeref.py,sha256=MwzWQTSqgeehsMOK_9lsWv6BwiTcmt3vIaOggbD04lk,1053721
|
5
|
-
yeref-0.24.73.dist-info/METADATA,sha256=VukAmV-sflraUOmoDqfbN94BUREeH_TMfdieUYeyq3I,119
|
6
|
-
yeref-0.24.73.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
7
|
-
yeref-0.24.73.dist-info/top_level.txt,sha256=yCQKchWHbfV-3OuQPYRdi2loypD-nmbDJbtt3OuKKkY,6
|
8
|
-
yeref-0.24.73.dist-info/RECORD,,
|
File without changes
|
File without changes
|