PySport / kloppy

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

UnboundLocalError: local variable 'player' referenced before assignment (skillcorner.py in tracking) #354

Open tmgf-lab opened 2 weeks ago

tmgf-lab commented 2 weeks ago

The error appears when I load local files and I do not use limit argument.

I've resolved the UnboundLocalError by initializing the player variable on line 96 and adding a condition on line 156 to ensure the variable is not empty before using it. While this prevents the error, I'm not sure if this fully addresses the root cause or if there are other edge cases or logic considerations I'm missing. I'd appreciate it if someone could review the fix and confirm if this is the correct approach or if there's a deeper issue that needs to be addressed.

Thank you!

UnravelSports commented 2 weeks ago

@tmgf-lab Any chance you could either create a Pull Request or add more details on what file, what version, and what changes you actually made, or create a minimal working example? It's impossible to know what you've done and what the error is without more info.