Open ProformAnalytics opened 3 years ago
Sorry for my absence for a while. I believe Period
shouldn't be identical over multiple matches. Current behaviour may result in mistakes when periods from different matches are mixed.
I'm not totally sure current code relies on id
attribute only equality check.
@bdagnino do you agree on changing the behaviour?
The
__eq__
method forPeriod
is currently implemented as a check of equality of theid
attributes. This makes sense as it makes it easy to compare between games, e.g. asking do these events from different games both happen in the first half?However, this also potentially introduces errors in the tests where we want to check that a
Period
is identical to what is expected. For example, intest_tracab.py
, the following assertion will pass for any value ofstart_timestamp
etc provided theid
is correctThis should be easy enough to fix, depending on how you guys think would be best to go about it?