rustworkx
rustworkx copied to clipboard
Move more connected components functions to retworkx-core
Hello, I get this error no method named 'index' found for reference &<G as GraphBase>::NodeId
and I am not sure what other method is allowed. If anyone has any suggestions or has an idea about which files to look at for reference/examples let me know, otherwise I will keep looking.
I am also not sure how to import NullGraph
and InvalidNode
in the conn_components.rs
file.
I was planning on doing a review of this in the next couple of days. The v.index()
issue is that petgraph
using Graph
, or the derived PyGraph
, is different from using the GraphBase
trait as it is in rustworkx-core
. For instance, NodeIndex
for Graph is NodeId
for GraphBase
. To get the index with GraphBase
, you would do graph.to_index(v)
. You can find to_index
here, https://docs.rs/petgraph/0.4.13/petgraph/visit/trait.NodeIndexable.html#tymethod.to_index.
Oh one more important thing I forgot. You need to transition to using the rustworkx
name. Steps are
- Rename your repository on Github.
- Rename your local directory to
rustworkx
. - Change any remote urls to the
rustworkx
repository. - Checkout
main
on your local. - Do a
git pull upstream main
- Move any files you have changed in
retworkx-core
to the corresponding location inrustworkx-core
. I think this will just be inconnectivity
forconn_components.rs
andmod.rs
. - Once you have moved the files over, you can remove the
retworkx-core
directory. - Finally globally replace references to
retworkx
in all your changed files torustworkx
.
Apologies for the late implementation of the feedback. I have started making the corresponding naming changes and will commit any relevant changes. Thank you for the help!
@IvanIsCoding or @mtreinish Can you turn on the workflow testing here? Thanks.
Hi, @kris524. Just checking to see if you are still working on this. Thanks.
Hi @enavarro51 apologies for being slow, I was just busy. Is it ok if I have a look at it this weekend? I think I am close to finishing it.
@kris524. That's fine. Once you get a good build, you can add a test for each of the 2 new functions at the end of rustworkx/rustworkx-core/src/connectivity/conn_components.rs
, and add a features
release note like rustworkx/releasenotes/notes/move-conn_components-functions-1be43732ec6058ea.yaml
. Let me know if you have any questions.
Tomorrow I will write a test for node_connected_component
@enavarro51 Let me know if you are happy with the tests.