Commit graph

60 commits

Author SHA1 Message Date
Damien Elmes
0981523af0
Merge pull request #400 from agentydragon/typing-sv2
Some type declarations for scheduler v2
2019-12-28 07:12:02 +10:00
Damien Elmes
ad64ebe035
Merge pull request #399 from agentydragon/extra-ws
Remove extra whitespace at end of line
2019-12-28 07:11:40 +10:00
Michal Pokorný (Rai)
9fc63ff567 Typing for scheduler v2 2019-12-27 19:36:57 +01:00
Michal Pokorný (Rai)
0199597ecb Remove extra whitespace at end of line 2019-12-27 19:26:48 +01:00
Michal Pokorný (Rai)
9383a72704 Remove unneeded utf-8 encoding declaration
UTF-8 is the default as of Python 3.
See: https://docs.python.org/3/reference/lexical_analysis.html#encoding-declarations
2019-12-27 18:06:06 +01:00
Damien Elmes
92673c99d8 rework the new scheduler's rollover/day counting code
The previous implementation interpreted the creation date as a local
time, and applied the rollover to that. If the initial creation date
was around midnight local time, even a one hour change due to daylight
savings could result in Anki skipping or doubling up on a day. To
address this, the rollover is now applied to the current time instead
of the creation date.

The new code needs the current time passed into it. This makes it
easier to unit test, and for AnkiWeb to be able to use the user's local
timezone.

The new timezone code is currently disabled, as this code needs to be
ported to all clients before it can be activated.
2019-12-27 21:53:20 +10:00
Damien Elmes
17af26dcb5 apply black to all files 2019-12-23 10:34:10 +10:00
Ian Goodacre
329ca71436 Use _deckNewLimitSingle in _groupChildrenMain 2019-12-21 09:26:51 +13:00
Damien Elmes
c1587254f4 use isort to tidy up imports 2019-12-20 19:19:29 +10:00
Damien Elmes
b6b8df2dcf add a bunch of annotations for mypy 2019-12-20 15:07:40 +10:00
Damien Elmes
9c16d59086 type hints for scheduler 2019-12-20 11:07:08 +10:00
Damien Elmes
6ecfff56c5 add pytype inferred types to anki/
I've corrected some obvious issues, and we can fix others over time.
Mypy tests are currently broken, as adding the type hints has increased
mypy's testing surface.
2019-12-20 11:07:08 +10:00
Damien Elmes
d4145d1f04 fix type inference in scheduler 2019-12-16 17:54:17 +10:00
Damien Elmes
7f2fecb944 sort due in filtered decks by ordinal, like normal review
https://anki.tenderapp.com/discussions/ankidesktop/37419-card-order-of-siblings-not-preserved-in-filtered-deck#comment_47910714
2019-12-11 08:12:50 +10:00
Damien Elmes
5a5be92d09 add a token 1 day bonus so easy on a relearn card differs from good
https://anki.tenderapp.com/discussions/beta-testing/1589-anki-2116-beta#comment_47905454
2019-12-09 12:12:29 +10:00
Damien Elmes
d46899943c fix negative due dates in filtered decks
https://anki.tenderapp.com/discussions/ankidesktop/35978-rebuilding-filtered-deck-on-experimental-v2-empties-deck-and-reschedules-to-the-year-1745

this means affected cards will not have the selected ordering applied,
but that seems preferable to the alternatives
2019-09-24 15:38:33 +10:00
Damien Elmes
4dde7b13d0 ensure random distribution of due cards for a given day in v2 sched 2019-08-17 18:45:00 +10:00
Damien Elmes
9fc4b55575 fix v2 relearning reset bug
https://anki.tenderapp.com/discussions/ankidesktop/34560-schedule-switching-bug
2019-06-14 09:15:48 +10:00
Damien Elmes
ef10d76edb fix v2 lrn scheduling bug
https://anki.tenderapp.com/discussions/ankimobile/9714-deleting-custom-study-deck-skips-learning-step-time
2019-05-31 15:05:12 +10:00
Damien Elmes
bcb422beda fix learn steps being assigned on relearn in v2 2019-04-30 09:27:28 +10:00
Damien Elmes
f6b2135129 fix some warnings 2019-03-04 16:01:10 +10:00
Damien Elmes
e39c27afeb revlog changes need to limited to (re)learning cards
if you switched schedulers with the git code or the beta, please
restore from a backup prior to the switch
2019-02-11 18:12:44 +10:00
Damien Elmes
372d5ed6e8 update copyright and clarify licenses 2019-02-05 14:01:33 +10:00
Damien Elmes
e073ef08b9 shift revlog eases when turning v2 sched on/off
fixes old 'good'/'easy' answers showing up as 'hard'/'good' in
the graphs
2019-02-05 12:30:01 +10:00
Damien Elmes
86fb47d49d ensure today and dayCutoff are integers
https://github.com/dae/anki/pull/272
2019-02-04 14:29:52 +10:00
Damien Elmes
d0fb87d432 make sure lapse % doesn't create decimal intervals
issue reported on
https://github.com/dae/anki/pull/272
2019-01-29 08:01:23 +10:00
Damien Elmes
8f77cafb04 scan for due learning cards more frequently 2018-12-10 12:11:45 +10:00
Damien Elmes
7cb58c3432 update learning cutoff time periodically
prevents users from having to leave and return to the deck to show
cards that have become due during the study session

