Generalizing Closeness centrality to weighted networks using Newman method#1385
Conversation
Signed-off-by: FedericoBruzzone <federico.bruzzone.i@gmail.com>
Closeness centrality to weighted networks using newman methodCloseness centrality to weighted networks using Newman method
IvanIsCoding
left a comment
There was a problem hiding this comment.
THe implemenation LGTM for rustworkx-core, do you intend to make the method available for Pytohn users though?
I left a comment about the tests. It applies to all of our centrality metrics, we need to be careful with floats
Thanks for the review. I do not actually need the python implementation, but I can understand that this could improve usability for Python users. So, I will work on exposing the method to Python as well. Regarding the tests, I appreciate the feedback. I'll make sure to add checks that account for floating-point precision issues across all centrality metrics. |
1fb850f to
b364913
Compare
|
@IvanIsCoding Make sure that the following commit is in line with the rest, but most importantly, make sure it is correct. Make available weighted_closeness for python users Why is CI not starting? 🤔 |
81813f3 to
7de1312
Compare
|
I need to manually approve CI. Also, I asked about Python just to confirm. Someone else can work on the Python bindings. |
There was no problem to implement it. It was a pleasure, I look forward to your review :D |
0bc11f9 to
95c0166
Compare
Pull Request Test Coverage Report for Build 13320423785Details
💛 - Coveralls |
IvanIsCoding
left a comment
There was a problem hiding this comment.
Just some minor details.
Also, let me know if you want to work on Python tests & the release note. I can do it if you want to focus on the rustworkx-core core. Adding support for Python are additional extra steps that can be delegated to a separate PR
c344424 to
3fc34ac
Compare
Signed-off-by: FedericoBruzzone <federico.bruzzone.i@gmail.com>
431bc6f to
e1f9418
Compare
What are the additional steps beyond those made in this PR? Are they documented anywhere? I did not see them in the CONTRIBUTING file. This should be my task and I would like to do it 😄
If you can do that it is better, I will as soon as I can maybe implement the betweeness or the other method for closeness. Just out of curiosity, is it documented anywhere how to do release notes? |
|
The additional steps are compared to the work of adding just Rust code vs adding Python support. For Python:
Because we have Rust tests, I am ok with merging the PR without Python tests and adding them later. |
IvanIsCoding
left a comment
There was a problem hiding this comment.
Set up the weight_fn to be None by default to agree with the type annotations and we should be good to go. Also, default_weight=1.0 makes the function behave like the unweighted version when no weight function is passed
Signed-off-by: FedericoBruzzone <federico.bruzzone.i@gmail.com>
Signed-off-by: FedericoBruzzone <federico.bruzzone.i@gmail.com>
Signed-off-by: FedericoBruzzone <federico.bruzzone.i@gmail.com>
e1f9418 to
6836056
Compare
ce2f2d8 to
865b498
Compare
|
We should be good to go 😄 |
Signed-off-by: FedericoBruzzone <federico.bruzzone.i@gmail.com>
c804774 to
e72acb5
Compare
releasenotes/notes/newman-weighted-closeness-centrality-d4dba79712e9ac42.yaml
Show resolved
Hide resolved
IvanIsCoding
left a comment
There was a problem hiding this comment.
This is good to go
I hope to find more time to do more PRs. Thanks for the review! |
… method (Qiskit#1385) * Add `Closeness` centrality to weighted networks using newman method Signed-off-by: FedericoBruzzone <federico.bruzzone.i@gmail.com> * Test by using `assert_almost_equal!` Signed-off-by: FedericoBruzzone <federico.bruzzone.i@gmail.com> * Make available `weighted_closeness` for python users Signed-off-by: FedericoBruzzone <federico.bruzzone.i@gmail.com> * Fix typo in some files Signed-off-by: FedericoBruzzone <federico.bruzzone.i@gmail.com> * Add docs and update `pyi` files Signed-off-by: FedericoBruzzone <federico.bruzzone.i@gmail.com> * Minor fix Signed-off-by: FedericoBruzzone <federico.bruzzone.i@gmail.com> * Add `releasenote` Signed-off-by: FedericoBruzzone <federico.bruzzone.i@gmail.com> * Update rustworkx-core/src/centrality.rs --------- Signed-off-by: FedericoBruzzone <federico.bruzzone.i@gmail.com> Co-authored-by: Ivan Carvalho <8753214+IvanIsCoding@users.noreply.github.com>
Close #1384