-
-
Notifications
You must be signed in to change notification settings - Fork 25
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/add next_state
method
#146
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #146 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 15 15
Lines 693 721 +28
Branches 76 85 +9
=========================================
+ Hits 693 721 +28 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When both stability and difficulty are 0 it returns NaN
test('next_state not NaN', () => {
const f = fsrs()
const next_state = f.next_state({ stability: 0, difficulty: 0 }, 1, 1)
console.log(next_state)
expect(Number.isNaN(next_state.stability)).toBe(false)
})
When |
If both are 0 I'd say yes, but if just stability or difficulty is 0 and the other isn't its probably unintentional and should throw "invalid memory state" or something? |
ok, I've updated the boundaries to ensure exceptions are thrown. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's some more descriptive error messages if you want them.
All seems good now 👍
Co-authored-by: Luc Mcgrady <[email protected]>
Co-authored-by: Luc Mcgrady <[email protected]>
Co-authored-by: Luc Mcgrady <[email protected]>
Co-authored-by: Luc Mcgrady <[email protected]>
Co-authored-by: Luc Mcgrady <[email protected]>
Co-authored-by: Luc Mcgrady <[email protected]>
Co-authored-by: Luc Mcgrady <[email protected]>
Thank you! For the cases where other methods (such as |
No description provided.