ML-KULeuven / socceraction

Convert soccer event stream data to SPADL and value player actions using VAEP or xT
MIT License
579 stars 133 forks source link

WhoScored Parser Not Working DateTime Error #474

Closed raaghule closed 1 year ago

raaghule commented 1 year ago

Hi, The WhoScored Parser is not working as expected because the dates have been changed to Swahilli from English and the dataframe is not able to process the dates. image image

probberechts commented 1 year ago

I do not understand where this error would come from. The WhoScored parser expects a %Y-%m-%dT%H:%M:%S datetime format, not the format that is mentioned in the error message.

https://github.com/ML-KULeuven/socceraction/blob/8f9cf3fc2df37a6f64287ccdc5625286e5245ef9/socceraction/data/opta/parsers/whoscored.py#L113-L115

Could it be that you are using the soccerdata package and that the error is raised by soccerdata instead of socceraction? If that is the issue, upgrading soccerdata might fix your issue. See https://github.com/probberechts/soccerdata/issues/126

If it is not related to soccerdata, could you provide the full stack trace of the error and the JSON file that you try to parse?

raaghule commented 1 year ago

I found the reason for the error. It is related to the fix . WhoScored uses Mac and Maa to denote March. The dictionary for Swahilli fix contains only Maa. I have fixed it in my local and it works like a charm. We need to map 'Mac' and 'Maa' to 'Mar'.

probberechts commented 1 year ago

Ok, thanks. Are you sure it also uses 'Maa' for March? To me it seems like it always use 'Mac' and that there is simply a typo in the current mapping.