Skip to content

feat: add pure-Go CellToLatLng & CellToBoundary to x/h3go#125

Merged
justinhwang merged 1 commit into
masterfrom
justinhwang/purego-phase-b
Jul 2, 2026
Merged

feat: add pure-Go CellToLatLng & CellToBoundary to x/h3go#125
justinhwang merged 1 commit into
masterfrom
justinhwang/purego-phase-b

Conversation

@justinhwang

Copy link
Copy Markdown
Collaborator

Implement the reverse projection pipeline in pure Go: CellToLatLng (+ Cell.LatLng) and CellToBoundary (+ Cell.Boundary), with the supporting FaceIJK/coordIJK/vec2d/vec3d geometry, substrate grids, and overage adjustment. Verified against the cgo reference via paritytest and by LatLngToCell round-trips, with regression cases ported from the C tests.

Refactors applied across the package:

  • Convert input-parameter helpers to methods on their natural receiver type, with one canonical receiver name per type.
  • Inline pure-delegation unexported helpers into their exported methods (resolution, baseCellNumber, isPentagon); collapse isValid's guard in.
  • Add isResClassIII(res) helper, replacing scattered %2 == 1 checks.
  • Exclude mnd for x/h3go via path-scoped .golangci.yml rule (geometric and bit-layout constants are inherent, not magic) and drop the now-unused //nolint:mnd directives; keep gosec.

Implement the reverse projection pipeline in pure Go: CellToLatLng
(+ Cell.LatLng) and CellToBoundary (+ Cell.Boundary), with the supporting
FaceIJK/coordIJK/vec2d/vec3d geometry, substrate grids, and overage
adjustment. Verified against the cgo reference via paritytest and by
LatLngToCell round-trips, with regression cases ported from the C tests.

Refactors applied across the package:
- Convert input-parameter helpers to methods on their natural receiver type,
  with one canonical receiver name per type.
- Inline pure-delegation unexported helpers into their exported methods
  (resolution, baseCellNumber, isPentagon); collapse isValid's guard in.
- Add isResClassIII(res) helper, replacing scattered %2 == 1 checks.
- Exclude mnd for x/h3go via path-scoped .golangci.yml rule (geometric and
  bit-layout constants are inherent, not magic) and drop the now-unused
  //nolint:mnd directives; keep gosec.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@justinhwang justinhwang force-pushed the justinhwang/purego-phase-b branch from 71f76d9 to 843f012 Compare June 16, 2026 20:52
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 27647386888

Coverage remained the same at 100.0%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: 616 of 616 lines across 7 files are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 2102
Covered Lines: 2102
Line Coverage: 100.0%
Coverage Strength: 1578843.11 hits per line

💛 - Coveralls

@justinhwang justinhwang merged commit 0b7f12b into master Jul 2, 2026
14 checks passed
@justinhwang justinhwang deleted the justinhwang/purego-phase-b branch July 2, 2026 15:09
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.

3 participants