Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Anki 23.10 Beta 2] SchedulerV3 #86

Open
4 of 6 tasks
khonkhortisan opened this issue Sep 25, 2023 · 3 comments
Open
4 of 6 tasks

[Anki 23.10 Beta 2] SchedulerV3 #86

khonkhortisan opened this issue Sep 25, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@khonkhortisan
Copy link

Problem description

A hack that selects the v3 scheduler and allows burying siblings, and then it still doesn't load
Please describe the issue concisely in here. In case of an error: Walk us through the steps you took to get there. What happened? What did you expect to happen?

Checklist

Please replace the space inside the brackets with an x if the following items apply:

  • I've restarted Anki to see if it helps
  • I've verified that I use the latest version of the add-on by redownloading it from AnkiWeb
  • I've verified that I use the latest version of Anki by checking at https://apps.ankiweb.net#download
  • I've tried to disable other add-ons to see if there are any interactions present
  • My issue disappears when I hold shift while starting Anki.
  • I've checked if anyone else reported this problem before by looking through the issue reports. I also checked to see if there is a section about known issues in the add-on description, documentation, or README.

Information about your Anki set-up

Please fill out the section corresponding with your Anki version:

If you are using Anki 2.1

Please open Anki, go to Help → About, click on "Copy Debug Info", and paste the result between the backticks below (if the button does not appear you are using an older version of Anki 2.1 and will need to update first):

    
    Anki 23.10 (8214aa42) Python 3.9.15 Qt 6.5.2 PyQt 6.5.2
    Platform: Windows-10-10.0.19045
    Flags: frz=True ao=True sv=3
    Add-ons, last update check: 2023-09-25 08:42:40
    
    
    ===Add-ons (active)===
    (add-on provided name [Add-on folder, installed at, version, is config changed])
    '' ['DecksAddBrowseStatsSync', 0, 'None', '']
    '' ['decknamebackgroundimage', 0, 'None', '']
    '' ['deckpercentnotch', 0, 'None', '']
    '' ['enableplover', 0, 'None', '']
    '' ['numbers2stripes █▓▒░', 0, 'None', '']
    '' ['tagtovlc', 0, 'None', mod]
    Add Table ['1237621971', 2023-06-18T04:37, 'None', '']
    Advanced Browser ['874215009', 2023-07-01T12:55, 'None', '']
    Advanced Review Bottom Bar ['1136455830', 2023-09-16T13:48, 'None', '']
    Anki Browser Context Menu Search ['422526650', 2019-11-13T12:21, 'None', '']
    Anki JavaScript API ['1490471827', 2021-02-19T12:54, 'None', '']
    Anki Killstreaks ['579111794', 2021-12-15T07:20, 'None', '']
    AnkiBrain AnkiChatGPT - GPT-4 GPT 35 Complete Integration ['1915225457', 2023-09-23T10:35, 'None', '']
    AnkiCollab - The free collaboration Platform ['1957538407', 2023-09-21T11:01, 'None', mod]
    AnkiConnect ['2055492159', 2023-04-11T10:20, 'None', mod]
    AnkiWebView Inspector ['31746032', 2023-06-27T12:26, 'None', '']
    Answer Visual Confirmation ['1208806023', 2008-04-21T12:27, 'None', '']
    Batch Editing ['291119185', 2019-06-04T16:10, 'None', '']
    Bury After Fail Streak ['966431904', 2023-06-06T07:14, 'None', '']
    Cloze Hide All ['1709973686', 2021-09-11T03:00, '21.9.11i107', mod]
    Cloze Overlapper for Anki 21 ['109531687', 2021-01-11T19:12, 'None', '']
    Contanki - Controller Support for Anki beta ['1898790263', 2023-02-01T17:04, 'v0.9.2-beta', mod]
    Content Injector ['166455199', 2020-09-03T09:08, 'None', mod]
    Deck Browser CSS ['153779542', 2022-10-18T08:53, 'None', '']
    Enhance main window ['877182321', 2023-01-15T23:50, 'None', mod]
    HyperTTS - Add speech to your flashcards ['111623432', 2023-08-30T21:32, 'None', mod]
    Image Occlusion Enhanced ['1374772155', 2022-04-09T00:15, 'None', '']
    Incremental Reading v4118 unofficial clone ['999215520', 2023-07-31T22:57, 'None', '']
    IntelliFiller ChatGPT ['1416178071', 2023-06-29T11:23, '1.1.0', '']
    Kanji Grid ['909972618', 2019-01-09T14:40, 'None', mod]
    Leaderboard ['41708974', 2023-01-15T02:53, 'None', mod]
    Learn now  Grade now ['1021636467', 2023-05-09T15:09, 'None', '']
    Migaku Chinese ['498302176', 2021-04-12T15:29, 'None', mod]
    Migaku Retirement ['1666520655', 2021-01-13T16:37, 'None', mod]
    Mindmap from tag hierarchy ['965278890', 2022-11-16T02:55, 'None', '']
    MorphMan for Anki 21 ['900801631', 2023-08-17T19:37, 'None', '']
    Neo Anki Leaderboard ['1894428367', 2023-03-09T12:27, 'None', mod]
    Rendered Browser ['993394845', 2022-07-04T14:55, 'None', '']
    Review Heatmap ['1771074083', 2022-06-29T18:43, 'None', '']
    Review Hotmouse ['1928346827', 2022-05-16T21:25, '2.6', mod]
    Ruzu Pop-ups ['1736169259', 2022-12-26T17:07, 'v0.0.4', mod]
    True Retention by Card Maturity Simplified ['1779060522', 2020-06-28T06:45, 'None', '']
    add-on dialog searchfilter bar ['561945101', 2023-06-15T05:39, 'None', '']
    extended editor for field for tables searchreplace ['805891399', 2023-07-31T07:12, 'None', mod]
    right hand reviews  hjkl answer shortcuts  Handy Answer Keys configurable ['850294128', 2023-05-24T01:59, 'None', mod]
    
    ===IDs of active AnkiWeb add-ons===
    1021636467 109531687 111623432 1136455830 1208806023 1237621971 1374772155 1416178071 1490471827 153779542 166455199 1666520655 1709973686 1736169259 1771074083 1779060522 1894428367 1898790263 1915225457 1928346827 1957538407 2055492159 291119185 31746032 41708974 422526650 498302176 561945101 579111794 805891399 850294128 874215009 877182321 900801631 909972618 965278890 966431904 993394845 999215520
    
    ===Add-ons (inactive)===
    (add-on provided name [Add-on folder, installed at, version, is config changed])
    '' ['MorphMan', 0, 'None', '']
    '' ['TitleAgo', 0, 'None', '']
    '' ['cloze_overlapper', 0, 'None', '']
    '' ['countnotifier', 0, 'None', '']
    '' ['fsrs4anki-helper', 0, 'None', mod]
    '' ['speech-to-text', 0, 'None', '']
    3 add-ons merged quicker anki explain deletion explain database check ['777545149', 2019-09-26T06:03, 'None', '']
    ActivityWatch for Anki ['567877061', 2022-10-21T15:24, 'None', '']
    Add Card Do First Review ['1394953283', 2020-11-11T06:40, 'None', '']
    Add Parent Tag To Every Tag In A Deck ['543106186', 2019-11-20T18:30, 'None', '']
    Advanced Answer Sounds ['1167194350', 2022-05-29T00:30, 'None', '']
    Advanced Copy Fields ['1898445115', 2019-05-03T11:46, 'None', '']
    Almost Mandatory Tags ['1386232247', 2022-12-28T09:51, 'None', '']
    Anki Preview Reloader ['571150035', 2023-04-22T12:29, '1.0.0', '']
    Anki Simulator ['817108664', 2021-08-07T12:24, 'None', '']
    Anki Time anti-distraction helper ['998250600', 2023-01-09T05:44, 'None', '']
    Anki X Markdown X MindMap ['728482867', 2022-07-08T21:07, 'None', '']
    Anki Zoom ['538879081', 2020-04-03T17:20, 'v1.1.3', '']
    Anki with Friends ['613520216', 2022-02-05T08:40, 'None', mod]
    Anki-redesign ['308574457', 2023-02-04T10:43, 'None', mod]
    AnkiFlash Flashcards Importer Vietnamese English Japanese Chinese French ['1129289384', 2021-11-27T11:52, 'None', '']
    AnkiHub ['1322529746', 2023-09-25T02:23, 'None', mod]
    AnkiOCR ['450181164', 2021-09-18T22:55, 'None', '']
    AnkiPet - gamify your learning by caring for a pet ['1296038972', 2021-05-18T00:18, 'None', '']
    Ankicord - Discord Rich Presence ['1828536813', 2023-08-16T08:53, 'None', '']
    Ankimote - remote to control Anki from your phone ['149004221', 2021-08-11T09:57, 'None', '']
    Asset Manager ['656021484', 2021-08-29T14:07, 'None', '']
    Auto Ease Factor ['1672712021', 2021-03-21T11:11, 'None', mod]
    AutoDefine - Automatically define vocabulary words with pronunciations and image ['2136497008', 2020-11-15T15:16, 'None', mod]
    AwesomeTTS - Add speech to your flashcards ['1436550454', 2023-07-24T16:48, 'None', '']
    Browser TableEditor side-by-side horizontal split ['831846358', 2022-01-25T14:11, 'None', '']
    CC-CEDICT for Anki Chinese dictionary ['418828045', 2022-03-23T05:22, 'None', mod]
    CN Bulk Generate Chinese Hanzi Homophone List to field ['1709020234', 2017-09-18T00:41, 'None', '']
    Chinese Companion - frequency sort HSK suspend heisig support and more ['2129668097', 2019-05-20T01:02, 'None', '']
    Chinese Pinyin Translator Zhuyin Bopomofo Gwoyeu Romatzyh ['1792056402', 2018-11-08T19:27, 'None', mod]
    Chinese Prestudy ['882364911', 2020-11-02T22:43, 'None', '']
    Chinese Stats ['1959794557', 2022-01-29T23:06, 'None', mod]
    Chinese Support Redux v0142 ['1128979221', 2021-03-28T19:19, 'None', mod]
    Chinese Vocabulary Generator ['1370756741', 2021-02-24T00:07, 'None', '']
    Chinese Words Finder ['2048169015', 2020-07-07T05:32, 'None', '']
    Chinese-Text-Scanner ['2121493325', 2020-06-27T21:53, 'None', mod]
    Cloze Anything ['330680661', 2021-12-08T23:34, 'None', '']
    Color Confirmation ['1084228676', 2020-03-14T05:13, 'None', mod]
    Colorful Tags  Hierarchical Tags ['594329229', 2022-09-15T08:06, 'None', '']
    Congrats Confetti ['206062158', 2023-01-16T20:02, 'None', '']
    Convert Subdecks to Tag Hierarchy ['1172858842', 2023-02-07T10:15, 'None', '']
    Cookie monster ['1501583548', 2018-04-13T02:38, 'None', '']
    Correcting a bug in anki which makes new card appearing in wrong order ['127334978', 2019-12-09T01:38, 'None', '']
    Countdown To Events and Exams ['1143540799', 2022-06-27T04:50, 'None', '']
    Create subs2srs cards with mpv  interactive subs ['832294226', 2023-03-08T03:45, 'None', '']
    CrowdAnki JSON exportimport Edit history Collaborate on deck creation ['1788670778', 2023-07-14T17:31, 'None', '']
    Custom Background Image and Gear Icon ['1210908941', 2023-04-18T18:19, 'None', mod]
    Deck Counts NowLater ['1836212767', 2020-09-09T08:33, 'None', '']
    DeepL Translator ['972129549', 2022-07-30T15:16, '1.0.0', mod]
    Delay siblings ['1369579727', 2022-06-03T16:05, 'None', mod]
    DrawingPad ['370778248', 2023-09-16T12:49, 'None', '']
    Editor Live Preview ['1960039667', 2023-09-25T02:56, 'None', mod]
    Enhanced Cloze for Anki 21 ['1990296174', 2023-09-10T11:48, 'None', '']
    Extended Card Stats During Review ['1008566916', 2017-08-29T11:59, 'None', '']
    FSRS4Anki Helper ['759844606', 2023-09-25T05:00, 'None', mod]
    Fast Word Query Multi-threaded queries for words from local or web dictionaries ['1807206748', 2019-06-22T20:10, 'None', '']
    Fast cards reposition ['544982740', 2021-09-19T06:51, 'None', '']
    Fill the blanks - Multiple typecloze support ['1933645497', 2023-05-03T11:21, 'None', '']
    Find and Replace in Notetypes ['992153575', 2023-08-18T20:14, 'None', '']
    Fix invalid card IDs ['196231552', 2021-11-25T17:33, 'None', '']
    Flag label ['671965183', 2023-03-22T01:44, 'None', '']
    Flexible Cloze ['1632356464', 2023-01-21T08:04, 'None', '']
    Grid Fields ['796923308', 2021-04-09T12:09, 'None', '']
    HTML Window source ['1214415810', 2020-02-18T05:20, 'None', '']
    Hitmarkers ['1776869150', 2020-03-31T15:04, 'None', '']
    Large and Colorful Buttons ['1829090218', 2018-10-02T10:41, 'None', '']
    Life Drain ['715575551', 2023-06-20T04:41, 'None', mod]
    LilyPond sheet music typesetting integration ['1080109152', 2021-09-28T15:16, 'None', mod]
    Markdown and KaTeX Support ['1087328706', 2023-05-06T04:28, 'None', '']
    Memory Status Bar and Stats ['1582352817', 2023-02-28T09:04, 'None', '']
    Migaku Anki Add-on ['1846879528', 2023-09-20T01:24, 'None', mod]
    More Decks Stats and Time Left ['1556734708', 2023-09-24T07:08, 'None', '']
    More Overview Stats ['2116130837', 2022-09-16T10:56, 'None', '']
    Motivanki ['663438166', 2022-06-23T08:38, 'None', '']
    Multiple Choice for Anki ['1566095810', 2023-07-20T02:59, 'None', '']
    No Distractions Full Screen Clean review interface WORKING ['1799768115', 2022-11-20T11:04, 'v4.1.8', mod]
    Photo-episodic 20 ['1989739687', 2020-08-26T17:15, 'None', '']
    Play a celebrationcompletion sound when you finish your deck ['978869609', 2022-11-29T20:20, 'None', mod]
    Pokemanki ['633922407', 2021-02-24T10:49, 'None', '']
    Pop-up Wikipedia Beta ['395343016', 2020-01-08T19:58, 'None', '']
    Progress Bar cards done cards left secondscard time spentleft and ETA ['1097423555', 2023-08-29T00:54, 'None', mod]
    Puppy Reinforcement ['1722658993', 2020-03-02T12:23, 'None', '']
    Quick note and deck buttons Fork for 21 ['1331140127', 2022-05-23T06:13, 'None', '']
    Quizlet to Anki 21 Importer with audio support ['1362209126', 2023-06-18T06:31, 'None', '']
    ReColor ['688199788', 2023-04-24T05:23, '2.5', mod]
    Readable Addons Folder ['5720472', 2023-04-15T19:51, 'None', '']
    Remaining time for Anki 21 ['1508357010', 2020-12-13T06:14, '20.12.13i151', '']
    RuneScape-Gamification ['931346754', 2022-12-27T13:06, 'None', '']
    Search and Replace Tags ['138501288', 2018-02-08T16:03, 'None', '']
    Searching PDF Reading  Note-Taking in Add Dialog ['1781298089', 2022-08-15T00:22, 'None', mod]
    Semantic HTML tags in editor ['844409145', 2019-03-20T15:26, 'None', mod]
    Show answer with number keys ['188886658', 2021-03-08T09:35, 'None', '']
    Speed Focus Mode auto-alert auto-reveal auto-answer ['1046608507', 2022-12-16T03:24, 'None', '']
    Stats Overview Pie Graph with Distinct Learning and-or Relearning Sections ['1828603731', 2019-03-27T13:38, 'None', '']
    Stats Plus ['1009670238', 2021-03-04T04:23, 'None', '']
    Study Time Stats ['1247171202', 2023-06-07T06:06, 'None', '']
    Test Your Pronunciation Cloud Speech to Text ['673333980', 2021-04-16T07:34, 'None', '']
    Update lookup Tags ['1715601279', 2018-11-19T10:25, 'None', '']
    Web Browser - Search terms Import texts and images automatically ['864545277', 2022-08-02T13:49, 'None', mod]
    YT Subs2SRS ['1633834851', 2020-03-19T05:43, 'None', '']
    Yomisama JapaneseChinese ['907186589', 2020-07-24T10:18, 'None', '']
    Youtubes Video to SRS Deck ['1023383878', 2021-12-05T05:59, 'None', '']
    ZIM Reader ['951350249', 2023-02-21T13:12, 'None', mod]
    maobi - Chinese Hanzi Writing Quizzes in Anki v0 5 2 ['931477147', 2021-02-21T09:14, 'None', mod]
    numbers2polyhedrastripes ['2088639269', 2023-06-29T03:18, 'None', '']

