PySport / kloppy

kloppy: standardizing soccer tracking- and event data
https://kloppy.pysport.org
BSD 3-Clause "New" or "Revised" License
362 stars 59 forks source link

Incorrect Wyscout v2 test data? #234

Closed probberechts closed 10 months ago

probberechts commented 10 months ago

The structure of the list of player and team objects in the test files differs from what is defined in the API docs of the Wyscout v2 API.

Specifically, there is an additional level in the official API docs:

"teams": {
    "3166": {
        "team": { <-- this is not in the test file
            "area": {},
            "category": "default",
            "children": [],
            "city": "Bologna",
            "gender": "male",
            "gsmId": 1249,
            "name": "Bologna",
            "officialName": "Bologna FC 1909",
            "type": "club",
            "wyId": 3166
        }
   }
}

I don't have access to the API, so it could also be that the docs are incorrect.

JanVanHaaren commented 10 months ago

Good catch. I don't have access to the Wyscout V2 match events endpoint either, but the response of the V2 match formations endpoint has an additional team level so this might well be a mistake in the test file.

"teams": {
    "1612": {
        "team": {
            "wyId": 1612,
            "name": "Liverpool",
            "officialName": "Liverpool FC",
            "city": "Liverpool",
            "area": {
                "id": 826,
                "alpha2code": "EN",
                "alpha3code": "XEN",
                "name": "England"
            },
            "type": "club",
            "category": "default",
            "gender": "male",
            "children": [
                ...
            ]
        }
    },
    "1631": {
        "team": {
            "wyId": 1631,
            "name": "Leicester City",
            "officialName": "Leicester City FC",
            "city": "Leicester",
            "area": {
                "id": 826,
                "alpha2code": "EN",
                "alpha3code": "XEN",
                "name": "England"
            },
            "type": "club",
            "category": "default",
            "gender": "male",
            "children": [
                ...
            ]
        }
    }
}