Skip to content

Instantly share code, notes, and snippets.

@karan-ta
Last active April 8, 2024 19:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karan-ta/a20faf889bab947e360dedc750946bbe to your computer and use it in GitHub Desktop.
Save karan-ta/a20faf889bab947e360dedc750946bbe to your computer and use it in GitHub Desktop.
from fsrs import *
from datetime import datetime
def print_scheduling_cards(scheduling_cards):
print("again.card:", scheduling_cards[Rating.Again].card.__dict__)
print("again.review_log:", scheduling_cards[Rating.Again].review_log.__dict__)
print("hard.card:", scheduling_cards[Rating.Hard].card.__dict__)
print("hard.review_log:", scheduling_cards[Rating.Hard].review_log.__dict__)
print("good.card:", scheduling_cards[Rating.Good].card.__dict__)
print("good.review_log:", scheduling_cards[Rating.Good].review_log.__dict__)
print("easy.card:", scheduling_cards[Rating.Easy].card.__dict__)
print("easy.review_log:", scheduling_cards[Rating.Easy].review_log.__dict__)
print()
f = FSRS()
f.p.w = (1.14, 1.01, 5.44, 14.67, 5.3024, 1.5662, 1.2503, 0.0028, 1.5489, 0.1763, 0.9953, 2.7473, 0.0179, 0.3105, 0.3976, 0.0, 2.0902)
card = Card()
now = datetime(2022, 11, 29, 12, 30, 0, 0)
scheduling_cards = f.repeat(card, now)
due = scheduling_cards[Rating.Again].card.due
print(due)
# 2022-11-29 12:31:00
scheduling_cards = f.repeat(card, due)
due = scheduling_cards[Rating.Again].card.due
print(due)
# 2022-11-29 12:32:00
scheduling_cards = f.repeat(card, due)
due = scheduling_cards[Rating.Again].card.due
print(due)
# 2022-11-29 12:33:00
scheduling_cards = f.repeat(card, due)
due = scheduling_cards[Rating.Easy].card.due
print(due)
# 2022-11-29 12:33:00
scheduling_cards = f.repeat(card, due)
due = scheduling_cards[Rating.Easy].card.due
print(due)
# 2022-11-29 12:33:00
scheduling_cards = f.repeat(card, due)
due = scheduling_cards[Rating.Easy].card.due
print(due)
# 2022-11-29 12:33:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment