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

Function parse_segments

tools/python/openlr/quality.py:169–182  ·  view source on GitHub ↗
(tree, limit)

Source from the content-addressed store, hash-verified

167 print('\n'.join(assessed_ignored_seg_but_matched))
168
169def parse_segments(tree, limit):
170 segments = islice(tree.findall('.//Segment'), limit)
171 for s in segments:
172 ignored_tag = s.find('Ignored')
173 ignored = s.find('Ignored') is not None and ignored_tag.text == 'true'
174 segment_id = int(s.find('.//ReportSegmentID').text)
175 matched_route = parse_route(s.find('Route'))
176 # TODO(mgsergio): This is a temproraty hack. All untouched segments
177 # within limit are considered accurate, so golden path should be equal
178 # matched path.
179 golden_route = parse_route(s.find('GoldenRoute'))
180 if not golden_route and not ignored:
181 continue
182 yield Segment(segment_id, golden_route, matched_route, ignored)
183
184def calculate(tree):
185 result = {}

Callers 1

calculateFunction · 0.85

Calls 3

parse_routeFunction · 0.85
SegmentClass · 0.70
findMethod · 0.45

Tested by

no test coverage detected