Soccer#
Soccer relies on the following parameterized features:
Extensions of the BaseFeature
class to be specific to soccer pitches.
The features are all parameterized by the basic characteristics of a soccer
pitch. A user can manually specify their own pitch parameters in the
SoccerPitch
class that will adjust the placement of these features, however
the features themselves will be consistent across all soccer surfaces.
@author: Ross Drucker
- class sportypy._feature_classes.soccer.BaseSoccerFeature(pitch_length=0.0, pitch_width=0.0, feature_radius=0.0, feature_thickness=0.0, feature_units='ft', *args, **kwargs)#
An extension of the
BaseFeature
class for soccer features.The following attributes are specific to soccer features only. For more information on inherited attributes, please see the
BaseFeature
class definition. The default values are provided to ensure that the feature can at least be created.- pitch_length#
The length of the pitch in TV view. The default is
0.0
- Type:
float
- pitch_width#
The width of the pitch in TV view. The default is
0.0
- Type:
float
- feature_radius#
The radius needed to draw the feature. This may not be needed for all features. The default is
0.0
- Type:
float
- feature_thickness#
The thickness with which to draw the feature. This is normally given as the horizontal width of the feature in TV view, however it may be used to specify other thicknesses as needed. The default is
0.0
- Type:
float
- field_units#
The units with which the feature is drawn. The default is
"ft"
- Type:
str
- class sportypy._feature_classes.soccer.CenterCircle(pitch_length=0.0, pitch_width=0.0, feature_radius=0.0, feature_thickness=0.0, feature_units='ft', *args, **kwargs)#
The center circle on the pitch.
The given radius should be to the outside of the circle.
- class sportypy._feature_classes.soccer.CenterMark(pitch_length=0.0, pitch_width=0.0, feature_radius=0.0, feature_thickness=0.0, feature_units='ft', *args, **kwargs)#
The center mark on the pitch.
This is where the kickoffs for each half, as well as following any goal, are taken
- class sportypy._feature_classes.soccer.CornerArc(pitch_length=0.0, pitch_width=0.0, feature_radius=0.0, feature_thickness=0.0, feature_units='ft', *args, **kwargs)#
The arc in each corner of the pitch.
These are quarter-circles located where the touchline meets the goal line
- class sportypy._feature_classes.soccer.CornerDefensiveMark(is_touchline=False, is_goal_line=False, depth=0.0, separation_from_line=0.0, *args, **kwargs)#
The corner defensive marks.
These are optional marks on the pitch, located 9.15 m (10 yd) from the corner of the pitch. Defenders should be beyond these marks (either more towards the goal or more towards the halfway line) during corner kicks
- is_touchline#
Whether or not the corner defensive mark is along the touchline
- Type:
bool
- is_goal_line#
Whether or not the corner defensive mark is along the goal line
- Type:
bool
- depth#
The depth (in any direction) of the defensive marks beyond the goal line or touchline
- Type:
float
- separation_from_line#
The distance from the exterior edge of the goal line to the interior edge of the defensive mark
- Type:
float
- class sportypy._feature_classes.soccer.Goal(goal_width=0.0, goal_depth=0.0, *args, **kwargs)#
The goal.
The goals located beyond each goal line.
- goal_width#
The interior distance between the goal posts
- Type:
float
- goal_depth#
The depth of the goal from the back edge of the goal line
- Type:
float
- class sportypy._feature_classes.soccer.GoalBox(box_length=0.0, goal_width=0.0, goal_post_to_box_edge=0.0, *args, **kwargs)#
The goal box.
This is usually the 5.5 m (6 yd) box, but may be parameterized
- box_length#
The length of the goal box in TV view. This is the smaller of the two boxes, and is usually 5.5 m (6 yards) from the back edge of the goal line
- Type:
float
- half_box_width#
Half the width of the goal box
- Type:
float
- class sportypy._feature_classes.soccer.GoalLine(pitch_length=0.0, pitch_width=0.0, feature_radius=0.0, feature_thickness=0.0, feature_units='ft', *args, **kwargs)#
The goal line of the pitch, aka the endlines.
These are the lines that run the full width of the pitch. The ball must completely cross the goal line to score a goal
- class sportypy._feature_classes.soccer.HalfPitch(pitch_length=0.0, pitch_width=0.0, feature_radius=0.0, feature_thickness=0.0, feature_units='ft', *args, **kwargs)#
One half, either the offensive or defensive half, of the pitch.
This allows each half to take on its own color and be plotted independently, but the halves may take the same color so they look symmetrical
- class sportypy._feature_classes.soccer.HalfwayLine(pitch_length=0.0, pitch_width=0.0, feature_radius=0.0, feature_thickness=0.0, feature_units='ft', *args, **kwargs)#
The halfway line of the pitch, aka the midfield line or center line.
This is the line that run the full width of the pitch
- class sportypy._feature_classes.soccer.PenaltyBox(box_length=0.0, penalty_mark_dist=0.0, goal_width=0.0, goal_post_to_box_edge=0.0, *args, **kwargs)#
The penalty box.
This is usually the 16.5 m (18 yd) box, but may be parameterized
- box_length#
The length of the penalty box in TV view. This is the larger of the two boxes, and is usually 16.5 m (18 yards) from the back edge of the goal line
- Type:
float
- half_box_width#
Half the width of the penalty box
- Type:
float
- penalty_mark_dist#
The distance from the back edge of the goal line to the center of the penalty mark
- Type:
float
- class sportypy._feature_classes.soccer.PenaltyMark(pitch_length=0.0, pitch_width=0.0, feature_radius=0.0, feature_thickness=0.0, feature_units='ft', *args, **kwargs)#
The penalty mark.
This is the center point for arc of the penalty box, as well as where any penalty kick is taken
- class sportypy._feature_classes.soccer.PitchApron(pitch_apron_touchline=0.0, pitch_apron_goal_line=0.0, goal_depth=0.0, *args, **kwargs)#
The apron of the pitch beyond the touchline and goal line.
This is to allow a more accurate representation of the pitch, as no ads are allowed within a certain distance of the exterior edge of the touchline and goal line
- class sportypy._feature_classes.soccer.PitchConstraint(pitch_length=0.0, pitch_width=0.0, feature_radius=0.0, feature_thickness=0.0, feature_units='ft', *args, **kwargs)#
The constraint around the interior edge of the pitch’s boundary lines.
This confines all interior features to be constrained inside the pitch, as well as any interior plots.
- class sportypy._feature_classes.soccer.Touchline(pitch_length=0.0, pitch_width=0.0, feature_radius=0.0, feature_thickness=0.0, feature_units='ft', *args, **kwargs)#
The touchline of the pitch, aka the sideline.
These are the lines that run the full length of the pitch