Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/reschedule #72

Merged
merged 8 commits into from
Mar 12, 2024
Merged

Feat/reschedule #72

merged 8 commits into from
Mar 12, 2024

Conversation

ishiko732
Copy link
Member

增加重排功能,根据Card当前的stabilitylast_review 和期望的request_retentions来进行重排。
f. reschedule方法:

  • 会根据传入的类型来决定返回的类型,并允许用户传入options.dateHandler来解决日期类型转换问题
  • 排除卡片状态为State.NewState.LearningState.Relearning数据
  • 默认启用enable_fuzz来进行重排,允许用户传入options.enable_fuzz=false来关闭抖动
  • 仅返回需要重排的卡片集合

@L-M-Sherlock 叶大,麻烦看看这样设计有没有问题?
目前期望该方法能够在变更enable_fuzz后对没开启前的卡片进行重排产生一定的随机延迟间隔。

@ishiko732 ishiko732 added the enhancement New feature or request label Mar 9, 2024
Copy link

github-actions bot commented Mar 9, 2024

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements 100% 305/305
🟢 Branches 100% 122/122
🟢 Functions
100% (+1.59% 🔼)
47/47
🟢 Lines 100% 298/298

Test suite run success

72 tests passing in 10 suites.

Report generated by 🧪jest coverage report action from 112de0d

@L-M-Sherlock
Copy link
Member

应该没问题,不过 fuzz 的实现我的 helper add-on 改了,和 Anki 原生实现统一了。具体参考这里:

https://github.com/open-spaced-repetition/fsrs4anki-helper/blob/19581d42a957285a8d949aea0564f81296a62b81/utils.py#L113-L146

@ishiko732
Copy link
Member Author

不过 fuzz 的实现我的 helper add-on 改了,和 Anki 原生实现统一了。

我根据参考修改了apply_fuzznext_interval方法,我觉得ts-fsrs不能像fsrs4anki-helper那样在FSRS的成员变量添加elapsed_days: int。( https://github.com/open-spaced-repetition/fsrs4anki-helper/blob/19581d42a957285a8d949aea0564f81296a62b81/schedule/reschedule.py#L22C5-L22C17
因为ts-fsrs不希望每创建一张卡片就创建一个FSRS实例,所以apply_fuzznext_interval增加多了一个参数elapsed_days

apply_fuzz(ivl: number, elapsed_days: number, enable_fuzz?: boolean): int;

next_interval(s: number, elapsed_days: number, enable_fuzz: boolean):int;

虽然算法方法有所改动,但对于用ts-fsrs创建项目的开发者来说这是无感的。


然后是ts-fsrs目前没有enable_load_balance这个参数,这一块代码我不确定是否要参考编写(可能要开新的PR):
https://github.com/open-spaced-repetition/fsrs4anki-helper/blob/19581d42a957285a8d949aea0564f81296a62b81/schedule/reschedule.py#L81-L123

@L-M-Sherlock
Copy link
Member

然后是ts-fsrs目前没有enable_load_balance这个参数

这个 feature 比较复杂。我建议等 Anki 内置了再做[doge]

@ishiko732
Copy link
Member Author

然后是ts-fsrs目前没有enable_load_balance这个参数

这个 feature 比较复杂。

目前暂时不考虑balance。当前在没有enable_load_balance的情况下,reschedule应该算完成了。

Copy link
Member

@L-M-Sherlock L-M-Sherlock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ishiko732 ishiko732 marked this pull request as ready for review March 12, 2024 06:57
@ishiko732 ishiko732 merged commit 5373a26 into master Mar 12, 2024
1 check passed
@ishiko732 ishiko732 deleted the Feat/reschedule branch March 12, 2024 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants