Skip to content
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

Nondeterminism in test_directed_input #297

Open
sdmccabe opened this issue Jul 31, 2020 · 0 comments
Open

Nondeterminism in test_directed_input #297

sdmccabe opened this issue Jul 31, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@sdmccabe
Copy link
Collaborator

Test failed once on PR #293.

_____________________________ test_directed_input ______________________________
    def test_directed_input():
        with warnings.catch_warnings():
            warnings.filterwarnings(
                "ignore", message="Coercing directed graph to undirected."
            )
            G = nx.fast_gnp_random_graph(100, 0.3, directed=True)
    
            for label, obj in distance.__dict__.items():
                if isinstance(obj, type) and BaseDistance in obj.__bases__:
                    dist = obj().dist(G, G)
                    assert np.isclose(dist, 0.0)
    
            G1 = nx.fast_gnp_random_graph(100, 0.3, directed=True)
            G2 = nx.fast_gnp_random_graph(100, 0.3, directed=True)
   
            for label, obj in distance.__dict__.items():
                if isinstance(obj, type) and BaseDistance in obj.__bases__:
                    dist1 = obj().dist(G1, G2)
                    dist2 = obj().dist(G2, G1)
>                   assert np.isclose(dist1, dist2)
E                   assert False
E                    +  where False = <function isclose at 0x7fc528395f70>(nan, nan)
E                    +    where <function isclose at 0x7fc528395f70> = np.isclose
test_distance.py:97: AssertionError

This seemed to be some nondeterminism in the test. I would guess from the nan result that the graphs weren't strongly connected and a distance depends on that.

@sdmccabe sdmccabe added the bug Something isn't working label Jul 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant