Lua-Modules icon indicating copy to clipboard operation
Lua-Modules copied to clipboard

feat(ratings): Chess Ratings implementation

Open Hesketh2 opened this issue 10 months ago • 5 comments

Summary

This is the hardest part given my little coding knowledge, I know though that this cannot be scrapped otherwise we would get a lot of pushback from editors. My Goal is to make it work only.

To explain: Chess has an official ELO Rating for players from FIDE, which is crucial detail in Chess as they used to determine seedings, qualification, and many other stuff (different vs things lilke SC2/AoE ELOs) the goal for ratings is to make it display on several place of the wiki including

  • Infobox Player, as a rating section tracked automatically based on the FIDE ID inputs image

  • a Graph Section on the page invoked manually, outside infobox image

  • Participants Table, by picking up the stored rating values from Infobox player. Done through Custom Player display image

Ratings are stored through a Data namespace pages, Editors found a Github tool that allows them to fetch these datas easily, on top of that these ratings only updates once per month https://liquipedia.net/chess/Special:PrefixIndex?prefix=Data%3ARatings&namespace=0

The Hard Part, I didnt made this I just ported it over and its all a non-header module, I've tried make a header but it ends up erroring out specially when replacing the p. with a proper name. So I need you guys help (A LOT)

How important is this

#5484 #5483 #5482 all depends on this. I really dont want to scrap this and I think theres a way to make it through.

https://liquipedia.net/chess/Module:Ratings https://liquipedia.net/chess/Module:Ratings_Period https://liquipedia.net/chess/Module:Ratings_Storage

Side Note

First version is without header because any changes I made breaks all three immediately (#5484 #5483 #5482)

Graph is not called on any module it just invoked manually on the page (but still relies on the ratings module to work to gain data), so maybe that one doesnt need to be put on git?

https://liquipedia.net/chess/Module:Ratings_Graph

Hesketh2 avatar Mar 15 '25 07:03 Hesketh2

a lot of work will happen throughout the weeks, so bear with my little to none knowledge of coding logic 😅

Hesketh2 avatar Mar 16 '25 19:03 Hesketh2

I would recommend asking Rado to fetch did data in the backend instead. We already do this basically for AoE.

Rathoz avatar Mar 17 '25 08:03 Rathoz

I would recommend asking Rado to fetch did data in the backend instead. We already do this basically for AoE.

I'm confuse about this so basically what you mean is for all these to be kicked away and put into a gitlab file (since backend was mentioned) instead? image

Hesketh2 avatar Mar 17 '25 10:03 Hesketh2

I would recommend asking Rado to fetch did data in the backend instead. We already do this basically for AoE.

I'm confuse about this so basically what you mean is for all these to be kicked away and put into a gitlab file (since backend was mentioned) instead? image

No, it wouldn't be put in a gitlab file. Instead the data would be automatically retrieved, either cached or on demand, from the 3rd party source. Similar to automatic currency conversion or the matches for dota2.

But those files would be deleted and not needed to be maintained

Rathoz avatar Mar 17 '25 11:03 Rathoz

I would recommend asking Rado to fetch did data in the backend instead. We already do this basically for AoE.

I'm confuse about this so basically what you mean is for all these to be kicked away and put into a gitlab file (since backend was mentioned) instead?

No, it wouldn't be put in a gitlab file. Instead the data would be automatically retrieved, either cached or on demand, from the 3rd party source. Similar to automatic currency conversion or the matches for dota2.

But those files would be deleted and not needed to be maintained

I'll ask rado if thats possible, If I recalled the way these ratings are currently put on wiki is through an unofficial python FIDE scraper here https://github.com/cassiofb-dev/fide-api (by parsing FIDE's site), since FIDE has an API but doesnt provide one for player ratings. Not sure if this will falls under the 3rd party source you mentioned

The other way is only a TXT/XML files that drops once per month here https://ratings.fide.com/download_lists.phtml

There might not be an automatic way for this providing no official API for it and only options are Scrape or use text files to make one

Hesketh2 avatar Mar 17 '25 11:03 Hesketh2

Closed due to the current way of ratings implementation under Data namespace has been stopped (robbie hasnt updated that in a while and im not sure of the methods previously used)

Hesketh2 avatar May 08 '25 12:05 Hesketh2