mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
Fix/keep the same-day reviews for training & optimized parameters should be consistent if the inputs are consistents (#3450)
* keep the same-day reviews in feature * Update to FSRS-rs v1.2.3 * format * don't remove short-term reviews if not training * Update to FSRS-rs v1.2.4
This commit is contained in:
parent
d9969a9f4f
commit
db5c472e20
4 changed files with 11 additions and 13 deletions
4
Cargo.lock
generated
4
Cargo.lock
generated
|
@ -1862,9 +1862,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "fsrs"
|
name = "fsrs"
|
||||||
version = "1.2.2"
|
version = "1.2.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1bbd56ab9e6c5d40802c7f73701b9cc4bccf9fa29037799a94ac9f1a94f1a5f7"
|
checksum = "c6c3e9d1ab337e63735c4ceff913b9818eeac054d8dc17ca1b259195a7fbfb16"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"burn",
|
"burn",
|
||||||
"itertools 0.12.1",
|
"itertools 0.12.1",
|
||||||
|
|
|
@ -35,7 +35,7 @@ git = "https://github.com/ankitects/linkcheck.git"
|
||||||
rev = "184b2ca50ed39ca43da13f0b830a463861adb9ca"
|
rev = "184b2ca50ed39ca43da13f0b830a463861adb9ca"
|
||||||
|
|
||||||
[workspace.dependencies.fsrs]
|
[workspace.dependencies.fsrs]
|
||||||
version = "1.2.2"
|
version = "1.2.4"
|
||||||
# git = "https://github.com/open-spaced-repetition/fsrs-rs.git"
|
# git = "https://github.com/open-spaced-repetition/fsrs-rs.git"
|
||||||
# rev = "58ca25ed2bc4bb1dc376208bbcaed7f5a501b941"
|
# rev = "58ca25ed2bc4bb1dc376208bbcaed7f5a501b941"
|
||||||
# path = "../open-spaced-repetition/fsrs-rs"
|
# path = "../open-spaced-repetition/fsrs-rs"
|
||||||
|
|
|
@ -1225,7 +1225,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "fsrs",
|
"name": "fsrs",
|
||||||
"version": "1.2.2",
|
"version": "1.2.4",
|
||||||
"authors": "Open Spaced Repetition",
|
"authors": "Open Spaced Repetition",
|
||||||
"repository": "https://github.com/open-spaced-repetition/fsrs-rs",
|
"repository": "https://github.com/open-spaced-repetition/fsrs-rs",
|
||||||
"license": "BSD-3-Clause",
|
"license": "BSD-3-Clause",
|
||||||
|
|
|
@ -308,16 +308,13 @@ pub(crate) fn single_card_revlog_to_items(
|
||||||
}
|
}
|
||||||
|
|
||||||
// Filter out unwanted entries
|
// Filter out unwanted entries
|
||||||
let mut unique_dates = std::collections::HashSet::new();
|
|
||||||
entries.retain(|entry| {
|
entries.retain(|entry| {
|
||||||
let manually_rescheduled =
|
!(
|
||||||
entry.review_kind == RevlogReviewKind::Manual || entry.button_chosen == 0;
|
// manually rescheduled
|
||||||
let cram = entry.review_kind == RevlogReviewKind::Filtered && entry.ease_factor == 0;
|
(entry.review_kind == RevlogReviewKind::Manual || entry.button_chosen == 0)
|
||||||
if manually_rescheduled || cram {
|
|| // cram
|
||||||
return false;
|
(entry.review_kind == RevlogReviewKind::Filtered && entry.ease_factor == 0)
|
||||||
}
|
)
|
||||||
// Keep only the first review when multiple reviews done on one day
|
|
||||||
unique_dates.insert(entry.days_elapsed(next_day_at))
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Compute delta_t for each entry
|
// Compute delta_t for each entry
|
||||||
|
@ -346,6 +343,7 @@ pub(crate) fn single_card_revlog_to_items(
|
||||||
.collect();
|
.collect();
|
||||||
FSRSItem { reviews }
|
FSRSItem { reviews }
|
||||||
})
|
})
|
||||||
|
.filter(|item| !training || item.reviews.last().unwrap().delta_t > 0)
|
||||||
.collect_vec();
|
.collect_vec();
|
||||||
if items.is_empty() {
|
if items.is_empty() {
|
||||||
None
|
None
|
||||||
|
|
Loading…
Reference in a new issue