piker/ai/prompt-io/opencode/20260722T001357Z_16f3cd6f_p...

1.3 KiB

git diff HEAD~1..HEAD -- piker/tsp/_anal.py

Generated canonical gap and null-segment normalization. Derived datetime and delta columns are recomputed after final sorting and duplicate resolution, and negative deltas no longer become ordinary gaps.

NumPy and Polars null grouping share one implementation while retaining the human-oriented visual map of contiguous zero runs. The documented contract defines absolute inclusive endpoints, margin expansion, frame boundary clamping, contiguous-index validation, and requested-column selection.

git diff HEAD~1..HEAD -- piker/tsp/_dedupe_smart.py

Adjusted smart dedupe to honor sorted output and resolve duplicate timestamps without retaining stale order.

git diff HEAD~1..HEAD -- tests/test_tsp_analysis.py

Added deterministic synthetic OHLCV coverage for sorted dedupe, fresh derived columns, and positive gap detection. Null grouping is checked against readable endpoint examples and an independent state-machine oracle over every layout through six rows, three margin widths, and both NumPy and Polars inputs.

Verification generated with the patch:

timeout -k 5 30 python -m pytest -q tests/test_tsp_analysis.py

Result: 11 passed.