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

Class Segment

tools/python/openlr/quality.py:109–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107 return common_len / (common_len + diff_len)
108
109class Segment:
110 class NoGoldenPathError(ValueError):
111 pass
112
113 def __init__(self, segment_id, golden_route, matched_route, ignored):
114 if not golden_route and not ignored:
115 raise NoGoldenPathError(
116 "segment {} does not have a corresponding golden route"
117 "and is not marked"
118 .format(segment_id)
119 )
120 self.segment_id = segment_id
121 self.golden_route = golden_route
122 self.matched_route = matched_route or []
123 self.ignored = ignored
124
125 def __repr__(self):
126 return 'Segment({})'.format(self.segment_id)
127
128 def as_tuple(self):
129 return self.segment_id, self.matched_route, self.golden_route
130
131def parse_route(route):
132 if not route:

Callers 2

parse_segmentsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected