Skip to content

Commit

Permalink
Handle having no AI bird matches for a sighting
Browse files Browse the repository at this point in the history
  • Loading branch information
jhansche committed Nov 12, 2023
1 parent 5981244 commit 0e46b1d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion birdbuddy/sightings.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def sighting_finishing_strategies(
# Match sightings to highest confidence
for m, item in matches.items():
if (
m in s.match_tokens
item and m in s.match_tokens
and item["confidence"] >= confidence_threshold
and item["type"] == "BIRD"
):
Expand Down Expand Up @@ -251,6 +251,7 @@ def highest_confidence_matches(self) -> dict[str, dict[str, any]]:
i["matchToken"]: max(
(ii for ii in i["items"] if ii["type"] == "BIRD"),
key=lambda x: x["confidence"],
default=None,
)
for i in token.get("reportItems", [])
}
Expand Down

0 comments on commit 0e46b1d

Please sign in to comment.