Wikipedia:Bots/Requests for approval/Dreamy Jazz Bot 4


 * The following discussion is an archived debate. Please do not modify it. To request review of this BRFA, please start a new section at WT:BRFA. The result of the discussion was

Dreamy Jazz Bot 4
Operator:

Time filed: 16:12, Saturday, May 9, 2020 (UTC)

Automatic, Supervised, or Manual: automatic

Programming language(s): Python (pywikibot)

Source code available:

Function overview: This bot will add to talk pages where their associated article is in a year of death category. If approved to do so, the bot would also auto assess the class using rules defined in function details.

Links to relevant discussions (where appropriate): Wikipedia talk:WikiProject Biography

Edit period(s): One time run initially, but I will probably rerun infrequently on talk pages the bot has not looked at before.

Estimated number of pages affected: Initially ~17,000

Exclusion compliant (Yes/No): Yes

Already has a bot flag (Yes/No): No

Function details: The bot, if approved, will generate a list of talk pages which have not been tagged with the WikiProject Biography template when their associated article is in one of the "year of death" type categories (a list of the categories I will use for this is at User:Dreamy Jazz/sandbox/3).

The bot could auto assess when it adds the WikiProject Biography template. There are two ways this can be done and the bot could be approved for any combination of the two: If an auto assess value is used for the class parameter, the auto parameter set to "inherit" when inheriting the class or "stub" when the second way is used. If no valid auto assess value is found, the bot simply does not add the class parameter.
 * The first way is using the rules at User:BU RoBOT/autoassess which in short auto assesses by inheriting the class from other projects. This is only done when all project templates have the same class rating. If there are differing class ratings or the inherited class is not one of the ones listed, the bot won't "inherit" the class.
 * The second way only is used when there are no project templates on the page with a defined class. If the said criterion is met, the bot looks for stub like templates on the article (any template in Category:Stub message templates). If one is present, the bot will auto assess the article as a stub.

My reasoning for auto assessment is that ~17,000 extra pages in Category:Unassessed biography articles would give lots of extra work to the editors who are working to reduce the size of the category. Although not all pages will be auto assessed, the auto assessment will help to reduce the extra work. Preferably, I would like the bot to use both methods, as I have seen both methods used by bots before.

If WikiProject Biography is already tagged on the talk page or the page is a redirect page, the bot will skip the talk page. If either the main shutoff or Task 4 shutoff page is deleted / non-empty the bot will stop running (and post a note to my talk page). The bot respects nobots (using pywikibot.Page.botMayEdit).

I have been using AWB to tag living people if the article is in Category:Living people. This is a relatively similar task, except there is no auto assessment and that the bot task is automatic (i.e. it's not just some search and replace rules in AWB with a human checking and pressing save). I have seen no opposition to adding the project template to lots of talk pages. I posted a note at Wikipedia talk:WikiProject Biography 3 days ago and have got no responses. I have filed the BRFA to allow more people to weigh in on this. Thanks. Dreamy Jazz talk to me &#124; my contributions 22:28, 9 May 2020 (UTC)

Discussion
I see no problem with a short trial to start things off to give people an idea of it "in action". Is it currently capable of auto-assessing, ? -- The SandDoctor Talk 23:33, 9 May 2020 (UTC)
 * , yes. Is the bot approved to use both methods to auto assess in the trial? Dreamy Jazz talk to me &#124; my contributions 09:24, 10 May 2020 (UTC)
 * Thanks for the response. Yes, it is . -- The SandDoctor Talk 16:06, 10 May 2020 (UTC)
 * Currently running the trial. Ran into one error so far which was due to the regex which splits up templates matching a shorter name even if this is not the full length of the template name (see 956182395 for the edit which alerted me to this bug). I have fixed this regex bug by using a positive lookahead and the bot correctly added the banner to the page after I restarted the bot (see 956185573). Dreamy Jazz talk to me &#124; my contributions 23:45, 11 May 2020 (UTC)
 * (50 edits) two more bugs found and fixed. First of these two was brought up because of the regex fix I did for the first issue. See 956186051 for the edit with the issue and 956189263 is the edit after the bug was fixed. The third was that I forgot to continue the loop (in python it means continue to the next item in the thing you are looping over) after detecting and logging the presence of a redirected talk page. The list of pages was generated a few days ago, so the page had been moved in that time. The bot's intended behaviour on coming across a redirected talk page is to log it as such and then move on without editing the talk page. I fixed the bug and the bot skipped editing the page after the fix was implemented. I plan to merge the script which generates the talk pages to edit with the bot before I restart the task, so further trial edits may be further spaced apart as the pages will also need to be found.
 * I think that should be all the problems/bugs ironed out, but I would be supportive of a second trial run to ensure that this is the case. Dreamy Jazz talk to me &#124; my contributions 00:36, 12 May 2020 (UTC)
 * Changed the auto parameter value when the second method is used from "stub_template" to "stub" as this is the correct value for this method in Template:WPBannerMeta/core. Dreamy Jazz talk to me &#124; my contributions 10:06, 12 May 2020 (UTC)


 * Don't know if you're still using it (you wrote above) but you don't need to use botMayEdit to check if the bot can edit, PWB automatically detects it upon save. You're better off wrapping the entire thing up in a try-except in some true EAFP-style Python scripting (also because PWB will sometimes raise errors out of nowhere). -- qedk ( t  愛  c ) 18:38, 18 May 2020 (UTC)
 * , thanks for this. I think I have already wrapped the code in a try-except block, but I will double check that. Happy editing, Dreamy Jazz talk to me &#124; my contributions 19:20, 18 May 2020 (UTC)
 * Primefac (talk) 18:12, 22 May 2020 (UTC)
 * The above discussion is preserved as an archive of the debate. Please do not modify it. To request review of this BRFA, please start a new section at WT:BRFA.