Skip to content

Commit

Permalink
Merge pull request #64 from statsbomb/frames-none-type
Browse files Browse the repository at this point in the history
Add exception for none type frames
  • Loading branch information
scotty779 authored Jul 31, 2024
2 parents bf06ae9 + e2a8aa5 commit f619112
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setup(
name="statsbombpy",
version="1.13.0",
version="1.13.1",
description="easily stream StatsBomb data into Python",
long_description=README,
long_description_content_type="text/markdown",
Expand Down
9 changes: 5 additions & 4 deletions statsbombpy/sb.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,11 @@ def frames(
frames = _360_frames(match_id, creds)
for frame in frames:
if "distances_from_edge_of_visible_area" in frame:
for ff, d_from_vis_area in zip(
frame["freeze_frame"], frame["distances_from_edge_of_visible_area"]
):
ff["distance_from_edge_of_visible_area"] = d_from_vis_area["distance"]
if frame["distances_from_edge_of_visible_area"] is not None:
for ff, d_from_vis_area in zip(
frame["freeze_frame"], frame["distances_from_edge_of_visible_area"]
):
ff["distance_from_edge_of_visible_area"] = d_from_vis_area["distance"]
keys = ["event_uuid", "visible_area", "match_id", "freeze_frame"]
frames = [{key: frame[key] for key in keys} for frame in frames]
if fmt == "dataframe":
Expand Down

0 comments on commit f619112

Please sign in to comment.