Closed u3ks closed 6 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 97.8%. Comparing base (
4037c70
) to head (b127e27
). Report is 21 commits behind head on main.
Potentially, the function can be sped up further if we change the function API and pass the networkx.MultiGraph object. Then, we can do:
sum(l for (,,l) in nx.subgraph(neighbours).edges.data('mm_len'))
where neighbours comes from the new libpysal.Graph.
Was there any more thought to this?
Was there any more thought to this?
Yes. It was faster but the API got super weird so we scraped it.
functional implementation of nodedensity. I kept the function logic pretty much the same, just used the new graph api and np.in1d, instead of np.isin.
Timings: old: CPU times: user 14.9 s, sys: 69.3 ms, total: 15 s Wall time: 14.9 s
new: CPU times: user 6.19 s, sys: 0 ns, total: 6.19 s Wall time: 6.19 s
Potentially, the function can be sped up further if we change the function API and pass the networkx.MultiGraph object. Then, we can do:
sum(l for (,,l) in nx.subgraph(neighbours).edges.data('mm_len'))
where neighbours comes from the new libpysal.Graph.