pnxenopoulos / awpy

Python library to parse, analyze and visualize Counter-Strike 2 data
http://www.awpycs.com
MIT License
361 stars 56 forks source link

Fix issue with missing round_end events causing error #306

Closed billfreeman44 closed 4 months ago

billfreeman44 commented 5 months ago

Fixes ValueError: cannot convert NA to integer bug when LO3 happens in a server.

billfreeman44 commented 5 months ago

Dump of round_df before the error happens:

Screenshot 2024-01-27 213603 Screenshot 2024-01-27 213609

Logic here is to avoid having the round where round_num=2 (second row) in the screenshots here as a valid round. it is before the LO3 finishes. The best logic is just "toss everything before the first valid round" IMO.

billfreeman44 commented 5 months ago

I get this error when testing PydanticUserError:@validatorcannot be applied to instance methods though that particular error seems to happen without this change. I was on 433eeaa and an equivalent line there worked no problem.

pnxenopoulos commented 4 months ago

Thanks for finding this. I fixed the pydantic error you mentioned.

How do we determine a valid round? I suppose a valid round needs a round_end_official. But the last round of an match could have the same round_end and round_end_official. I guess if there are rounds after, that is our tell?

billfreeman44 commented 4 months ago

it is difficult. maybe this package could extract everything and then the user could use some kind of logic to throw away rounds? probably not ideal but i don't know.

pnxenopoulos commented 4 months ago

Believe I got a way to determine valid rounds in the awpy2 branch now, might require some more testing across more demos