theOehrly / Fast-F1

FastF1 is a python package for accessing and analyzing Formula 1 results, schedules, timing data and telemetry
https://docs.fastf1.dev
MIT License
2.54k stars 264 forks source link

Rename `visa_rb` key to `rb` #645

Closed Casper-Guo closed 3 weeks ago

Casper-Guo commented 1 month ago

Fixes #644

I am choosing to change the team colors dictionary rather than the team translate dictionary because visa rb is not how the team is represented in the data

theOehrly commented 3 weeks ago

I'll try to look at this soon. I vaguely remember that there was a reason why RB isn't just "rb" in the data. Not sure if this is still a problem or if I even remember correctly. I need to dig around and check.

Casper-Guo commented 3 weeks ago

I think I figured out the reason why.

If the key in the LEGACY_TEAM_COLOR dictionary is rb and the user input is visa rb, then there is no exact or partial match. This will cause the user input to be redirected to the fuzzy matching procedure. The closest match turns out to be sauber but the match ratio is below the minimum threshold. That causes a KeyError to be thrown

Casper-Guo commented 3 weeks ago

I can address the test failure later if these changes look more agreeable to you

theOehrly commented 3 weeks ago

I think everything is good now?