-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPORTEC] Resolved Referee Issue #371
Changes from 4 commits
deb071b
21b51c5
a427393
4c9410f
75e1efb
3e45ef9
44d2e7a
a541996
e12d22b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ | |
Iterable, | ||
) | ||
|
||
from .position import PositionType | ||
from .position import PositionType, RefereeType | ||
|
||
from ...utils import deprecated | ||
|
||
|
@@ -119,6 +119,25 @@ def __str__(self): | |
return self.value | ||
|
||
|
||
@dataclass(frozen=True) | ||
class Referee: | ||
referee_id: str | ||
name: str = None | ||
first_name: str = None | ||
last_name: str = None | ||
UnravelSports marked this conversation as resolved.
Show resolved
Hide resolved
|
||
role: Optional[RefereeType] = None | ||
|
||
@property | ||
def full_name(self): | ||
if self.name: | ||
return self.name | ||
if self.first_name or self.last_name: | ||
return f"{self.first_name} {self.last_name}" | ||
if self.role: | ||
return f"{self.role}_{self.referee_id}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For players, we use a lowercase string if the name is unknown, like |
||
return self.referee_id | ||
UnravelSports marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
@dataclass(frozen=True) | ||
class Player: | ||
""" | ||
|
@@ -1016,6 +1035,7 @@ class Metadata: | |
game_id: Optional[str] = None | ||
home_coach: Optional[str] = None | ||
away_coach: Optional[str] = None | ||
referees: Optional[List] = field(default_factory=list) | ||
attributes: Optional[Dict] = field(default_factory=dict, compare=False) | ||
|
||
def __post_init__(self): | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -92,3 +92,10 @@ def __str__(self): | |||||
@classmethod | ||||||
def unknown(cls) -> "PositionType": | ||||||
return cls.Unknown | ||||||
|
||||||
|
||||||
class RefereeType: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would probably just put this into |
||||||
VideoReferee = "Video Referee" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
Referee = "Referee" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They are all a referee, hence using
Suggested change
|
||||||
Assistant = "Assistant" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
FourthOfficial = "Fourth Official" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Referee" or "Official"? I don't have a strong preference but one reason to prefer "Official" is that it covers more roles (e.g., the fourth official).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't sure here either, but I will update it to Official.