You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(core): correct edge_map semantics to separate indices from labels
Fix the edge_map implementation to properly handle the abstraction between:
- Internal segment indices (0..E-1) used for array operations
- External edge labels (edge_id) used for user-facing API
Key changes:
- Create mappings between edge_ids and indices at function start
- Apply edge_map to labels (edge_ids) only, not indices
- Use original indices for all internal operations (_calculate_linear_position)
- Return mapped edge_ids in final output (track_segment_id column)
- Support string and arbitrary target values for edge relabeling
- Invalid source keys are ignored (maintaining backward compatibility)
Updated _calculate_linear_position to use segment indices directly instead
of trying to convert them back to edge_ids, eliminating the KeyError issue.
All existing edge_map tests now pass, including string values and merging scenarios.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
0 commit comments