Fsrs

Latest version: v4.1.0

Safety actively analyzes 688027 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 4

4.1.0

What's Changed
* Switch to official ruff gh action by joshdavham in https://github.com/open-spaced-repetition/py-fsrs/pull/66
* Add linear damping by joshdavham in https://github.com/open-spaced-repetition/py-fsrs/pull/67
* Fuzz more intervals by joshdavham in https://github.com/open-spaced-repetition/py-fsrs/pull/68


**Full Changelog**: https://github.com/open-spaced-repetition/py-fsrs/compare/v4.0.0...v4.1.0

4.0.0

This release makes some major changes to the API, the required version of python and a couple of other changes.

At a high level:
- Py-FSRS now requires python 3.10+
- The scheduler can now randomly "fuzz" calculated review intervals
- The scheduler can now set explicit learning and relearning steps
- Card objects no longer have a New state (new cards now start off in the Learning state)
- Card objects now have different attributes
- The scheduler has been renamed from `FSRS` to `Scheduler`
- The `repeat` method has been replaced in favor of the `review_card` method

Upgrade from v3 -> v4

To upgrade, first make sure you're using python 3.10 or later.

Next, you'll want to review the updated [README](https://github.com/open-spaced-repetition/py-fsrs/blob/main/README.md) to get familiar with the new API, which should hopefully be mostly straightforward.

The tricky part will be in updating previous v3 cards to v4.

This was the old class schema for v3 Cards:
python
class Card:
"""
Represents a flashcard in the FSRS system.

Attributes:
due (datetime): The date and time when the card is due next.
stability (float): Core FSRS parameter used for scheduling.
difficulty (float): Core FSRS parameter used for scheduling.
elapsed_days (int): The number of days since the card was last reviewed.
scheduled_days (int): The number of days until the card is due next.
reps (int): The number of times the card has been reviewed in its history.
lapses (int): The number of times the card has been lapsed in its history.
state (State): The card's current learning state.
last_review (datetime): The date and time of the card's last review.
"""

due: datetime
stability: float
difficulty: float
elapsed_days: int
scheduled_days: int
reps: int
lapses: int
state: State
last_review: datetime


and here's the new class schema for v4 Cards:
python
class Card:
"""
Represents a flashcard in the FSRS system.

Attributes:
card_id (int): The id of the card. Defaults to the epoch miliseconds of when the card was created.
state (State): The card's current learning state.
step (int | None): The card's current learning or relearning step or None if the card is in the Review state.
stability (float | None): Core mathematical parameter used for future scheduling.
difficulty (float | None): Core mathematical parameter used for future scheduling.
due (datetime): The date and time when the card is due next.
last_review (datetime | None): The date and time of the card's last review.
"""

card_id: int
state: State
step: int | None
stability: float | None
difficulty: float | None
due: datetime
last_review: datetime | None


