Basketball#
Basketball relies on the following parameterized features:
Extensions of the BaseFeature class to be specific to basketball courts.
The features are all parameterized by the basic characteristics of a basketball
court. A user can manually specify their own court parameters in the
BasketballCourt
class that will adjust the placement of these features,
however the features themselves will be consistent across all basketball
surfaces.
@author: Ross Drucker
- class sportypy._feature_classes.basketball.Backboard(backboard_width=0.0, *args, **kwargs)#
The backboard.
This is the backing onto which the basket ring (created separately) is affixed
- backboard_thickness#
The thickness of the backboard. This is the observed thickness when viewing the court from a bird’s eye view
- Type:
float
- class sportypy._feature_classes.basketball.BaseBasketballFeature(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 basketball features.The following attributes are specific to basketball 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.basketball.BasketRing(basket_ring_connector_extension=0.0, backboard_face_to_basket_center=0.0, basket_ring_connector_width=0.0, *args, **kwargs)#
The basket ring.
The hoop through which the ball must pass to score points for a team
- basket_ring_connector_extension#
The distance the basket ring’s connector extends from the backboard into the free-throw lane
- Type:
float
- basket_ring_connector_width#
The dimension of the piece of the basket ring that connects the backboard to the basket ring. When viewing the court in TV view from above, this is the dimension in the
y
direction- Type:
float
- backboard_to_center_of_basket#
The distance from the front face of the backboard to the center of the basket ring
- Type:
float
- class sportypy._feature_classes.basketball.CenterCircleFill(court_length=0.0, court_width=0.0, feature_radius=0.0, feature_thickness=0.0, feature_units='ft', *args, **kwargs)#
The interior of the circle(s) at the center of the court.
The circle is where the tip-off to the game takes place. The supplied radius (radii) should be measured to the outside of the circle, with the center of the circle(s) being the exact center of the court
- class sportypy._feature_classes.basketball.CenterCircleOutline(court_length=0.0, court_width=0.0, feature_radius=0.0, feature_thickness=0.0, feature_units='ft', *args, **kwargs)#
The outline of the circle(s) at the center of the court.
The circle is where the tip-off to the game takes place. The supplied radius (radii) should be measured to the outside of the circle, with the center of the circle(s) being the exact center of the court
- class sportypy._feature_classes.basketball.CourtApron(court_apron_endline=0.0, court_apron_sideline=0.0, court_apron_to_boundary=0.0, *args, **kwargs)#
The apron of the court.
The apron is the colored boundary around the exterior of some courts. If no such colored boundary exists, this should take the same color as the court floor
- court_apron_endline#
The thickness of the court’s apron beyond the endline
- Type:
float
- court_apron_sideline#
The thickness of the court’s apron beyond the sideline
- Type:
float
- court_apron_to_boundary#
The distance from the inner edge of the court apron to the outer edge of the court’s boundary line (sideline and endline will be spaced the same)
- Type:
float
- class sportypy._feature_classes.basketball.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.basketball.DivisionLine(division_line_extension=0.0, *args, **kwargs)#
The center court line.
This line divides the court in half, and is sometimes referred to as the time line or half-court line. The center of this line goes through the y axis, with half of the line lying in a team’s offensive half court and the other half in their defensive half court
- division_line_extension#
The distance that the division line extends beyond the sidelines. This may be omitted if the value is 0
- Type:
float
- class sportypy._feature_classes.basketball.Endline(court_length=0.0, court_width=0.0, feature_radius=0.0, feature_thickness=0.0, feature_units='ft', *args, **kwargs)#
The endlines on the basketball court.
These are sometimes referred to as the baselines, and are located beyond each basket
- class sportypy._feature_classes.basketball.FreeThrowCircleFill(court_length=0.0, court_width=0.0, feature_radius=0.0, feature_thickness=0.0, feature_units='ft', *args, **kwargs)#
The filling of the area where a play shoots a free-throw.
The provided radius should be to the free-throw circle’s exterior
- class sportypy._feature_classes.basketball.FreeThrowCircleOutline(court_length=0.0, court_width=0.0, feature_radius=0.0, feature_thickness=0.0, feature_units='ft', *args, **kwargs)#
The outline of the circle around the free-throw line.
The provided radius should be to the free-throw circle’s exterior
- class sportypy._feature_classes.basketball.FreeThrowCircleOutlineDash(start_angle=0.0, end_angle=0.0, *args, **kwargs)#
The dashed part of a free-throw circle.
The dashes may not be required by certain leagues
- start_angle#
The angle at which the dash should start
- Type:
float
- end_angle#
The angle at which the dash should end
- Type:
float
- class sportypy._feature_classes.basketball.FreeThrowLaneBoundary(lane_length=0.0, lane_width=0.0, *args, **kwargs)#
The outline of the free-throw lane.
The lines providing the boundary to the free-throw lane. When a player is shooting a free-throw, all non-shooting players must be outside of this boundary. NOTE: This does not include lane space markings (blocks), which will be created via the
LaneSpaceMark
class- lane_length#
The distance from the inner edge of the baseline to the center-court side of the free-throw lane in TV view
- Type:
float
- lane_width#
The distance from the outer edges of the free-throw lane when viewing the court in TV view
- Type:
float
- class sportypy._feature_classes.basketball.HalfCourt(court_length=0.0, court_width=0.0, feature_radius=0.0, feature_thickness=0.0, feature_units='ft', *args, **kwargs)#
One half of the basketball court.
Each half court spans from the inner edge of the baseline to the center of the division line, and serves as the base layer of the court
- class sportypy._feature_classes.basketball.InboundingLine(in_play_ext=0.0, out_of_bounds_ext=0.0, drawn_direction='', *args, **kwargs)#
The inbounding line.
This is where the ball is inbounded on the sideline when necessary. Lines drawn on the top of the court should be drawn in a top-down direction, and lines on the bottom of the court should be drawn in the bottom-up direction
- in_play_ext#
The distance into the court (measured from the inner edge of the sideline) that the inbounding lines protrude into the court
- Type:
float
- out_of_bounds_ext#
The distance away from the court (measured from the outer edge of the sideline) that the inbounding lines protrude away the court
- Type:
float
- drawn_direction#
The direction in which to draw the inbounding line
- Type:
str
- class sportypy._feature_classes.basketball.LaneSpaceMark(mark_depth=0.0, *args, **kwargs)#
The lane space marks (blocks) on the outside of the free-throw lane.
These are the marks where non-shooting players stand during free-throws. Players may not cross these lines before the ball touches the rim on the shot attempt
- mark_depth#
The length (measurement in the baseline-to-free-throw-line direction) of lane space marks (blocks) of the free-throw lane
- Type:
float
- class sportypy._feature_classes.basketball.LowerDefensiveBoxMark(extension=0.0, drawn_direction='', *args, **kwargs)#
The lower defensive box marks.
The lower defensive box is an imaginary box on the court extending from the lines on the baseline to the lines inside the painted area. This box helps determine when a block/charge call should take place, as an offensive player is entitled to move outside of (and subsequently enter) this box without contact
- extension#
The distance that the lower defensive box markings extend from their anchor points
- Type:
float
- drawn_direction#
The direction in which to draw the lower defensive box mark
- Type:
str
- class sportypy._feature_classes.basketball.Net(court_length=0.0, court_width=0.0, feature_radius=0.0, feature_thickness=0.0, feature_units='ft', *args, **kwargs)#
The net.
To make the basket ring easier to identify, the nets will also be drawn onto the plot. They will typically be white in color, although this is customizable for a user
- class sportypy._feature_classes.basketball.PaintedArea(lane_length=0.0, lane_width=0.0, paint_margin=0.0, *args, **kwargs)#
The painted area inside the free-throw lane.
The painted area may have a margin from the interior edges of the free throw lane, although this margin will default to 0.0 units
- lane_length#
The distance from the inner edge of the baseline to the center-court side of the free-throw lane in TV view
- Type:
float
- lane_width#
The distance from the outer edges of the free-throw lane when viewing the court in TV view
- Type:
float
- paint_margin#
The distance from the painted area of the lane to the lane boundary lines
- Type:
float
- class sportypy._feature_classes.basketball.RestrictedArc(backboard_to_center_of_basket=0.0, *args, **kwargs)#
The restricted arc.
The arc located in the free-throw lane. The interior radius should be specified for this feature.
- backboard_to_center_of_basket#
The distance from the front face of the backboard to the center of the basket ring
- Type:
float
- class sportypy._feature_classes.basketball.Sideline(court_length=0.0, court_width=0.0, feature_radius=0.0, feature_thickness=0.0, feature_units='ft', *args, **kwargs)#
The sidelines on the basketball court.
These are the lines that run the full length of the court, typically with the team bench areas and substitution areas on their exterior
- class sportypy._feature_classes.basketball.SubstitutionLine(substitution_line_width=0.0, drawn_direction='', *args, **kwargs)#
The substitution lines.
This is where players checking into the game wait for a stoppage. Lines drawn on the top of the court should be drawn in a top-down direction, and lines on the bottom of the court should be drawn in the bottom-up direction
- substitution_line_width#
The distance away from the court (measured from the outer edge of the sideline) that the substitution lines protrude away from the court
- Type:
float
- drawn_direction#
The direction in which to draw the substitution line
- Type:
str
- class sportypy._feature_classes.basketball.TeamBenchLine(extension=0.0, drawn_direction='', *args, **kwargs)#
The team bench line.
Players not in the game must stay within these lines unless moving to the substitution area (see SubstitutionLine class)
- extension#
The distance that the team bench line extends from its anchor point
- Type:
float
- drawn_direction#
The direction in which to draw the lower defensive box mark
- Type:
str
- class sportypy._feature_classes.basketball.ThreePointLine(basket_center_to_baseline=0.0, basket_center_to_corner_three=0.0, *args, **kwargs)#
The line separating two-point range from three-point range.
Made shots inside this line count for two points, and made shots from beyond this line are worth three points. The radius of the feature should be to its exterior
- basket_center_to_baseline#
The distance from the center of the basket ring to the inner edge of the baseline
- Type:
float
- basket_center_to_corner_three#
The distance from the center of the basket ring to the outer edge of the three-point line in the corner
- Type:
float
- class sportypy._feature_classes.basketball.TwoPointRange(basket_center_to_baseline=0.0, basket_center_to_corner_three=0.0, *args, **kwargs)#
The area of the court where made baskets are worth two points.
This is the area enclosed by the three-point line’s outer edge and the baseline’s inner edge
- basket_center_to_baseline#
The distance from the center of the basket ring to the inner edge of the baseline
- Type:
float
- basket_center_to_corner_three#
The distance from the center of the basket ring to the outer edge of the three-point line in the corner
- Type:
float