Commit 112cd66
authored
surface_distance, surface_allocation and surface_direction built their
result with xr.DataArray(..., coords=, dims=, attrs=) and left name
unset. DataArray.__init__ then falls back to getattr(data, "name"),
which on a dask array is the graph key, so the dask backends returned
'_trim-<hash>' (bounded map_overlap route),
'xrspatial.surface_*-<hash>' (unbounded iterative route) or
'asarray-<hash>' (dask+cupy unbounded) while numpy and cupy returned
None.
The divergence is user-visible through .to_dataset(): the numpy result
raises "unable to convert unnamed DataArray", the dask result silently
creates a variable named after the hash, and the hash moves when
chunking or max_distance changes.
Route the three functions through a shared _wrap_result() helper that
resets .name to None after construction, matching the
proximity/allocation/direction trio this module mirrors. Same bug class
as cost_distance #3344 and pathfinding #3652.
Tests cover .name parity over 4 backends x 3 functions x
bounded/unbounded max_distance, plus an attrs/coords/dims/dtype
preservation guard. The 12 dask cases fail without the fix.
Also records the metadata sweep result for this module in
.claude/sweep-metadata-state.csv.
1 parent 737f9b4 commit 112cd66
3 files changed
Lines changed: 88 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1435 | 1435 | | |
1436 | 1436 | | |
1437 | 1437 | | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
1438 | 1457 | | |
1439 | 1458 | | |
1440 | 1459 | | |
| |||
1488 | 1507 | | |
1489 | 1508 | | |
1490 | 1509 | | |
1491 | | - | |
1492 | | - | |
1493 | | - | |
1494 | | - | |
1495 | | - | |
1496 | | - | |
| 1510 | + | |
1497 | 1511 | | |
1498 | 1512 | | |
1499 | 1513 | | |
| |||
1530 | 1544 | | |
1531 | 1545 | | |
1532 | 1546 | | |
1533 | | - | |
1534 | | - | |
1535 | | - | |
1536 | | - | |
1537 | | - | |
1538 | | - | |
| 1547 | + | |
1539 | 1548 | | |
1540 | 1549 | | |
1541 | 1550 | | |
| |||
1573 | 1582 | | |
1574 | 1583 | | |
1575 | 1584 | | |
1576 | | - | |
1577 | | - | |
1578 | | - | |
1579 | | - | |
1580 | | - | |
1581 | | - | |
| 1585 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
705 | 705 | | |
706 | 706 | | |
707 | 707 | | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
708 | 773 | | |
709 | 774 | | |
710 | 775 | | |
| |||
0 commit comments