|
37 | 37 | # Yakker merges pitch + hit observations; catcher throwbacks surface as a single contributing event, |
38 | 38 | # so require at least two event IDs (pitch + hit) when no pitch metrics accompany hit data. |
39 | 39 | MIN_CONTRIBUTING_EVENTS_FOR_HIT = 2 |
| 40 | +# Filter throwbacks based on low exit velocity (soft throws back to pitcher/catcher) |
40 | 41 | THROWBACK_MAX_EXIT_VELO = 65.0 |
41 | | -THROWBACK_MIN_ANGLE_DEG = 10.0 |
42 | | -THROWBACK_MAX_ANGLE_DEG = 20.0 |
43 | 42 |
|
44 | 43 | PayloadHook = Callable[[dict], Union[Awaitable[None], None]] |
45 | 44 |
|
@@ -69,15 +68,12 @@ def _is_valid(value: Optional[float]) -> bool: |
69 | 68 | def _looks_like_throwback(hit_data: dict) -> bool: |
70 | 69 | """Return True when the hit profile matches a soft throwback to the mound.""" |
71 | 70 | exit_velocity = hit_data.get("ExitSpeedMPH") |
72 | | - launch_angle = hit_data.get("AngleDegrees") |
73 | | - if not (_is_valid(exit_velocity) and _is_valid(launch_angle)): |
| 71 | + if not _is_valid(exit_velocity): |
74 | 72 | return False |
75 | 73 | exit_velocity = float(exit_velocity) |
76 | | - launch_angle = float(launch_angle) |
77 | | - return ( |
78 | | - exit_velocity < THROWBACK_MAX_EXIT_VELO |
79 | | - and THROWBACK_MIN_ANGLE_DEG <= launch_angle <= THROWBACK_MAX_ANGLE_DEG |
80 | | - ) |
| 74 | + # Filter throwbacks based solely on low exit velocity |
| 75 | + # Throwbacks are characterized by low exit velocity regardless of angle |
| 76 | + return exit_velocity < THROWBACK_MAX_EXIT_VELO |
81 | 77 |
|
82 | 78 |
|
83 | 79 | def _is_true_hit(hit_data: dict, pitch_data: dict, contributing_events: List[str]) -> bool: |
|
0 commit comments