MCPcopy Create free account
hub / github.com/comaps/comaps / calculate

Function calculate

tools/python/openlr/quality.py:184–200  ·  view source on GitHub ↗
(tree)

Source from the content-addressed store, hash-verified

182 yield Segment(segment_id, golden_route, matched_route, ignored)
183
184def calculate(tree):
185 result = {}
186 for s in parse_segments(tree, args.limit):
187 try:
188 # An ignored segment is estimated as 1 if matched_route
189 # is empty and as zero otherwise.
190 if s.ignored:
191 result[s.segment_id] = 1.0 if len(s.matched_route) == 0 else 0.0
192 else:
193 result[s.segment_id] = common_part(s.golden_route, s.matched_route)
194 except AssertionError:
195 print('Something is wrong with segment {}'.format(s))
196 raise
197 except Segment.NoGoldenPathError:
198 raise
199
200 return result
201
202def merge(src, dst):
203 # If segment was ignored it does not have a golden route.

Callers 4

quality.pyFile · 0.85
image_filter_lutMethod · 0.85
image_filterMethod · 0.85
operator ()Method · 0.85

Calls 3

parse_segmentsFunction · 0.85
common_partFunction · 0.85
formatMethod · 0.80

Tested by

no test coverage detected