Please fill in details about your operating system (Windows/macOS/Linux, which version):

  • OS: Windows
  • version: 10

Please open Anki, go to Tools → Add-ons, take a screenshot of your installed add-ons, and paste it below:
imagen

Error message (if any)

If you've received an error message, please copy and paste it between the backticks below:

Error
Un complemento que has instalado ha fallado al cargarse. Si los problemas persisten, por favor ve a Herramientas> Menú de complementos o deshabilita este complemento.

Mientras cargando '⁨Cloze Overlapper for Anki 21⁩':
⁨Traceback (most recent call last):
  File "aqt.addons", line 239, in loadAddons
  File "C:\Users\Khonkhortisan\AppData\Roaming\Anki2\addons21\109531687\__init__.py", line 123, in <module>
    initializeAddon()
  File "C:\Users\Khonkhortisan\AppData\Roaming\Anki2\addons21\109531687\__init__.py", line 109, in initializeAddon
    from .sched import initializeScheduler
  File "C:\Users\Khonkhortisan\AppData\Roaming\Anki2\addons21\109531687\sched.py", line 41, in <module>
    from anki.sched import Scheduler as SchedulerV1
ModuleNotFoundError: No module named 'anki.sched'
#from anki.sched import Scheduler as SchedulerV1

#if ANKI20:
#    SCHEDULERS = (SchedulerV1, )
#else:
#    from anki.schedv2 import Scheduler as SchedulerV2
#    SCHEDULERS = (SchedulerV1, SchedulerV2)
from anki.scheduler.v3 import Scheduler as SchedulerV3
SCHEDULERS = (SchedulerV3, )
Error 
Se ha producido un error. Por favor inicia la Anki manteniendo presionadas ples teclas Mayús y la flecha hacia abajo, lo que desactivará temporalmente los extensiones que tienes instaladas. 
Si este error persiste sólo cuando tienes las extensiones activadas, utiliza Herramientas > Menú de Extensiones para deshabilitar alguna extensión y reinicia el Anki, repitiendo este proceso hasta que descubras qué extensión en concreto es la que causa el problema 
Cuando hayas descubierto la extensión que causaba el problema, por favor informa de esto a [sitio de soporte de extensiones](https://forums.ankiweb.net/c/add-ons/11). 
Información de depuración:
Anki 23.10 (1f6938d7) Python 3.9.15 Qt 6.5.2 PyQt 6.5.2
Platform: Windows-10-10.0.19045
Flags: frz=True ao=True sv=3
Add-ons, last update check: 2023-09-23 17:19:24
Complementos posiblemente implicados: ⁨Cloze Overlapper for Anki 21Caught exception:
Traceback (most recent call last):
  File "aqt.progress", line 118, in handler
  File "aqt.main", line 217, in on_window_init
  File "aqt.main", line 264, in setupProfileAfterWebviewsLoaded
  File "aqt.main", line 316, in setupProfile
  File "aqt.main", line 495, in loadProfile
  File "_aqt.hooks", line 4016, in __call__
  File "anki.hooks", line 34, in runHook
  File "C:\Users\Khonkhortisan\AppData\Roaming\Anki2\addons21\109531687\__init__.py", line 114, in delayedInit
    initializeScheduler()
  File "C:\Users\Khonkhortisan\AppData\Roaming\Anki2\addons21\109531687\sched.py", line 119, in initializeScheduler
    scheduler._burySiblings, myBurySiblings, "around")
