Erik Welch

Results 185 comments of Erik Welch

> I am also interested in learning about _dispatch. Great! `_dispatch` is related to a new, experimental feature in NetworkX that allows for additional backend implementations of graph data structures...

My bad for being slow! Been traveling too much... I'll try to get to this soon even if it's just a workaround to make 3.12 work.

Try updating to the latest `innerscope`. I just created a new release (0.7.0) that should hopefully resolve this issue. I'm sorry for the delay! I've had lots of, uh, "adventures"...

I added `returns_graph=True` to `@nx._dispatchable` like we discussed in the weekly dispatching meeting (although we didn't really discuss the argument name, so suggestions for a better name are welcome). I...

Aha, our tests worked and found a new function that returns a graph (and needs `returns_graph=True`): https://github.com/networkx/networkx/actions/runs/7700821863/job/20985472423?pr=7191#step:5:696 ``` E RuntimeError: `returns_graph` is incorrect for modular_product ``` This PR has been...

I think a solution to this is to manually add [explicit targets](https://docs.readthedocs.io/en/stable/guides/cross-referencing-with-sphinx.html#explicit-targets). For example: ```rst .. _networkx.algorithms.centrality.degree_alg: Degree ------ ``` I think this works. Does this pattern "smell" okay?

> Or maybe I should also ask -- what problem does this cause for dispatching? I need to explicitly exclude the function when creating the "dependencies between dispatched networkx functions"...

> Could we create a new category of functions -- those that are public but for which the dispatching is not appropriate? Sure... should we simply remove `@nx._dispatch` from these...

Updated to use `a.item(i)` where appropriate. This PR still does e.g. `float(s)` instead of `s.item()` for clarity. I'm really glad to have learned about `.item`! > Also, just to make...

One potential shortcoming of this is that this only works for backends that are valid identifiers. I think this is fine.