Source Siblings Bury Cousins addon (support thread)

Addon link and description: https://ankiweb.net/shared/info/1916261072

The source code can be found at AnkiAddons/sibilingsbury at master · evandrocoan/AnkiAddons · GitHub

burysiblingsexample

You may also be interested in these other bury addons:

  1. DA KILL Z0NE - automatic suspension and burying for time-wasting cards
  2. Bury Cousins (related cards that aren’t siblings)
  3. defer/postpone card for later today (selective bury and unbury)
  4. Bury After Fail Streak
  5. BuryNdays
  6. add and bury show later
  7. bury future new sibs
  8. Bury related notes
  9. Delay siblings
3 Likes

I’m using windows 11 on a Surface Pro 11. The add-on seemed to work well for a while, but now it runs quickly, and then switches to the last open app. The dialog flashes, with the number of cards that are supposed to be buried, but they are not being buried. I tried disabling all other add ons, restarting the computer, and reinstalling anki.

Any other tips?

Recording2024-08-05055025-ezgif.com-video-to-gif-converter

I already saw anki automatically closing the Ok dialog once, but I am not sure why it happened and it just stopped on its own. I may try a few different things, but first, let’s take some basic information.

I am using Anki for QT 5 with Windows 10(Version <U+2068>24.06.3 (d678e393)<U+2069> Python 3.9.18 Qt 5.15.2 PyQt 5.15.5, and I cannot reproduce it (for now). Which version of Anki are you using (menu Help -> About)?

Can you start Anki via the anki-console.bat file in C:\Users\user\AppData\Local\Programs\Anki (or C:\Program Files\Anki)?

With this, a separate console window will appear so we can see additional additional information. By default, no information is printed to the console.

Go to the menu Tools -> Addons and Select Source Siblings Bury Addon and click on View Files. Then open the file __init__.py. You need to edit the add-on around line 90 to enable logs. Change this:

def debug(*args, **kwargs):
    # print(*args, **kwargs)
    pass

Change to (removing # ):

def debug(*args, **kwargs):
    print(*args, **kwargs)
    pass

Then, restart Anki by opening it with the anki-console.bat. Then, run the bury command. This will print a lot of information to the console about how the add-on is working.

Information about your card sort field and the cards/notes IDs will be provided. You can revise this information to see if anything is sensitive and redact it, then send me the console output by private message for more privacy.

Today, I added some new cards to my collection. Something like this happened to me today, but it stopped when I started studying.

Steps:

  1. I tried to bury (but nothing happened)
  2. Then, start studying (no need to answer the card, just open some card)
  3. After, go to the main screen and try to bury cards again, it worked again

The message closing up automatically you should be able to fix changing this around line 200:

    aqt.mw.taskman.run_on_main(
        lambda: [aqt.mw.progress.finish(), end()]
    )

to

    aqt.mw.taskman.run_on_main( lambda: aqt.mw.progress.finish() )
    time.sleep(1)  # avoid progress.finish() closing the show_warning() some times
    aqt.mw.taskman.run_on_main( lambda: end() )

I made the changes as recommended and it seems to be working. But I’ll have to try again tomorrow once I have some cards to study again. If not working, then I’ll send the log.

Thanks for working on this.

This continues to work as expected. I did have one episode like you described where I had to start the review process to get it to work.

I have a hopefully quick question.

Would it be possible to combine this addon with the delay siblings addon?
https://ankiweb.net/shared/info/1369579727

I would love for the delays in this addon to happen during the review, and having the length of the delay vary depending on how well you know the card would be golden!

My python knowledge so far is limited to just a little more than py4e.com.

if not done first, I plan on trying myself, but I so far understand too little of the coding in anki addons.

This continues to work as expected. I did have one episode like you described where I had to start the review process to get it to work.

Thanks for reporting back. I updated the add-on to version 1.0.2 with the fix you patched manually. I still do not know the solution for the problem where you have to start the review process for the add-on to work, as it did not happen to me again.

The problem happened because this add-on depended on the anki function mw.col._backend.get_queued_cards, which did not return any cards when this add-on tried to call it. However, after starting the review process as you did, the function mw.col._backend.get_queued_cards started working correctly, so this add-on could be used to bury cards.

It seems this add-on is missing to call some other setup function anki requires before calling the function mw.col._backend.get_queued_cards, but we have to wait until I can reproduce this problem again so I can investigate further.

Would it be possible to combine this add-on with the delay siblings add-on?

It should be possible, but I did not test it. Both add-ons promise to do the same thing, so there is no need to use both. According to the other add-on description:

When reviewing a card, reschedule its siblings if they are set to appear too soon. Consider that you’ve got two cards on a single note, “A → B” and “B → A”, that both have an interval of several months but are due to appear days apart. If you review one of these cards today, your reviewing the sibling card tomorrow will make little sense and will just waste your time. This script is especially useful when you are reviewing a deck that hasn’t been touched for a while and thus has a lot of siblings due simultaneously.

This add-on also does this; however, it does not work the same way. Instead of rescheduling cards, this add-on buries them until they are suitable for review. I would say the main difference is that this add-on should be much less harmful to the collection than the other add-on because we can easily undo anything this add-on did just by unburying cards this add-on buried today.

While developing this add-on, I also tried to reschedule cards instead of burying them so my anki stats (Future Due graph) would show how many cards I would review more accurately. However, after experimenting, it did not seem simple to fix because, depending on how the current card is scheduled, it may conflict again with its sibling card soon.

Then, I decided to keep burying the card until it was no longer required, as it is less error-prone and should be less harmful to my collection. However, I did not know about that add-on until now and have not experimented with it. It may be a good alternative to this add-on, and the sibling clashes that come with rescheduling cards may not be as harmful as I think.

Remarks on how this add-on works:

  1. This add-on supports marking different notes as siblings, while the other add-on supports rescheduling siblings of the same note type as anki built-in sibling detection does.
  2. When prioritizing siblings, this add-on gives preference for cards on their correct scheduled due date. For example, if a card Y has a sibling X that was studied five days ago, and X is scheduled to be studied again in two days, Y and all siblings will be buried until the X card is studied and is scheduled to be studied over a week. I did this way so I could always focus on studying one card until it was mature enough, and only then, study other cards.
  3. When marking different notes as siblings by the Sibling field, the cards are prioritized by their model ID and, on a tie, by the note ID. This way, specific Models have preferences over others, and on a tie, I am not sure how Anki model IDs are created and if new notes have higher note IDs than older notes. So far, I do not see a problem with this sorting.

I am not entirely sure how the other add-on handles card prioritization, so I cannot comment on whether it is better or worse than this add-on. You can stop using this add-on anytime, and no cards in your collection will have their scheduled date affected other than being late for review due to how long they were buried.

if not done first, I plan on trying myself, but I so far understand too little of the coding in anki add-ons.

I recommend using the CrowdAnki add-on (https://ankiweb.net/shared/info/1788670778) to save your collection externally so you can recover more easily in case of problems.

My tip is to work with burying cards (as this add-on does) instead of rescheduling (as the other add-on) because if you do something wrong, you do not mess with your collection scheduling, other than burying a card for longer than it should have. While experimenting with rescheduling in this add-on (it is removed now as today it only buries cards), I had to revert my collection to a seven-day-old backup because the code was not right and messed up my collection in a way I did not like. I had to revert to a seven days old backup because it took me seven days to figure out things were going wrong. It was pretty painful because I had added new cards in between, and I had to re-add them because they did not exist seven days ago.

1 Like

Thanks for the detailed explanation. A lot of it is over my head, but I think others will find it helpful.

So does this/your add on bury cards for multiple days like the other one? My understanding is that depending on the filed used, it would bury for 1 day or bury for 1 week.
I like the other one because it picks a delay date that based on how frequently the siblings are being seen. So for instance, if it’s due after 6 months, it will present it a few days later instead of the next day?
but as you said, it’s limited in that it buries siblings and doesn’t use the fields like this one does.

The other one is also nice in that it works automatically while studying, so I don’t have to remember to run it at the beginning of the day.

1 Like

So does this/your add on bury cards for multiple days like the other one? My understanding is that depending on the filed used, it would bury for 1 day or bury for 1 week.

I was referring to the Sibling field because it is closer to the other add-on. But yes, if you only use the Source field, your card is only buried for a single day unless tomorrow, when there are also more conflicting cards.

The Sibling field does not work much differently from the Source field because both bury cards. The difference is that the Sibling field will keep burying until there is at least a seven-day difference between “siblings”.

The other one is also nice in that it works automatically while studying, so I don’t have to remember to run it at the beginning of the day.

This add-on originally worked by burying cards like this, but when studing, I would never know how many cards were actually remaining until I finished studying. So, by burying everything at once, I know at the beginning of the day how many cards I have to study today.

I like the other one because it picks a delay date that based on how frequently the siblings are being seen.

I am unsure how the other addon does this delay date based on frequency.

So for instance, if it’s due after 6 months, it will present it a few days later instead of the next day?

If a card is due in six months, this addon does nothing with it, but if a card is due today (and was scheduled for today, six months ago), this card may take a few more days to show up if it is detected other siblings with higher preference also due near today (up to seven days).

1 Like

got it. If I’m understanding you,

Up to 7 days. So the 6 month example - card last seen 6 months ago and is due, it will be buried for 7 days.

if it was last seen a few days ago, then it will be buried for a day.

Yes, the automatic burying versus manually burying is a personal preference. I am happy not knowing the total amount of cards and would prefer the other behavior. but I am happy that you shared what you did.

Up to 7 days. So the 6 month example - card last seen 6 months ago and is due, it will be buried for 7 days.

only if it has a sibling also due near it (in a 7 days range, before or after today), to ensure you do not see them in the same week.

if it was last seen a few days ago, then it will be buried for a day.

I am not sure if I understand this part. But if a sibling of the card was seen a few days ago (up to 7 seven days), the current card will be buried for some days (up to 7 days) until there are no siblings due near it (in 7 days range, so you do not see any siblings in the same week).

I don’t know about / understand the anki function calls you are discussing. No need to explain. I’ll figure it out later if/when I get more time for it.

I just took another look at the thread because I noticed that it happened again. This time it happened after I made some major changes to my studies. I unsuspended a couple thousand cards spread into 2 decks. I renamed the decks a couple of times, and made some filtered decks. I’m not sure if any of these actions could cause the glitch

1 Like

Today, I finally forgot to run the bury command and was not fond of it much. Then, I just released version 1.1.0, adding a configuration to enable automatic burying cards:

1 Like

Sorry that you forgot. But of course am pleased to hear that you found the time to make the change. Life for me has gotten busier as I signed up for my boards to take this November. So a lot more Anki, but a lot less python learning.

I wonder if it would be easy/worthwhile to add a feature to allow automatically running the script on cards/pairs studied on remote devices after syncing. That would prevent the need for manual syncing completely I think.

This could be done by running anki on a server and having the server sync daily after your “next day starts” configuration. However, it would require a dedicated computer to be powered on and running anki at the synchronization time.

Would you let your computer powered on while continuously running anki if such an “addon” feature were added, or would you consider renting a cheap Linux virtual machine and letting it run this “anki server”?

I just noticed a had a space after one of my words in the sibling field in one card, and no space in the other. So I meant for them to match but overlooked it. Not sure how easy that would be, but I was wondering if you could easily do a .strip() function to remove the whitespaces on the sides.

Thanks for reporting it. I released a new version to fix it. I thought it was already striping spaces as I was calling strip_html, but it was not.

2 Likes

Hi @addons_zz , I trust you are keeping well.

Started using Source Siblings Bury (Cousins) recently and was hoping the following could be considered in future updates;

  • Ability to randomize the burying duration between a specified range say 1-5 (Just like what’s allowed with Set Due Date). This way Source or Sibling groups get dispersed and the likelihood of them showing up in the same day reduced.
  • Ability to allow for a certain maximum number of group-cards (Sibling or Sources) to be reviewed together. Beyond this number, the rest of cards of the giving group is then dispersed in the future (as described above).

I’d appreciate a feedback if possible. Thank you…

Hi. To randomize the burying duration between a specified range, say 1-5, should be simple. This other I am not sure how it should work:

Ability to allow for a certain maximum number of group-cards …

Can you give an example of how its should work?

You have a group of sibling cards (related flashcards), and you want to review a maximum of N cards from the group together during one session. Any remaining cards from the group are dispersed into future sessions.

Example Scenario:

  1. Group of Sibling Cards:

    • Group: {Card A1, Card A2, Card A3, Card A4, Card A5}
    • Maximum allowed cards to review together: N = 3
  2. Scheduling Rules:

    • The first N = 3 cards from the group are scheduled for review together: {Card A1, Card A2, Card A3}.
    • The remaining cards are dispersed into future review sessions: {Card A4, Card A5}.
  3. Outcome:

    • Session 1: {Card A1, Card A2, Card A3}
    • Session 2: {Card A4, Card B1, Card C1}
    • Session 3: {Card A5, Card D1, Card E1}

It pretty much as you’ve described.

Scenario
All cards of a defined group {Card A1, Card A2, Card A3, Card A4, Card A5} were due during Session 1 (along with other cards).
Before add-on is run

  • Session 1: {Card A1, Card A2, Card A3, Card A4, Card A5, Card F1, Card C2, Card J1, Card D4, Card C5}

After add-on is run (N=3)

  • Session 1: {Card A1, Card A4, Card A5, Card F1, Card C2, Card J1, Card D4, Card C5}

The rest of the group ( {Card A2, Card A3}) is dispersed over a given range (eg 1-5).

The question to ask during the running of the add-on is; “How many of a given group’s cards are scheduled to be reviewed in this Session?”. If the answer is greater than N=3 then the same operation is carried out as described above: Keep a maximum of 3 from the group and disperse the rest randomly over a range (eg 1-5)