AttributeError: type object 'Scheduler' has no attribute '_burySiblings'
def initializeScheduler():
    
#    for scheduler in SCHEDULERS:
#        scheduler._burySiblings = wrap(
#            #scheduler._burySiblings, myBurySiblings, "around")

?

@khonkhortisan khonkhortisan added the bug Something isn't working label Sep 25, 2023
@zjosua
Copy link
Contributor

zjosua commented Sep 26, 2023

The code for the v1 and v2 scheduler was removed in ankitects/anki@558c754, and v3 does not support the legacy functions.

I tried monkey patching to v3's Scheduler.bury_cards, but it only gets called when cards are buried manually.

What I tried:

from typing import Sequence

import anki
from anki import version
from anki.cards import Card, CardId
from anki.consts import QUEUE_TYPE_NEW, QUEUE_TYPE_REV
from anki.hooks import wrap
from anki.utils import ids2str, int_time
from aqt import gui_hooks, mw

from .libaddon.platform import ANKI20
from .template import checkModel

anki21 = version.startswith("2.1.")

if ANKI20:
    from anki.sched import Scheduler as SchedulerV1

    SCHEDULERS = (SchedulerV1,)
elif anki21:
    from anki.schedv2 import Scheduler as SchedulerV2

    SCHEDULERS = (SchedulerV1, SchedulerV2)
