Module talk:ATP rankings

Pre-launch thoughts
Couple things I've noticed in my initial tests, I'll split them into subsections to discuss as I find them. Primefac (talk) 12:37, 31 July 2023 (UTC)

Regions
Some of the ATP Tour navigational boxes are for regions (Africa, Europe, etc) - is it worth trying to get a mega-list? My initial thought is no and to send those to TFD for further discussion. Primefac (talk) 12:15, 31 July 2023 (UTC)

Disambiguation
How to deal with disambiguations, for example Ben Shelton should be Ben Shelton (tennis). Module:Disambiguation will tell us if it is a dab, but won't necessarily give us the correct disambiguator to append - though I would put money on (tennis) being used in 99% of cases).Primefac (talk) 12:15, 31 July 2023 (UTC)
 * For disambiguation pages, I feel like the best approach would be something like:
 * If there is a manual mapping for the name to a page, use that. We can have a new JSON module where those are stored.
 * If the undisambiguated title is not a disambig page, use that.
 * If a page with (tennis) exists, use that.
 * If there is a disambiguation page (as opposed to no page at all), don't link to it but add a category so manual mappings (see step 1) can be added.
 * Taavi (talk!) 12:24, 31 July 2023 (UTC)
 * Good idea. Categorise the dab names and make a list (either in a separate json or just a submodule) to perform a swap. This will also work for pages where the name on the PDF might not match up exactly with the Wikipedia name and allow us to override if necessary. Primefac (talk) 12:40, 31 July 2023 (UTC)
 * I think I can call this ✅; the disambiguation code seems to work for  and I've added in some tracking for pages that don't quite meet the planned-for exceptions (i.e. "forced disambiguation"). Primefac (talk) 11:53, 1 August 2023 (UTC)
 * There's a possibility that I'll move Module:ATP rankings/data/disambiguation to a JSON page and change it's format slightly to allow using the same file to override a country for a specific player when that's needed (Russia and Belarus for example). Taavi (talk!) 18:24, 1 August 2023 (UTC)
 * That's a really good idea, actually. Primefac (talk) 18:25, 1 August 2023 (UTC)

Bad country returned
I know the module currently doesn't have the Russian and Belarusian players since that aspect of the bot/json is still under construction, but we should probably have a non-Lua warning given if the code is given incorrectly (like I keep doing with  instead of   for Spain). Primefac (talk) 12:37, 31 July 2023 (UTC)


 * Is Special:Diff/1168253505 what you had in mind? Taavi (talk!) 18:22, 1 August 2023 (UTC)
 * Something like that. I know there are a few folk who are not overly thrilled with the idea of error messages showing up as script errors but honestly gigantic red messages to me get the point across more than sufficiently. Primefac (talk) 18:24, 1 August 2023 (UTC)

RUS and BUL
, any update on the Russia/Bulgaria no-country issue? Primefac (talk) 08:29, 17 August 2023 (UTC)


 * @Primefac Thanks for the ping, sorry for the delay. I went ahead and converted the old disambiguation module to Module:ATP rankings/data/overrides.json and added support for a new  field to manually override countries for specific players. Note that the country data is parsed by the bot during the weekly imports, not when the template is rendered, so changes aren't instant. Taavi (talk!) 15:18, 3 September 2023 (UTC)
 * Yeah, figured any changes made would have to wait for the next round of updates. Primefac (talk) 16:35, 3 September 2023 (UTC)
 * So just to check, we should manually input the overrides for the RUS/BUL players, and the bot will match that with the current rank. Yes? Primefac (talk) 12:52, 20 September 2023 (UTC)
 * Yes, that's correct. Taavi (talk!) 19:41, 23 September 2023 (UTC)