metagraph-dev / metagraph

Multi-target API for graph analytics with Dask
https://metagraph.readthedocs.io/en/latest/
Apache License 2.0
27 stars 7 forks source link

Failing test: test_hits_centrality #209

Closed seibert closed 3 years ago

seibert commented 3 years ago

It looks like test_hits_centrality:

https://github.com/metagraph-dev/metagraph/blob/d828260365f286f1d24b3a2c2171f85716672c28/metagraph/tests/algorithms/test_centrality.py#L230-L255

is now failing. I get:

FAILED metagraph/tests/algorithms/test_centrality.py::test_hits_centrality - AssertionError: Mismatch for node 0: 1.0693502568464412e-135 != -1.375893824035368e-19

This is with NetworkX 2.6.2 on macOS x86-64. The concrete algorithm is here:

https://github.com/metagraph-dev/metagraph/blob/7f316d1d3c5c81d8b884a842ad8f5008eb538e58/metagraph/plugins/networkx/algorithms.py#L201-L206

seibert commented 3 years ago

The issue seems to be very small values, where rel_tol is not as useful. A simple solution could be to add abs_tol=2e-6 to https://github.com/metagraph-dev/metagraph/blob/d828260365f286f1d24b3a2c2171f85716672c28/metagraph/tests/algorithms/test_centrality.py#L255

seibert commented 3 years ago

Fixed in #210