Commit 6febf40
authored
Add memory guard for proximity line-sweep dask path (#1113)
* Add memory guard to proximity dask path for inf max_distance (#1111)
When max_distance >= raster diagonal, the line-sweep algorithm rechunks
the entire array into a single chunk. Add a memory estimate check
(~35 bytes/pixel working memory) that raises ValueError before the
rechunk if the working set would exceed 80% of available RAM.
* Add memory guard for proximity line-sweep dask path (#1111)
When max_distance >= raster diagonal and the non-KDTree path is used
(GREAT_CIRCLE metric or no scipy), the line-sweep rechunks to a single
chunk. The existing memory guard already catches this for the
GREAT_CIRCLE case. Add a pre-rechunk estimate (~35 bytes/pixel) to
_process_dask for the general case, raising ValueError before the
rechunk if working memory would exceed 80% of available RAM.
The EUCLIDEAN/MANHATTAN + scipy path uses the memory-safe KDTree and
already has its own guards.1 parent 3855b83 commit 6febf40
2 files changed
+42
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1221 | 1221 | | |
1222 | 1222 | | |
1223 | 1223 | | |
1224 | | - | |
1225 | | - | |
1226 | | - | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
1227 | 1242 | | |
1228 | 1243 | | |
1229 | 1244 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
374 | 374 | | |
375 | 375 | | |
376 | 376 | | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
377 | 401 | | |
378 | 402 | | |
379 | 403 | | |
| |||
0 commit comments