Wikipedia:Bots/Requests for approval/KadaneBot 2
- 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 Withdrawn by operator.
Operator: Kadane (talk · contribs · SUL · edit count · logs · page moves · block log · rights log · ANI search)
Time filed: 23:18, Tuesday, March 12, 2019 (UTC)
Automatic, Supervised, or Manual: automatic
Programming language(s): Python
Source code available: https://github.com/Kadane-Wikipedia/Rnd_Merge/blob/master/rnd_sub.py
Function overview: Replaces Template:Round and Template:Decimals with Template:Rnd if a parameter change is needed.
Links to relevant discussions (where appropriate): Wikipedia:Templates_for_discussion/Log/2018_December_14#Template:Rnd, Wikipedia:Bot_requests#Convert_of_rounding_templates
Edit period(s): One time run
Estimated number of pages affected: 21,900 (est) 7300 (est)
Exclusion compliant (Yes/No): No
Already has a bot flag (Yes/No): Yes
Function details: Bot replaces Template:Round and Template:Decimals with Template:Rnd iff:
The template name is Round or Decimals and The template's 2nd argument is not a decimal number or The template's doesn't have a second argument
- Let NAME be the name of the template
- Let NUMBER represent the number to be rounded (first parameter)
- Let PLACE represent the number of places to round to (second parameter)
- If NUMBER is not defined log an invalid template to User:KadaneBot/ErrorLog
- If NAME is Round and PLACE is undefined and NUMBER has 1 decimal place:
- Change NAME to Rnd
- Change PLACE to 1
- IF NAME is Round and PLACE is undefined and NUMBER has 2 decimal places:
- Change NAME to Rnd
- Change PLACE to 2
- IF NAME is Round and PLACE is undefined and NUMBER has 3 or more decimal places:
- Change NAME to Rnd
- Change PLACE to 3
- IF NAME is Round and PLACE is undefined and NUMBER is a wiki markup expression:
- Change NAME to Rnd
- Change PLACE to 3
Note: This can result in a change of appearance, but does not result in loss of precision
- IF NAME is Round or NAME is Decimals and PLACE is not an integer:
- Cast Place to an integer and save
Discussion
edit- For an analysis of the visible differences between the templates, see User:DannyS712/sandbox2. I will be separately filing a BRFA to fix the cases that do not meet the criteria above. --DannyS712 (talk) 23:20, 12 March 2019 (UTC)[reply]
- Approved for trial (50 edits). Please provide a link to the relevant contributions and/or diffs when the trial is complete. @DannyS712: Please link to the diffs (or at least a perm link to the contribs; if unsure, ask me how) when done. --TheSandDoctor Talk 20:08, 13 March 2019 (UTC)[reply]
- @TheSandDoctor: thanks, but this isn't my bot @Kadane --DannyS712 (talk) 20:17, 13 March 2019 (UTC)[reply]
- @DannyS712: Saw you in the discussion section and had a brain fart. Kadane please see the above. --TheSandDoctor Talk 20:20, 13 March 2019 (UTC)[reply]
- @TheSandDoctor: thanks, but this isn't my bot @Kadane --DannyS712 (talk) 20:17, 13 March 2019 (UTC)[reply]
- Trial complete. @TheSandDoctor: - Trial is complete. User:KadaneBot/Task2/TrialEdits contains a summary of all edits and a perm link to the diff as requested. All edits went fine. Decided to change edit summary after 6 edits to be more descriptive. Other than that no hiccups. Kadane (talk) 23:20, 13 March 2019 (UTC)[reply]
- There appears to be a problem with this edit as it is going the wrong way changing {{round}} to {{rnd}} where as the closing statement on the merge says to merge to {{round}}. Keith D (talk) 00:00, 14 March 2019 (UTC)[reply]
- @Keith D: They are all being changed to rnd, which will then be renamed to round, since rnd has by far the most transclusions --DannyS712 (talk) 00:05, 14 March 2019 (UTC)[reply]
- @Kadane: I should have noticed this earlier, but this would change what is displayed, both in terms of format and in terms of precision, which should not be the case.
{{round|1.2304}}
results in 1, while converting it to rnd results in 1. To replace this properly would require{{rnd|1.2304|2}}
(creating 1.23), and this is just one example. Until we can sort out the specifics of each case where the replacement changes the display, this task should not be approved. --DannyS712 (talk) 00:16, 14 March 2019 (UTC)[reply]- And, furthermore, once the task is approved, it should only change the pages that need a change to the parameters. {{3x|p}}ery (talk) 00:20, 14 March 2019 (UTC)[reply]
- There appears to be a problem with this edit as it is going the wrong way changing {{round}} to {{rnd}} where as the closing statement on the merge says to merge to {{round}}. Keith D (talk) 00:00, 14 March 2019 (UTC)[reply]
After the merge, aren't Template:Round and Template:Rnd going to point the the same place? This bot task therefore seems unnecessary to me. {{3x|p}}ery (talk) 00:13, 14 March 2019 (UTC)[reply]
- @Pppery, Keith D, and DannyS712: - Template:Round and Template:Decimals are being renamed to Template:Rnd because doing it the other way would result in 250k+ edits. This can be changed if you want.
- Regarding the WP:COSMETICBOT comment, in my opinion this is much like substituting templates so they can be deleted. Exceptions are regularly made for that purpose according to the page you linked. Although I am not opposed to just changing templates that need a parameter change.
- Regarding this bot being a useless task, I am not sure I am following why you think that.
- It might be a good idea to ping the requester to answer your questions as well. @Zackmann08: Kadane (talk) 01:08, 14 March 2019 (UTC)[reply]
- @Kadane: My comment about the bot being useless was based on a misconception of the task as only doing the edits I defined as cosmetic. I have no objection to the edits that actually do change parameters. Substing templates so that they can be deleted isn't cosmetic (the template will be deleted, at which point the pre-subst edit will display a redlinked template). Bypassing template redirects, which is what this task will end up having done after the merge is complete, is. Although I do realize, as a non-BAG-member, that I'm probably speaking as if I have much more authority than I actually do. {{3x|p}}ery (talk) 01:13, 14 March 2019 (UTC)[reply]
- @Pppery: - I appreciate your comments BAG or not. I am a newbie when it comes to Wikipedia, I just happen to know how to program. So a change of algorithm is needed to ensure that only edits with parameter changes are needed. I suppose I would need another trial for that? Kadane (talk) 01:19, 14 March 2019 (UTC)[reply]
- @Kadane: I have started drafting rules for changing the parameters - see below, and feel free to help write the rest --DannyS712 (talk) 01:39, 14 March 2019 (UTC)[reply]
- @DannyS712: I wasn't sure if you would mind if I edited that or not. I wrote out a quick requirement on User:KadaneBot/Task2/ReplacementRules. I think that covers all differences. Thoughts? Kadane (talk) 01:43, 14 March 2019 (UTC)[reply]
- @Kadane: Sorry, looking at all of these numbers for the templates is giving me a headache. I won't be on tomorrow, but I'll try to get back to you. I noticed, however, that you only cover Round->Rnd, not Decimal->Rnd. --DannyS712 (talk) 02:16, 14 March 2019 (UTC)[reply]
- @DannyS712: I wasn't sure if you would mind if I edited that or not. I wrote out a quick requirement on User:KadaneBot/Task2/ReplacementRules. I think that covers all differences. Thoughts? Kadane (talk) 01:43, 14 March 2019 (UTC)[reply]
- @Kadane: I have started drafting rules for changing the parameters - see below, and feel free to help write the rest --DannyS712 (talk) 01:39, 14 March 2019 (UTC)[reply]
- @Pppery: - I appreciate your comments BAG or not. I am a newbie when it comes to Wikipedia, I just happen to know how to program. So a change of algorithm is needed to ensure that only edits with parameter changes are needed. I suppose I would need another trial for that? Kadane (talk) 01:19, 14 March 2019 (UTC)[reply]
- @Kadane: My comment about the bot being useless was based on a misconception of the task as only doing the edits I defined as cosmetic. I have no objection to the edits that actually do change parameters. Substing templates so that they can be deleted isn't cosmetic (the template will be deleted, at which point the pre-subst edit will display a redlinked template). Bypassing template redirects, which is what this task will end up having done after the merge is complete, is. Although I do realize, as a non-BAG-member, that I'm probably speaking as if I have much more authority than I actually do. {{3x|p}}ery (talk) 01:13, 14 March 2019 (UTC)[reply]
- @Kadane: I agree --DannyS712 (talk) 22:34, 15 March 2019 (UTC)[reply]
- @TheSandDoctor: - I have changed the functional details of the bot to reflect the comments here. The bot will only make changes when a parameter change is needed now. Can I please get another trial? Kadane (talk) 23:55, 15 March 2019 (UTC)[reply]
{{BAG assistance needed}} {{3x|p}}ery (talk) 13:50, 16 March 2019 (UTC)[reply]
- @Pppery: {{BAG assistance needed}} is generally only added to a request after seven days has passed. It is intended for use if urgent attention is needed or if a request is being neglected (wait seven days first). As far as I can tell, neither was the case here (nothing urgent and only 3 days since my last comment here). Just an FYI for the future, that's all --TheSandDoctor Talk 16:48, 16 March 2019 (UTC)[reply]
Approved for extended trial (50 edits). Please provide a link to the relevant contributions and/or diffs when the trial is complete. @Kadane: As with the last trial, please post the results here. --TheSandDoctor Talk 16:48, 16 March 2019 (UTC)[reply]
- Trial complete. - Most of the articles I had in my estimated number were being counted because {{Round}} was included in another template. With that being said all replacements are finished and I was unable to complete 50 edits. All diffs are listed at User:KadaneBot/Task2/TrialEdits. I will withdraw this later today Kadane (talk) 20:12, 16 March 2019 (UTC)[reply]
Withdrawn by operator. Not enough edits to justify bot task. All parameters changed within trial. Kadane (talk) 06:04, 17 March 2019 (UTC)[reply]
Withdrawn by operator. As indicated per the above. Based on this, closing this request. --TheSandDoctor Talk 06:17, 17 March 2019 (UTC)[reply]
Replacement rules
editP1 = first parameter, P2 = second
- Round -> Rnd
- IF a P2 is provided, AND it is <= 0, no change is needed
- IF a P2 is provided, AND it is >0
- IF the P2 <= the number of digits after the decimal point in P1, no change is needed
- IF the P2 > the number of digits after the decimal point in P1, CHANGE IS NEEDED - P2 should be set to equal the number of digits after the decimal point in P1
- Decimals -> Rnd
- IF a second parameter is provided, AND it is <= 0, no change is needed
- 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.