Skip to content

Commit

Permalink
Use new cleaned2inferred_section_list interface
Browse files Browse the repository at this point in the history
  • Loading branch information
TTalex committed Oct 2, 2023
1 parent 6cdf8e6 commit 1fea161
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions utils/db_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,5 @@ def query_segments_crossing_endpoints(poly_region_start, poly_region_end):
# Fetches sensed_mode for each section in a list
# sections format example: [{'section': ObjectId('648d02b227fd2bb6635414a0'), 'user_id': UUID('6d7edf29-8b3f-451b-8d66-984cb8dd8906')}]
def query_inferred_sections_modes(sections):
mode_by_section_id = {}
for section in sections:
matching_inferred_section = esds.cleaned2inferred_section(section.get('user_id'), section.get('section'))
if matching_inferred_section is None:
mode_by_section_id[str(section.get('section'))] = ecwm.PredictedModeTypes.UNKNOWN
else:
mode_by_section_id[str(section.get('section'))] = matching_inferred_section.data.sensed_mode # PredictedModeTypes
return mode_by_section_id
return esds.cleaned2inferred_section_list(sections)

0 comments on commit 1fea161

Please sign in to comment.