We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 51ebab1 commit 3b8cfc6Copy full SHA for 3b8cfc6
src/track_linearization/core.py
@@ -872,11 +872,9 @@ def project_1d_to_2d(
872
np.cumsum(edge_lengths[:-1] + gaps)
873
]) # shape (n_edges,)
874
875
- # --- vectorised lookup -----------------------------------------------------
876
idx = np.searchsorted(cumulative, linear_position, side="right") - 1
877
idx = np.clip(idx, 0, n_edges-1) # clamp to valid edge index
878
879
- # handle NaNs early so they don't pollute math
880
nan_mask = ~np.isfinite(linear_position)
881
idx[nan_mask] = 0 # dummy index, will overwrite later
882
0 commit comments