ig3 / anki-limitnew

Limit the number of new cards in Anki
MIT License
3 stars 0 forks source link

Feature request: smoothly diminish new cards to minimum #6

Open adamlopresto opened 3 years ago

adamlopresto commented 3 years ago

Between workloadLimit and workloadMax (and the various other places between limits and maxes), you're linearly decreasing new cards from whatever the standard new cards per day is down to 0, and then enforcing a hard limit of minimumNew. I think instead, you should make the linear transition go from newPerDay to minimumNew.

If the ratio is .5 and new cards per day is 20 with a minimum of 10, you should see 15 (halfway between those), not 10.

I'm sorry if that's confusing. I'm thinking it's something like changing add_on_2_1_28.py line 231 from

maxNew = max(deckMinimumNew, min(maxNew, int(round(newPerDay * (1 - ratio)))))

to

maxNew = max(deckMinimumNew, min(maxNew, int(round(deckMinimumNew + ((newPerDay-deckMinimumNew) * (1 - ratio)))))

and similarly for the rest of the calculations.

ig3 commented 3 years ago

Thank you for the suggestion. I agree that would be better. It was on my mind as I made the change, but I wanted something quick and robust. I'm too busy at the moment and want to let the recent changes settle for a bit (this last update was quite bad initially). When I'm confident it is otherwise OK, I'll look at making this change.