Commit 1af378c
committed
Accept target_values=None in the surface_* trio like the proximity trio (#3712)
surface_distance, surface_allocation and surface_direction declared
target_values: list = [] while proximity, allocation, direction and
cost_distance declare None and normalise it in the body. Passing None
therefore reached np.asarray(None, dtype=float64) and blew up inside the
_seed_sources numba kernel with a type-inference error that never
mentioned target_values.
Switch the three defaults to None, normalise in _compute, and update the
docstring. Not a breaking change: None and [] both mean 'every non-zero
finite pixel is a source'.1 parent 069fc13 commit 1af378c
2 files changed
Lines changed: 43 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1297 | 1297 | | |
1298 | 1298 | | |
1299 | 1299 | | |
| 1300 | + | |
| 1301 | + | |
1300 | 1302 | | |
1301 | 1303 | | |
1302 | 1304 | | |
| |||
1421 | 1423 | | |
1422 | 1424 | | |
1423 | 1425 | | |
1424 | | - | |
| 1426 | + | |
1425 | 1427 | | |
1426 | 1428 | | |
1427 | 1429 | | |
| |||
1445 | 1447 | | |
1446 | 1448 | | |
1447 | 1449 | | |
1448 | | - | |
| 1450 | + | |
1449 | 1451 | | |
1450 | | - | |
| 1452 | + | |
1451 | 1453 | | |
1452 | 1454 | | |
1453 | 1455 | | |
| |||
1482 | 1484 | | |
1483 | 1485 | | |
1484 | 1486 | | |
1485 | | - | |
| 1487 | + | |
1486 | 1488 | | |
1487 | 1489 | | |
1488 | 1490 | | |
| |||
1524 | 1526 | | |
1525 | 1527 | | |
1526 | 1528 | | |
1527 | | - | |
| 1529 | + | |
1528 | 1530 | | |
1529 | 1531 | | |
1530 | 1532 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
359 | 359 | | |
360 | 360 | | |
361 | 361 | | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
362 | 398 | | |
363 | 399 | | |
364 | 400 | | |
| |||
0 commit comments