Skip to content

Commit

Permalink
Fix/next_interval() missing 1 required positional argument: 'r' (#476)
Browse files Browse the repository at this point in the history
  • Loading branch information
user1823 authored Oct 9, 2024
1 parent b829bbe commit 42ec95d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions schedule/reschedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,14 +373,12 @@ def reschedule_card(cid, fsrs: FSRS, recompute=False):
odds = dr / (1 - dr)

odds_lower = (1 - fsrs.reschedule_threshold) * odds
fsrs.desired_retention = odds_lower / (odds_lower + 1)
adjusted_ivl_upper = next_interval(s)
dr_lower = odds_lower / (odds_lower + 1)
adjusted_ivl_upper = next_interval(s, dr_lower)

odds_upper = (1 + fsrs.reschedule_threshold) * odds
fsrs.desired_retention = odds_upper / (odds_upper + 1)
adjusted_ivl_lower = next_interval(s)

fsrs.desired_retention = dr
dr_upper = odds_upper / (odds_upper + 1)
adjusted_ivl_lower = next_interval(s, dr_upper)

if card.ivl >= adjusted_ivl_lower and card.ivl <= adjusted_ivl_upper:
return None
Expand Down

0 comments on commit 42ec95d

Please sign in to comment.