Syntrex commited on
Commit
e376786
·
verified ·
1 Parent(s): 5ada8b2

Update engine/live_game_engine.py

Browse files
Files changed (1) hide show
  1. engine/live_game_engine.py +9 -0
engine/live_game_engine.py CHANGED
@@ -27,6 +27,15 @@ def _safe_float(value: Any) -> float | None:
27
  except Exception:
28
  return None
29
 
 
 
 
 
 
 
 
 
 
30
 
31
  def _extract_latest_savant_pitch_metrics(savant_feed: dict[str, Any]) -> dict[str, Any]:
32
  """
 
27
  except Exception:
28
  return None
29
 
30
+ def _first_non_null(*values):
31
+ for value in values:
32
+ if value is None:
33
+ continue
34
+ text = str(value).strip().lower()
35
+ if text in {"", "nan", "none"}:
36
+ continue
37
+ return value
38
+ return None
39
 
40
  def _extract_latest_savant_pitch_metrics(savant_feed: dict[str, Any]) -> dict[str, Any]:
41
  """