This release makes a major change to the `ReviewLog` class and additionally introduces the `Optimizer` class which can be optionally installed to compute an optimal set of `Scheduler` parameters based on previous `ReviewLog` objects.
Changes to `ReviewLog`
The `ReviewLog` class no longer stores the `Card` attribute and has been replaced with a simpler `card_id` attribute.
python
Py-FSRS v4 (old)
class ReviewLog:
card: Card
rating: Rating
review_datetime: datetime
review_duration: int | None
python
Py-FSRS v5 (new)
class ReviewLog:
card_id: int
rating: Rating
review_datetime: datetime
review_duration: int | None
If you've previously stored your `ReviewLog` objects as `.json` files, upgrading should be fairly simple
python
Py-FSRS v4 (old)
{'card': {'card_id': 1737744147587,
'state': 1,
'step': 0,
'stability': None,
'difficulty': None,
'due': '2025-01-24T18:42:27.587133+00:00',
'last_review': None},
'rating': 3,
'review_datetime': '2025-01-24T18:42:27.587305+00:00',
'review_duration': None}
python
Py-FSRS v5 (new)
{'card_id': 1737744147587,
'rating': 3,
'review_datetime': '2025-01-24T18:42:27.587305+00:00',
'review_duration': None}
Optional `Optimizer`
As mentioned above, a new optional `Optimizer` class has been added. Please see the updated [README](https://github.com/open-spaced-repetition/py-fsrs?tab=readme-ov-file#optimizer-optional) for more details.
What's Changed
* Add optional dev dependencies to pyproject.toml by joshdavham in https://github.com/open-spaced-repetition/py-fsrs/pull/76
* Stop using math.exp and math.pow by joshdavham in https://github.com/open-spaced-repetition/py-fsrs/pull/78
* Improve mypy gh action by joshdavham in https://github.com/open-spaced-repetition/py-fsrs/pull/79
* Test multiple versions of python in pytest gh action by joshdavham in https://github.com/open-spaced-repetition/py-fsrs/pull/80
* Remove mypy by joshdavham in https://github.com/open-spaced-repetition/py-fsrs/pull/81
* Add optional optimizer by joshdavham in https://github.com/open-spaced-repetition/py-fsrs/pull/82
**Full Changelog**: https://github.com/open-spaced-repetition/py-fsrs/compare/v4.1.2...v5.0.0