-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace scipy #2071
Replace scipy #2071
Conversation
for lane_id, l_lps in self._lanepoints_by_lane_id.items() | ||
} | ||
|
||
self._lanepoints_kd_tree_by_edge_id = { | ||
edge_id: LanePoints._build_kd_tree(l_lps) | ||
self._lp_points_by_edge_id = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not using an optimization for the points in lanes and edges seems like it could be reasonable. A tree might cost more than it gains unless there are a large amount of points.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, there is a slight performance gain on smaller maps from this change.
) -> List[LinkedLanePoint]: | ||
x = point.as_np_array[:2] | ||
dists = np.sqrt(np.sum((points - x) ** 2, axis=1)) | ||
closest_indices = np.argsort(dists)[:k] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is where I am slightly concerned. The naive approach will break down with large numbers of lanepoints.
Have you looked to see what the performance difference is on the minicity scenario?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is roughly the same as using the KDTree. The frame time seems to be dominated by other things.
Removes
scipy
as a core package dependency and makes progress towards #1981.