mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
Show total review count when optimizing FSRS parameters (#3027)
* Show total review count when optimizing FSRS parameters * Do not expose items
This commit is contained in:
parent
d2ae0d9ada
commit
60f8399aed
5 changed files with 7 additions and 7 deletions
|
@ -138,7 +138,7 @@ message ComputeWeightsProgress {
|
||||||
uint32 current = 1;
|
uint32 current = 1;
|
||||||
// Total iterations
|
// Total iterations
|
||||||
uint32 total = 2;
|
uint32 total = 2;
|
||||||
uint32 fsrs_items = 3;
|
uint32 reviews = 3;
|
||||||
// Only used in 'compute all weights' case
|
// Only used in 'compute all weights' case
|
||||||
uint32 current_preset = 4;
|
uint32 current_preset = 4;
|
||||||
// Only used in 'compute all weights' case
|
// Only used in 'compute all weights' case
|
||||||
|
|
|
@ -445,7 +445,7 @@ def update_deck_configs() -> bytes:
|
||||||
update.label = (
|
update.label = (
|
||||||
label
|
label
|
||||||
+ "\n"
|
+ "\n"
|
||||||
+ tr.deck_config_percent_of_reviews(pct=pct, reviews=val2.fsrs_items)
|
+ tr.deck_config_percent_of_reviews(pct=pct, reviews=val2.reviews)
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
return
|
return
|
||||||
|
|
|
@ -213,7 +213,7 @@ pub(crate) fn progress_to_proto(
|
||||||
Value::ComputeWeights(anki_proto::collection::ComputeWeightsProgress {
|
Value::ComputeWeights(anki_proto::collection::ComputeWeightsProgress {
|
||||||
current: progress.current_iteration,
|
current: progress.current_iteration,
|
||||||
total: progress.total_iterations,
|
total: progress.total_iterations,
|
||||||
fsrs_items: progress.fsrs_items,
|
reviews: progress.reviews,
|
||||||
current_preset: progress.current_preset,
|
current_preset: progress.current_preset,
|
||||||
total_presets: progress.total_presets,
|
total_presets: progress.total_presets,
|
||||||
})
|
})
|
||||||
|
|
|
@ -70,7 +70,6 @@ impl Collection {
|
||||||
}
|
}
|
||||||
let fsrs_items = items.len() as u32;
|
let fsrs_items = items.len() as u32;
|
||||||
anki_progress.update(false, |p| {
|
anki_progress.update(false, |p| {
|
||||||
p.fsrs_items = fsrs_items;
|
|
||||||
p.current_preset = current_preset;
|
p.current_preset = current_preset;
|
||||||
p.total_presets = total_presets;
|
p.total_presets = total_presets;
|
||||||
})?;
|
})?;
|
||||||
|
@ -85,6 +84,7 @@ impl Collection {
|
||||||
if let Err(_err) = anki_progress.update(false, |s| {
|
if let Err(_err) = anki_progress.update(false, |s| {
|
||||||
s.total_iterations = guard.total() as u32;
|
s.total_iterations = guard.total() as u32;
|
||||||
s.current_iteration = guard.current() as u32;
|
s.current_iteration = guard.current() as u32;
|
||||||
|
s.reviews = review_count as u32;
|
||||||
finished = guard.finished();
|
finished = guard.finished();
|
||||||
}) {
|
}) {
|
||||||
guard.want_abort = true;
|
guard.want_abort = true;
|
||||||
|
@ -157,7 +157,6 @@ impl Collection {
|
||||||
.col
|
.col
|
||||||
.storage
|
.storage
|
||||||
.get_revlog_entries_for_searched_cards_in_card_order()?;
|
.get_revlog_entries_for_searched_cards_in_card_order()?;
|
||||||
anki_progress.state.fsrs_items = revlogs.len() as u32;
|
|
||||||
let (items, review_count) =
|
let (items, review_count) =
|
||||||
fsrs_items_for_training(revlogs, timing.next_day_at, ignore_revlogs_before);
|
fsrs_items_for_training(revlogs, timing.next_day_at, ignore_revlogs_before);
|
||||||
if review_count < 400 {
|
if review_count < 400 {
|
||||||
|
@ -165,6 +164,7 @@ impl Collection {
|
||||||
count: review_count,
|
count: review_count,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
anki_progress.state.reviews = review_count as u32;
|
||||||
let fsrs = FSRS::new(Some(weights))?;
|
let fsrs = FSRS::new(Some(weights))?;
|
||||||
Ok(fsrs.evaluate(items, |ip| {
|
Ok(fsrs.evaluate(items, |ip| {
|
||||||
anki_progress
|
anki_progress
|
||||||
|
@ -181,7 +181,7 @@ impl Collection {
|
||||||
pub struct ComputeWeightsProgress {
|
pub struct ComputeWeightsProgress {
|
||||||
pub current_iteration: u32,
|
pub current_iteration: u32,
|
||||||
pub total_iterations: u32,
|
pub total_iterations: u32,
|
||||||
pub fsrs_items: u32,
|
pub reviews: u32,
|
||||||
/// Only used in 'compute all weights' case
|
/// Only used in 'compute all weights' case
|
||||||
pub current_preset: u32,
|
pub current_preset: u32,
|
||||||
/// Only used in 'compute all weights' case
|
/// Only used in 'compute all weights' case
|
||||||
|
|
|
@ -229,7 +229,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
if (val instanceof ComputeRetentionProgress) {
|
if (val instanceof ComputeRetentionProgress) {
|
||||||
return `${pct}%`;
|
return `${pct}%`;
|
||||||
} else {
|
} else {
|
||||||
return tr.deckConfigPercentOfReviews({ pct, reviews: val.fsrsItems });
|
return tr.deckConfigPercentOfReviews({ pct, reviews: val.reviews });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue