Skip to content
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

Merged
merged 10 commits into from
Jun 28, 2023
Merged

Replace scipy #2071

merged 10 commits into from
Jun 28, 2023

Conversation

saulfield
Copy link
Contributor

Removes scipy as a core package dependency and makes progress towards #1981.

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 = {
Copy link
Collaborator

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.

Copy link
Contributor Author

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]
Copy link
Collaborator

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?

Copy link
Contributor Author

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.

@saulfield saulfield merged commit 487eeb1 into master Jun 28, 2023
@saulfield saulfield deleted the saul/replace-scipy branch June 28, 2023 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants