Conversation
…ygon handling Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Antarctic drainage basins at order 6 cover fewer cells than initially assumed (e.g., Basin 24 ≈ 24 cells, Basin 1 ≈ 76 cells). Thresholds verified against brute-force PIP grid sampling. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #21 +/- ##
==========================================
+ Coverage 85.82% 87.30% +1.47%
==========================================
Files 13 15 +2
Lines 1771 2000 +229
==========================================
+ Hits 1520 1746 +226
- Misses 251 254 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
…'leaks' in the buffer 'wall'
Merging this PR will not alter performance
Performance Changes
Comparing Footnotes
|
PR #21 Review & Improvement PlanWhat's working well
Issues to address before merge1. Replace stereographic PIP with gnomonic projection + 2D winding numberThe current PIP uses south polar stereographic (hardcoded center -90°,0°) which only works reliably for southern-hemisphere polygons. Per the spherical PIP research in issue #20, the recommended approach is gnomonic projection centered on each test point + 2D winding number:
Architecture change: Currently all polygon vertices are projected ONCE via stereographic at startup, then reused for every PIP test. With gnomonic, the projection is centered on each test point, so we re-project per test. Cost is low — gnomonic projection is just dot products. New functions: Functions to delete:
Rust test updates: Remove stereo/raycast-specific tests, add gnomonic/winding-number tests including south pole edge case. 2. PR cleanup
3. Fix pole-touching cell rendering in notebookIn the Circle plots (cell 6), some morton cells near the south pole render as "bowties". The Fix: Detect pole-touching cells ( 4. Rename notebook to example + add documentation
Execution orderTask 1 (gnomonic PIP) → Task 2 (cleanup) → Task 3 (pole rendering) → Task 4 (notebook docs) Files to modify
Verification
|
|
good job @claude , we implemented a major new feature in a day that a team of scientists and engineers at NASA didn't have enough time to do in the pre-LLM coding days! |
This a human designed algorithm (see #20 ) , implemented by claude... with lots of hand holding. Mostly because claude will change unit tests to pass when they fail, instead of fixing why they fail =P
Summary
morton_coverage(lats, lons, order)— computes morton indices that completely cover a polygon defined by lat/lon vertices (closes Polygon to morton coverage #20)coverage.rs): contiguous boundary construction via great-circle interpolation, connected-component inner/outer classification with stereographic PIP, recursive inward fill, and a PIP sweep fallback for completenesscoverage.py) with input validation and closed-polygon handlingTest plan
pytest mortie/tests/test_coverage.py -v -m "not slow")cargo test --lib)cargo bench --bench coverage_bench --no-run)slow)pytest benchmarks/test_bench_coverage.py -v)