Skip to content

ENH: Add option to smooth to nearest #275

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

Merged
merged 6 commits into from
Oct 15, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
FIX: Orders are hard
  • Loading branch information
larsoner committed Sep 24, 2019
commit 40412585aafe36d200cd1e9501b0d3ac0b58300f
4 changes: 2 additions & 2 deletions surfer/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,8 +597,8 @@ def _nearest(vertices, adj_mat):
_, _, sources = dijkstra(adj_mat, False, indices=vertices, min_only=True,
return_predecessors=True)
col = np.searchsorted(vertices, sources)
# ... then restore the original order.
col = np.argsort(order)[col]
# ... then get things back to the correct configuration.
col = order[col]
row = np.arange(len(col))
data = np.ones(len(col))
mat = sparse.coo_matrix((data, (row, col)))
Expand Down