Conversation
Adapt the Numba intersection kernel to two changes on main: - UXARRAY#1727 changed gca_const_lat_intersection to return a tuple of tuples instead of a (2, 3) array, so the kernel now reads points as intersections[r][i] rather than intersections[r, i]. - UXARRAY#1705 made the no-intersection and concave-face errors format the face array into their messages, which Numba cannot do, so both raises move from the kernel into the Python wrapper. The kernel now also returns the number of non-dummy edges that the concave check needs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ASV BenchmarkingBenchmark Comparison ResultsBenchmarks that have improved:
Benchmarks that have stayed the same:
Benchmarks that have got worse:
|
… Numba The robust path built several tiny polars DataFrames per candidate face, and that fixed per-call overhead was nearly its whole runtime. Each latitude is now two Numba calls: one computing every candidate face's longitude intervals, and one running the overlap sweep line. Results are bit-identical, and robust zonal means are 52-86x faster, now within 1.3-2.7x of the default path instead of 100-200x slower. Both new per-latitude kernels release the GIL. Each call does milliseconds of work, so from 4 threads the robust weights take 1.09x the single-thread wall time instead of 4.03x. The private helpers now use arrays instead of DataFrames: _zonal_face_weights_robust returns the weights, _get_zonal_face_interval returns (start, end) rows, and _process_overlapped_intervals takes starts/ends/face indices and returns per-face contributions. A face whose crossing longitudes cannot be paired into intervals now raises ValueError rather than polars' ShapeError. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1570
Maybe related to #790
Overview
PR Checklist
General
Testing & Benchmarking
Documentation and Examples
docs/api.rst; internal (private) function names start with an underscore (_)AI Disclosure
AI Usage: Claude Opus 5