Skip to content

Update square_clustering #109

@Schefflera-Arboricola

Description

@Schefflera-Arboricola

Test failures due to recent changes made in PR networkx/networkx#7810

square clustering: error msg

=================================== FAILURES ===================================
____________ TestSquareClustering.test_self_loops_square_clustering ____________

self = <networkx.algorithms.tests.test_cluster.TestSquareClustering object at 0x1044fad50>

    def test_self_loops_square_clustering(self):
        G = nx.path_graph(5)
        assert nx.square_clustering(G) == {0: 0, 1: 0, 2: 0, 3: 0, 4: 0}
        G.add_edges_from([(0, 0), (1, 1), (2, 2)])
>       assert nx.square_clustering(G) == {0: 0, 1: 0, 2: 0, 3: 0, 4: 0}
E       assert {0: 1, 1: 0.5..., 3: 0.0, ...} == {0: 0, 1: 0, 2: 0, 3: 0, ...}
E         
E         Omitting 2 identical items, use -vv to show
E         Differing items:
E         {0: 1} != {0: 0}
E         {1: 0.5} != {1: 0}
E         {2: 0.2} != {2: 0}
E         
E         Full diff:
E           {
E         -     0: 0,
E         ?        ^
E         +     0: 1,
E         ?        ^
E         -     1: 0,
E         +     1: 0.5,
E         ?         ++
E         -     2: 0,
E         +     2: 0.2,
E         ?         ++
E         -     3: 0,
E         +     3: 0.0,
E         ?        ++
E               4: 0,
E           }

/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/networkx/algorithms/tests/test_cluster.py:499: AssertionError

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions