Skip to content

tests: fix the bearing-vs-Geod tolerance; add pyproj to requirements-dev - #305

Open
jonfroehlich wants to merge 2 commits into
mainfrom
fix/bearing-test-tolerance
Open

jonfroehlich wants to merge 2 commits into
mainfrom
fix/bearing-test-tolerance

Conversation

@jonfroehlich

@jonfroehlich jonfroehlich commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

tests/test_stage1_bearing_residual.py::test_great_circle_matches_the_geodesic_used_by_stage_1 fails on main wherever pyproj is installed: the spherical bearing and WGS84 Geod.inv differ by 0.080° at 40.7° N against a 0.01° tolerance. CI hid it because pyproj is not in requirements-dev.txt, so the test skipped.

  • Tolerance 0.01° → 0.25°. The gap is the spherical-vs-ellipsoidal azimuth difference, about (1 − M/N)/2 rad: ~0.11° at 40.7° N and under 0.2° at any latitude. 0.25° keeps the docstring's requirement of agreeing far inside the ~3° residual being measured. The rationale is in the docstring.
  • pyproj added to requirements-dev.txt, so CI runs this test and the (b′) part of check_274.py (the stage1_crosswalk_274 entry), which Stage 1 crosswalk detector: s1 to s5, crosswalk_s4 adopted (#274) #300's review left CI-skipped for exactly this reason.
  • (b′) float rounding. With pyproj present, CI's Python 3.10 job (numpy 2.2.6) regenerated the three bprime/scores.json files with the weighted sums' last bits moved (~1e-15 relative; nodes.csv identical), so the byte-compare failed. score_274.py bprime-score now rounds its floats to 9 decimals at the writer, and the three committed files are regenerated (scored_utc kept). Verified locally with uv: Python 3.10 + numpy 2.2.6 and Python 3.12 + current numpy produce identical bytes, and check_274.py reports 0 problems under both. Every value is unchanged to 9 decimals; no other Stage 1 crosswalk detector: s1 to s5, crosswalk_s4 adopted (#274) #300 output is touched.

🤖 Generated with Claude Code — Opus 5.5, claude-opus-5-5

jonfroehlich and others added 2 commits November 25, 2026 05:05
…-dev

test_great_circle_matches_the_geodesic_used_by_stage_1 compared the spherical
bearing with WGS84 Geod.inv at 0.01 deg and failed wherever pyproj was
installed (0.080 deg at 40.7 N), which CI hid by skipping it. The difference
is the spherical/ellipsoidal one, under 0.2 deg at any latitude, so 0.25 deg
keeps the docstring's requirement (far inside the ~3 deg residual).

With the test fixed, pyproj goes into requirements-dev.txt so CI runs it and
check_274.py's (b') part (PR 300 review notes).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… holds on numpy 2.2.6

With pyproj in requirements-dev, CI ran check_274's (b') part for the first
time, and Python 3.10 (numpy 2.2.6, the last numpy for 3.10) regenerated the
three bprime scores.json files with the last bits of the weighted sums moved
(~1e-15 relative; tp_w 2685.053274 vs 2685.0532739999876). nodes.csv was
byte-identical. Per the repo's rule, round at the writer rather than loosen
the byte-compare: bprime-score now writes its floats rounded to 9 decimals.

The three committed files are regenerated (scored_utc kept). Python 3.10
with numpy 2.2.6 and Python 3.12 with current numpy now produce identical
bytes, and check_274.py reports 0 problems under both. Every value is
unchanged to 9 decimals; the other #300 outputs are untouched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant