Fix NumPy 2 overflow and quadratic point selection on large stacks - #162
Merged
Merged
Conversation
added 3 commits
September 10, 2026 17:18
NumPy 2 refuses to convert a Python integer larger than 32767 to int16, so densification and triangulation crash at the very end of a large run.
The three "for p in point_id: if p not in other_id" loops are quadratic and do not end on a stack of a few million points.
gstools allocates one (conditioning points x evaluated points) float64 array per call, hundreds of gigabytes on a large stack, and the worker is killed.
Author
|
A third problem, same family. gstools evaluates a kriging model in a single Evaluating in blocks of at most 128 MB is bit-identical and costs nothing. |
Andreas-Piter
self-requested a review
September 14, 2026 09:14
Member
|
Dear @A220N1, |
Andreas-Piter
approved these changes
Sep 14, 2026
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.
Two independent problems met while processing Sentinel-1 stacks of a few million
second-order points.
prog_bar.update(..., every=np.int16(...))raisesOverflowError: Python integer 32768 out of bounds for int16under NumPy 2, at the very end of step 4 and duringtriangulation = the whole run is lost.
The three point selection loops (
objects.removePoints,processing.runDensificationTimeAndSpacetwice) are quadratic in the number ofpoints and never complete at that size.
np.isingives the same mask, duplicatesincluded.
Checked on a 55-date Sentinel-1 stack: steps 0 to 4 run twice, with and without the
vectorization, give 49 140 points, the same identifiers and a maximum difference of
0 over the 62 numeric columns of the export.
No test is added: both changes are internal and the existing suite covers them
through
test_processing.