Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat : error messages for detections rejections #138 #190

Merged
merged 3 commits into from
Sep 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions scripts/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,10 +330,14 @@ def run_analysis(file):
for time_slot, entries in raw_detections.items():
log.info('%s-%s', time_slot, entries[0])
for entry in entries:
if entry[1] >= conf.getfloat('CONFIDENCE') and ((entry[0] in INCLUDE_LIST or len(INCLUDE_LIST) == 0)
and (entry[0] not in EXCLUDE_LIST or len(EXCLUDE_LIST) == 0)
and (entry[0] in PREDICTED_SPECIES_LIST
or len(PREDICTED_SPECIES_LIST) == 0)):
d = Detection(time_slot.split(';')[0], time_slot.split(';')[1], entry[0], entry[1])
confident_detections.append(d)
if entry[1] >= conf.getfloat('CONFIDENCE'):
if entry[0] not in INCLUDE_LIST and len(INCLUDE_LIST) != 0:
log.warning("Excluded as INCLUDE_LIST is active but this species is not in it: %s", entry[0])
elif entry[0] in EXCLUDE_LIST and len(EXCLUDE_LIST) != 0:
log.warning("Excluded as species in EXCLUDE_LIST: %s", entry[0])
elif entry[0] not in PREDICTED_SPECIES_LIST and len(PREDICTED_SPECIES_LIST) != 0:
log.warning("Excluded as below Species Occurrence Frequency Threshold: %s", entry[0])
else:
d = Detection(time_slot.split(';')[0], time_slot.split(';')[1], entry[0], entry[1])
confident_detections.append(d)
return confident_detections
Loading