rustworkx icon indicating copy to clipboard operation
rustworkx copied to clipboard

Add Python tests for `newman_weighted_closeness_centrality`

Open IvanIsCoding opened this issue 10 months ago • 2 comments

What is the expected enhancement?

In #1385, we skipped the Python tests for newman_weighted_closeness_centrality. Before the 0.17 release, we need to test the function.

Notice that the PR has Rust tests, so basing the tests from the version should be fine. We also need to test the behaviour when weight_fn is None.

IvanIsCoding avatar Feb 14 '25 01:02 IvanIsCoding

@IvanIsCoding Can you clarify what you mean by "basing the tests from the version should be fine."? I am interesting in taking this issue.

boonware avatar Feb 20 '25 11:02 boonware

@IvanIsCoding Can you clarify what you mean by "basing the tests from the version should be fine."? I am interesting in taking this issue.

Of course. You can use these tests as a reference: https://github.com/Qiskit/rustworkx/blob/286a719db1ecb40d9a6faf6215f13576bc1d1b91/rustworkx-core/src/centrality.rs#L1250

At the Python level, we are mostly concerned in the correctness of covering most arguments like weight function , default weight, checking that the returned value is a dictionary-like with correct values. The graph inputs don’t need to be original, feel free to copy from Rust

IvanIsCoding avatar Feb 20 '25 12:02 IvanIsCoding