From 8f73844307c24c8691de0d0a5b472f03f3b3c729 Mon Sep 17 00:00:00 2001 From: user1823 <92206575+user1823@users.noreply.github.com> Date: Mon, 2 Dec 2024 16:19:30 +0530 Subject: [PATCH] Remove load from FSRS stats --- stats.py | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/stats.py b/stats.py index 3ece080..0e90725 100644 --- a/stats.py +++ b/stats.py @@ -23,7 +23,7 @@ def _lineTbl_now(i): return "" + "".join(i) + "
" -def retention_stability_load(lim) -> tuple: +def retention_stability(lim) -> tuple: elapse_stability_ivl_list = mw.col.db.all( f""" SELECT @@ -32,7 +32,6 @@ def retention_stability_load(lim) -> tuple: ELSE {mw.col.sched.today} - (odue - ivl) END ,json_extract(data, '$.s') - ,ivl ,(SELECT COUNT(*) FROM cards c2 WHERE c1.nid = c2.nid AND queue != -1) ,nid FROM cards c1 @@ -44,33 +43,30 @@ def retention_stability_load(lim) -> tuple: ) # x[0]: elapsed days # x[1]: stability - # x[2]: interval - # x[3]: same nid count - # x[4]: nid + # x[2]: same nid count + # x[3]: nid elapse_stability_ivl_list = filter( lambda x: x[1] is not None, elapse_stability_ivl_list ) - retention_stability_load_list = list( + retention_stability_list = list( map( lambda x: ( power_forgetting_curve(max(x[0], 0), x[1]), x[1], - 1 / max(1, x[2]), + x[2], x[3], - x[4], ), elapse_stability_ivl_list, ) ) - card_cnt = len(retention_stability_load_list) - note_cnt = len(set(x[4] for x in retention_stability_load_list)) + card_cnt = len(retention_stability_list) + note_cnt = len(set(x[3] for x in retention_stability_list)) if card_cnt == 0: - return 0, 0, 0, 0, 0, 0, 0, 0 - recall_sum = sum(item[0] for item in retention_stability_load_list) - stability_sum = sum(item[1] for item in retention_stability_load_list) - load_sum = sum(item[2] for item in retention_stability_load_list) + return 0, 0, 0, 0, 0, 0, 0 + recall_sum = sum(item[0] for item in retention_stability_list) + stability_sum = sum(item[1] for item in retention_stability_list) estimated_total_knowledge_notes = sum( - item[0] / item[3] for item in retention_stability_load_list + item[0] / item[2] for item in retention_stability_list ) time_sum = mw.col.db.scalar( @@ -90,7 +86,6 @@ def retention_stability_load(lim) -> tuple: return ( recall_sum / card_cnt, stability_sum / card_cnt, - load_sum, card_cnt, round(recall_sum), estimated_total_knowledge_notes, @@ -220,18 +215,15 @@ def get_fsrs_stats(self: CollectionStats): ( retention, stability, - load, card_cnt, estimated_total_knowledge, estimated_total_knowledge_notes, note_cnt, time_sum, - ) = retention_stability_load(lim) + ) = retention_stability(lim) i = [] _line_now(i, "Average predicted retention", f"{retention * 100: .2f}%") _line_now(i, "Average stability", f"{round(stability)} days") - if int_version() < 241000: - _line_now(i, "Daily Load", f"{round(load)} reviews/day") i.append( "Retention by Cards:" ) @@ -268,7 +260,6 @@ def get_fsrs_stats(self: CollectionStats): + "
Interpretation