Update to FSRS-rs v1.3.5 (FSRS-5 model update) && keep three decimals for stability (#3520)

* Update to FSRS-rs v1.3.5 (FSRS-5 model update)

* keep three decimals for stability

fix https://forums.ankiweb.net/t/fsrs-5-1d-scheduling-and-learning-steps/50242/122?u=l.m.sherlock
This commit is contained in:
Jarrett Ye 2024-10-26 17:36:27 +08:00 committed by GitHub
parent 507050c876
commit 5caeac530e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 6 additions and 6 deletions

4
Cargo.lock generated
View file

@ -1860,9 +1860,9 @@ dependencies = [
[[package]]
name = "fsrs"
version = "1.3.4"
version = "1.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a05b1fdbaa34f9bcd605ad50477eea51b27b3f60f973021bd9ee1b5943169150"
checksum = "42155527199b3e7b6ad47e9db849ee25bd5bd436ee17a72ae0a3de646a20021a"
dependencies = [
"burn",
"itertools 0.12.1",

View file

@ -35,7 +35,7 @@ git = "https://github.com/ankitects/linkcheck.git"
rev = "184b2ca50ed39ca43da13f0b830a463861adb9ca"
[workspace.dependencies.fsrs]
version = "=1.3.4"
version = "=1.3.5"
# git = "https://github.com/open-spaced-repetition/fsrs-rs.git"
# rev = "58ca25ed2bc4bb1dc376208bbcaed7f5a501b941"
# path = "../open-spaced-repetition/fsrs-rs"

View file

@ -1225,7 +1225,7 @@
},
{
"name": "fsrs",
"version": "1.3.4",
"version": "1.3.5",
"authors": "Open Spaced Repetition",
"repository": "https://github.com/open-spaced-repetition/fsrs-rs",
"license": "BSD-3-Clause",

View file

@ -79,7 +79,7 @@ impl CardData {
pub(crate) fn convert_to_json(&mut self) -> Result<String> {
if let Some(v) = &mut self.fsrs_stability {
round_to_places(v, 2)
round_to_places(v, 3)
}
if let Some(v) = &mut self.fsrs_difficulty {
round_to_places(v, 3)
@ -163,7 +163,7 @@ mod test {
};
assert_eq!(
data.convert_to_json().unwrap(),
r#"{"s":123.46,"d":1.235,"dr":0.99}"#
r#"{"s":123.457,"d":1.235,"dr":0.99}"#
);
}
}