Commit 6e28795
authored
Fix edgecase when converting to networkx w/o fallback (rapidsai#118)
This fixes a (probably rare) case that I encountered when calling a function with `nxcg.Graph` and `backend="networkx"` when `nx.config.fallback_to_nx is False` and the function calls another networkx function.
The `nxcg.Graph` is networkx-compatible, but it still has `__networkx_backend__ == "cugraph"`, so there are times when some behaviors may be different (but technically correct) b/c `__networkx_backend__` isn't `"networkx"`. So, we convert fully to networkx graph. An alternative would be to create a proxy graph that shares the data structures of the `nxcg.Graph` but has `G.__networkx_backend__ == "networkx"`, but the current approach is simplest and adequately covers what should be a very rare occurance.
Regression test added.
Authors:
- Erik Welch (https://github.com/eriknw)
Approvers:
- Rick Ratzel (https://github.com/rlratzel)
URL: rapidsai#1181 parent 98d4e6b commit 6e28795
3 files changed
+18
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
648 | 648 | | |
649 | 649 | | |
650 | 650 | | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
651 | 655 | | |
652 | 656 | | |
653 | 657 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
| 37 | + | |
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
0 commit comments