https://anki.tenderapp.com/discussions/ankimobile/8530-ankimobile-with-experimental-schedule-not-showing-due-cards-in-realtime
2018-11-27 19:37:46 +10:00
Arthur-Milchior
8e0077335a Change order of new cards
This commit corrects the following bug:

* Create a note N in an empty deck D of type basic (reverse), with
only some back, no front. Only card 2 will be generated.
* Edit the note, add a front. Card 1 will be generated.
* In the main window, try to learn deck D. In anki, currently, you'll
  see Card 2 first. According to the manual (and to my common sens),
  it should be Card 1 first.

This commit correct this bug, and ensure that new cards are seen
according to their order, and not to their creation date.
2018-11-20 21:50:36 +01:00
Damien Elmes
9c85376b3e improve handling of invalid deck trees
- move checking code out of the schedulers and into the deck manager
- ensure we can fix the problem in one loop - the previous recursive
approach could lead to stack overflows if the top level of a large
deck tree was missing. this was also the cause of the sqlite
'interrupted' error that some users were seeing
2018-11-09 15:04:35 +10:00
Damien Elmes
f246cf1062 strictly enforce maxIvl
https://anki.tenderapp.com/discussions/ankidesktop/29904-bug-in-v2-scheduler-that-allows-exceeding-the-maximum-review-interval
2018-09-25 09:55:46 +10:00
Damien Elmes
afe81347cd recover from decks with blank sections (eg '::deck') 2018-09-22 16:04:26 +10:00
Damien Elmes
ee5675ef5b days since creation needs to be calculated relative to rollover
https://anki.tenderapp.com/discussions/ankidesktop/29502-next-day-starts-experimental-v2-scheduler-bug
2018-09-05 20:21:30 +10:00
Damien Elmes
65f6ddf8d9 v2: limit learn delay fuzz to 5 minutes and sub-day 2018-07-28 13:56:56 +10:00
Damien Elmes
a728595c1d use scheduled ivl in lapse calculation
reverting to 2.0 behaviour

https://anki.tenderapp.com/discussions/effective-learning/1300-lapse-duration-not-being-honored-for-lapses-of-multi-stepday-relearn-cards
2018-07-27 15:02:41 +10:00
Damien Elmes
4af6aa8584 better handle invalid deck list
deleting will fail if the problem deck is the default deck - better to
rename instead

fixes infinite recursion errors
2018-07-26 11:34:10 +10:00
Damien Elmes
1ac83b7998 fix invalid cards when moving from v2->v1 sched
type needs to be reset from 3->2 when relearning cards removed from
learning

https://anki.tenderapp.com/discussions/beta-testing/1210-scheduling-error
2018-07-16 16:29:53 +10:00
Damien Elmes
9e8648bed7 differentiate easy button more when reviewing early
apply half the easy bonus post ivl calculation, or else very early
reviews with longer intervals appear to have the same intervals as
answering 'good'
2018-07-11 22:18:46 +10:00
Damien Elmes
1a617e6d60 support customizing hard factor 2018-07-11 21:23:22 +10:00
Damien Elmes
6bd1eed9b6 remove study card count cap in v2 sched
- cap kept for the deck list, as we need to calculate it for multiple
decks
- v2 sched can calculate review limit faster, as it doesn't have to
check each deck separately
- filtered deck cap is same as in interface
- as this will be deployed on ankiweb, beta clients will need to update
or risk getting sanity check errors when syncing with high due counts
2018-07-11 20:03:36 +10:00
Damien Elmes
c0c33a2b58 make sure we don't put suspended leeches back in the learning queue
fixes
https://anki.tenderapp.com/discussions/beta-testing/1119-anki-210-beta-38#comment_45555453
2018-06-25 20:27:26 +10:00
Damien Elmes
01c58cfd85 ignore delay in hard case
https://anki.tenderapp.com/discussions/ankidesktop/27627-request-allow-setting-maximum-delay-for-interval-calculation-in-overdue-cards
2018-06-01 12:24:11 +10:00
Damien Elmes
c207c9bc8c speed up v2 deckDueList() in many decks case 2018-05-31 16:21:33 +10:00
Damien Elmes
fd6d02bf6a fix regular reviews being treated as relearning in v2 sched 2018-05-31 12:44:23 +10:00
Damien Elmes
9c7c52b99c cache deck name->obj map to improve many decks case 2018-05-29 19:30:13 +10:00
Damien Elmes
730d444164 give hard a 1.5x interval when there's only one (re)learning step
otherwise we end up with two buttons that do the same thing
2018-02-06 15:41:56 +10:00
Damien Elmes
cc26d32431 misleading spacing 2018-02-06 11:47:28 +10:00
Damien Elmes
1dccd7c8d7 rename _restoreFromFiltered
and use same logic as restoreQueueSnippet
2018-02-02 19:10:35 +10:00
Damien Elmes
3b0c5b2fe9 remove _cidsByDid()
no longer necessary
2018-02-02 16:55:53 +10:00
Damien Elmes
264e7c8ce9 simplify rev card answering 2018-02-02 15:19:41 +10:00