Match() defines its distance attribute as float and code elsewhere assumes that it is a float.
e.g., from compute_cutting_points()
if abs(m.distance - distance_epsilon) < cutting_thresh:
cutting_points.append(CuttingPoint(i))
however, in orsm'.py the function _parse_leg() (inner function of parse_osrm_json()) constructs Match objects with distance=None. this is both a mypy error and can cause an error in functions like compute_cutting_points()
discussed with @nreinicke and decided to change the None to float('infinity')
Match()
defines itsdistance
attribute asfloat
and code elsewhere assumes that it is afloat
. e.g., fromcompute_cutting_points()
however, in
orsm'.py
the function_parse_leg()
(inner function ofparse_osrm_json()
) constructsMatch
objects withdistance=None
. this is both amypy
error and can cause an error in functions likecompute_cutting_points()
discussed with @nreinicke and decided to change the
None
tofloat('infinity')