yeref 0.24.79__tar.gz → 0.24.81__tar.gz
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-0.24.79 → yeref-0.24.81}/PKG-INFO +1 -1
- {yeref-0.24.79 → yeref-0.24.81}/setup.py +1 -1
- {yeref-0.24.79 → yeref-0.24.81}/yeref/yeref.py +15 -4
- {yeref-0.24.79 → yeref-0.24.81}/yeref.egg-info/PKG-INFO +1 -1
- {yeref-0.24.79 → yeref-0.24.81}/pyproject.toml +0 -0
- {yeref-0.24.79 → yeref-0.24.81}/setup.cfg +0 -0
- {yeref-0.24.79 → yeref-0.24.81}/yeref/__init__.py +0 -0
- {yeref-0.24.79 → yeref-0.24.81}/yeref/l_.py +0 -0
- {yeref-0.24.79 → yeref-0.24.81}/yeref/tonweb.js +0 -0
- {yeref-0.24.79 → yeref-0.24.81}/yeref.egg-info/SOURCES.txt +0 -0
- {yeref-0.24.79 → yeref-0.24.81}/yeref.egg-info/dependency_links.txt +0 -0
- {yeref-0.24.79 → yeref-0.24.81}/yeref.egg-info/top_level.txt +0 -0
@@ -16373,16 +16373,15 @@ async def return_cohort_metrics(bot, PROJECT_USERNAME, EXTRA_D, BASE_P):
|
|
16373
16373
|
total_lost = 0
|
16374
16374
|
total_start = 0
|
16375
16375
|
for j in range(num_months):
|
16376
|
-
# для каждой когорты собираем по календарным месяцам
|
16377
16376
|
for i in range(j, num_months - 1):
|
16378
16377
|
start_cnt = counts[i][j]
|
16379
16378
|
next_cnt = counts[i + 1][j]
|
16380
16379
|
if start_cnt > 0:
|
16381
|
-
lost = start_cnt - next_cnt
|
16380
|
+
lost = max(start_cnt - next_cnt, 0)
|
16382
16381
|
total_lost += lost
|
16383
16382
|
total_start += start_cnt
|
16384
16383
|
|
16385
|
-
avg_churn = (total_lost / total_start
|
16384
|
+
avg_churn = (total_lost / total_start) if total_start else 0
|
16386
16385
|
|
16387
16386
|
path = os.path.join(EXTRA_D, "3_cohort_metrics.csv")
|
16388
16387
|
with open(path, "w", newline="", encoding="utf-8") as f:
|
@@ -16390,7 +16389,7 @@ async def return_cohort_metrics(bot, PROJECT_USERNAME, EXTRA_D, BASE_P):
|
|
16390
16389
|
for r in table:
|
16391
16390
|
writer.writerow(r)
|
16392
16391
|
writer.writerow([])
|
16393
|
-
writer.writerow([f"Churn ~ ×{avg_churn:.
|
16392
|
+
writer.writerow([f"Churn ~ ×{avg_churn:.2f} monthly"])
|
16394
16393
|
|
16395
16394
|
thumb = types.FSInputFile(os.path.join(EXTRA_D, "parse.jpg"))
|
16396
16395
|
await bot.send_document(chat_id=my_tid, document=types.FSInputFile(path), thumbnail=thumb)
|
@@ -16536,6 +16535,18 @@ async def return_retention_metrics(bot, PROJECT_USERNAME, EXTRA_D, BASE_P):
|
|
16536
16535
|
row.append(f"{row_sum:.1f}")
|
16537
16536
|
writer.writerow(row)
|
16538
16537
|
|
16538
|
+
factors = []
|
16539
|
+
for c in cohort_months:
|
16540
|
+
for i in range(1, num_cohorts):
|
16541
|
+
prev_rev = rev_by_cohort[c].get(i - 1, 0.0)
|
16542
|
+
curr_rev = rev_by_cohort[c].get(i, 0.0)
|
16543
|
+
if prev_rev > 0 and curr_rev > 0:
|
16544
|
+
factors.append(curr_rev / prev_rev)
|
16545
|
+
avg_multiplier = math.prod(factors) ** (1 / len(factors)) if factors else 1.0
|
16546
|
+
|
16547
|
+
writer.writerow([])
|
16548
|
+
writer.writerow([f"NRR ~ ×{avg_multiplier:.2f} monthly"])
|
16549
|
+
|
16539
16550
|
thumb = types.FSInputFile(os.path.join(EXTRA_D, "parse.jpg"))
|
16540
16551
|
await bot.send_document(chat_id=my_tid, document=types.FSInputFile(path), thumbnail=thumb)
|
16541
16552
|
except Exception as e:
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|