Tennis#
Tennis relies on the following parameterized features:
Extensions of the BaseFeature
class to be specific to tennis courts.
The features are all parameterized by the basic characteristics of a tennis
court. A user can manually specify their own court parameters in the
TennisCourt
class that will adjust the placement of these features, however
the features themselves will be consistent across all tennis surfaces.
@author: Ross Drucker
- class sportypy._feature_classes.tennis.Backcourt(singles_width=0.0, serviceline_distance=0.0, *args, **kwargs)#
The backcourt of the tennis court.
This is the area behind the serviceline on the court, contained within the singles sidelines
- singles_width#
The width of a singles court in the court’s specified units
- Type:
float
- serviceline_distance#
The distance from the net to the outer edge of the serviceline (the line in front of which a serve must land)
- Type:
float
- class sportypy._feature_classes.tennis.BaseTennisFeature(court_length=0.0, court_width=0.0, feature_radius=0.0, feature_thickness=0.0, feature_units='ft', *args, **kwargs)#
An extension of the
BaseFeature
class for tennis features.The following attributes are specific to tennis 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.- court_length#
The length of the court in TV view. The default is
0.0
- Type:
float
- court_width#
The width of the court 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.tennis.Baseline(court_length=0.0, court_width=0.0, feature_radius=0.0, feature_thickness=0.0, feature_units='ft', *args, **kwargs)#
The baseline of a tennis court.
These are the lines behind which a player will serve the ball. They span the entire width of the court
- class sportypy._feature_classes.tennis.CenterMark(center_mark_length=0.0, *args, **kwargs)#
The center mark on the baseline of the court.
This line identifies the center point of the baseline.
- center_mark_length#
The distance that the center mark on the baseline protrudes forward from its anchor point at the back edge of the baseline
- Type:
float
- class sportypy._feature_classes.tennis.CenterServiceline(center_serviceline_length=0.0, *args, **kwargs)#
The center serviceline on the court.
This line divides the service area into two parts: the ad court (left) and the deuce court (right)
- center_serviceline_length#
The length of the center serviceline
- Type:
float
- class sportypy._feature_classes.tennis.CourtApron(backstop_distance=0.0, sidestop_distance=0.0, *args, **kwargs)#
The boundary that surrounds the tennis court.
This is the backstop and the sidestop
- backstop_distance#
The distance from the back edge of the baseline to the barrier behind it in the court’s specified units
- Type:
float
- sidestop_distance#
The distance from the outer edge of the sideline to the barrier that runs parallel to it in the court’s specified units
- Type:
float
- class sportypy._feature_classes.tennis.CourtConstraint(court_length=0.0, court_width=0.0, feature_radius=0.0, feature_thickness=0.0, feature_units='ft', *args, **kwargs)#
The constraint around the interior edge of the court’s boundary lines.
This confines all interior features to be constrained inside the court, as well as any interior plots.
- class sportypy._feature_classes.tennis.DoublesAlley(court_length=0.0, court_width=0.0, feature_radius=0.0, feature_thickness=0.0, feature_units='ft', *args, **kwargs)#
The doubles alley on the tennis court.
This is the area between the singles and doubles sideline. It should run the entire length of the court
- class sportypy._feature_classes.tennis.FrontcourtHalf(singles_width=0.0, serviceline_distance=0.0, *args, **kwargs)#
One half of the frontcourt (either ad or deuce court).
The left-hand side of the court when facing the net from the nearest baseline is the ad court, and the right-hand side is the deuce court
- singles_width#
The width of a singles court in the court’s specified units
- Type:
float
- serviceline_distance#
The distance from the net to the outer edge of the serviceline (the line in front of which a serve must land)
- Type:
float
- class sportypy._feature_classes.tennis.Net(net_length=0.0, *args, **kwargs)#
The net on the tennis court.
This divides the court into two halves
- net_length#
The length of the net, from post to post, in the court’s specified units
- Type:
float
- class sportypy._feature_classes.tennis.ServiceLine(singles_width=0.0, *args, **kwargs)#
The serviceline on the court.
A serve must land between the net and this line on the proper side of the court to be considered legal and in play.
- singles_width#
The width of a singles court in the court’s specified units
- Type:
float
- class sportypy._feature_classes.tennis.Sideline(court_length=0.0, court_width=0.0, feature_radius=0.0, feature_thickness=0.0, feature_units='ft', *args, **kwargs)#
A sideline on a tennis court.
This may refer to either the singles or doubles sideline.