-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding degree centrality function #1145
base: main
Are you sure you want to change the base?
Conversation
|
1 similar comment
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still needs quite a bit of work. You can start by writing the tests at https://github.com/Qiskit/rustworkx/blob/main/tests/graph/test_centrality.py, the current tests pass because you never called the function you added
/// | ||
/// Returns: | ||
/// A `Vec<f64>` containing the degree centrality of each node in the graph. | ||
pub fn degree_centrality<G>(graph: G) -> Result<Option<Vec<f64>>, E> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not compile because you never defined E
graph: &digraph::PyDiGraph, | ||
) -> PyResult<CentralityMapping> { | ||
// Convert Python object to Rust type | ||
let graph_rust = match graph.extract::<SomeRustGraphType>() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also will not compile
Hi @IvanIsCoding , Thanks for the review comments , will check and update |
Hello, any news about this feature ? |
Test :
As this is my first pull request on this repo , if any more testing need to be done please let me know. Thanks.