To upgrade your v3 cards to v4 cards, do the following:
- Set `card_id` to a unique integer value. Unless otherwise specified, new v4 cards will be set to the epoch miliseconds of when the card was created, but you are free to set it to anything else.
- If your card's `state` was set to New, convert it to Learning and set its `stability` and `difficulty` values to `None`
- If your card was in the New, Learning or Relearning state, set its `step` to 0, otherwise, if the v3 card was in the Review state, set its `step` to `None`
- Remove the following attributes from your v3 cards (these were removed since they don't affect scheduling)
- `elapsed_days`
- `scheduled_days`
- `reps`
- `lapses`
- If your v3 card previously didn't have a `last_review` attribute, create one and set it to `None`

Now as for upgrading your v3`ReviewLog` objects to v4 objects, this will likely require some custom migration on your part. Apologies for any inconvenience.

In either case, this was the old v3 `ReviewLog` class schema:
python
class ReviewLog:
"""
Represents the log entry of Card that has been reviewed.
Attributes:
rating (Rating): The rating given to the card during the review.
scheduled_days (int): The number of days until the card is due next.
elapsed_days (int): The number of days since the card was last reviewed.
review (datetime): The date and time of the review.
state (State): The learning state of the card before the review.
"""

rating: Rating
scheduled_days: int
elapsed_days: int
review: datetime
state: State


and here's the new v4 `ReviewLog` schema:
python
class ReviewLog:
"""
Represents the log entry of a Card object that has been reviewed.

Attributes:
card (Card): Copy of the card object that was reviewed.
rating (Rating): The rating given to the card during the review.
review_datetime (datetime): The date and time of the review.
review_duration (int | None): The number of miliseconds it took to review the card or None if unspecified.
"""

card: Card
rating: Rating
review_datetime: datetime
review_duration: int | None


Upgrading to the new scheduler should be simple enough, just review the new README and compare it to how you were previously using the scheduler.

What's Changed
* Major update and refactor by joshdavham in https://github.com/open-spaced-repetition/py-fsrs/pull/64


**Full Changelog**: https://github.com/open-spaced-repetition/py-fsrs/compare/v3.1.0...v4.0.0

3.1.0

What's Changed
* remove wildcard imports by joshdavham in https://github.com/open-spaced-repetition/py-fsrs/pull/53
* Add unit test of memory state by L-M-Sherlock in https://github.com/open-spaced-repetition/py-fsrs/pull/54
* add more type annotation by joshdavham in https://github.com/open-spaced-repetition/py-fsrs/pull/55
* Add file that summarizes the FSRS scheduler by joshdavham in https://github.com/open-spaced-repetition/py-fsrs/pull/57
* Add docstrings by joshdavham in https://github.com/open-spaced-repetition/py-fsrs/pull/58
* Update ALGORITHM.md by ishiko732 in https://github.com/open-spaced-repetition/py-fsrs/pull/59
* compute retrievability for all states by joshdavham in https://github.com/open-spaced-repetition/py-fsrs/pull/61


**Full Changelog**: https://github.com/open-spaced-repetition/py-fsrs/compare/v3.0.0...v3.1.0

3.0.0

This release implements the new [FSRS-5](https://github.com/open-spaced-repetition/fsrs4anki/wiki/The-Algorithm#fsrs-5) scheduler algorithm.

FSRS-5 now uses 19 parameters instead of 17, so if you were previously setting your own custom parameters you must do one of the following to upgrade:
1. Optimize again with an FSRS-5 optimizer to get a new set of FSRS-5 weights
- You can choose from the following three currently available optimizers: [fsrs-optimizer](https://github.com/open-spaced-repetition/fsrs-optimizer), [fsrs-rs](https://github.com/open-spaced-repetition/fsrs-rs) or [fsrs-browser](https://github.com/open-spaced-repetition/fsrs-browser)
- Additionally, you can also wait till the next Anki release when the FSRS-5 optimizer will be included as a new feature
2. Keep your previous weights, but set the two new parameters equal to 0 (`w[17]=0, w[18]=0`)
3. Or simply revert to using default parameters for now

What's Changed
* modify readme and contributing for Ruff addition+ run ruff formatter by joshdavham in https://github.com/open-spaced-repetition/py-fsrs/pull/50
* mypy contributing by joshdavham in https://github.com/open-spaced-repetition/py-fsrs/pull/51
* FSRS-5 by joshdavham in https://github.com/open-spaced-repetition/py-fsrs/pull/52


**Full Changelog**: https://github.com/open-spaced-repetition/py-fsrs/compare/v2.5.1...v3.0.0

2.5.1

What's Changed
* use ruff by asukaminato0721 in https://github.com/open-spaced-repetition/py-fsrs/pull/47
* Create mypy.yml + fix mypy warning by asukaminato0721 in https://github.com/open-spaced-repetition/py-fsrs/pull/48
* Cast integer and Float values when reading from dict by lomenzel in https://github.com/open-spaced-repetition/py-fsrs/pull/49

New Contributors
* asukaminato0721 made their first contribution in https://github.com/open-spaced-repetition/py-fsrs/pull/47
* lomenzel made their first contribution in https://github.com/open-spaced-repetition/py-fsrs/pull/49

**Full Changelog**: https://github.com/open-spaced-repetition/py-fsrs/compare/v2.5.0...v2.5.1

2.5.0

What's Changed
* update README.md by joshdavham in https://github.com/open-spaced-repetition/py-fsrs/pull/44
* small cleanup by joshdavham in https://github.com/open-spaced-repetition/py-fsrs/pull/45
* add custom args to FSRS class by joshdavham in https://github.com/open-spaced-repetition/py-fsrs/pull/46


**Full Changelog**: https://github.com/open-spaced-repetition/py-fsrs/compare/v2.4.0...v2.5.0

Page 1 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.