else:  # new version scheme, starting with 23.10
    from anki.scheduler.v3 import Scheduler as SchedulerV3

    SCHEDULERS = (SchedulerV3,)
.
.
.
.
def my_bury_cards_v3(
    self: SchedulerV3, ids: Sequence[CardId], manual: bool, _old
) -> anki.collection_pb2.OpChangesWithCount:
    """Skip sibling burying for our note type if so configured"""
    if manual:
        return _old(self, ids, manual)
    sched_conf = mw.col.conf["olcloze"].get("sched", None)
    if not sched_conf:
        return _old(self, ids, manual)
    override_new, override_review, bury_full = sched_conf
    to_bury = []
    for id in ids:
        card = Card(self.col, id)
        card.load()
        if checkModel(card.note_type(), fields=False, notify=False):
            if card.queue == QUEUE_TYPE_REV and override_review:
                continue
            elif card.queue == QUEUE_TYPE_NEW and override_new:
                continue
        to_bury.append(id)
    return _old(self, to_bury, manual)


def initializeScheduler():
    for scheduler in SCHEDULERS:
        if scheduler.version == 3:
            scheduler.bury_cards = wrap(
                scheduler.bury_cards, my_bury_cards_v3, "around"
            )
        else:
            scheduler._burySiblings = wrap(
                scheduler._burySiblings, myBurySiblings, "around"
            )

@zjosua
Copy link
Contributor

zjosua commented Sep 27, 2023

According to the FAQs, "It is no longer possible to selectively replace parts of the scheduler's code ("monkey patching"), so some add-ons may not be practical to port without significant effort."

@khonkhortisan
Copy link
Author

khonkhortisan commented Sep 29, 2023

So just disable rescheduling, do one cloze card per note per day, and call it good? Tell people to put it in its own deck that doesn't bury siblings?
__init__.py

    #from .sched import initializeScheduler
    from .reviewer import initializeReviewer

    def delayedInit():
        initializeModels()
        #initializeScheduler()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants