Skip to content

Commit

Permalink
Format with isort and black
Browse files Browse the repository at this point in the history
  • Loading branch information
nwlandry committed Nov 12, 2024
1 parent e1e49bd commit 4e0858d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
import os
import sys
from datetime import date, datetime
from sphinx_gallery.sorting import ExplicitOrder, FileNameSortKey

import requests
from sphinx_gallery.sorting import ExplicitOrder, FileNameSortKey

import xgi

Expand Down
6 changes: 3 additions & 3 deletions tests/algorithms/test_clustering.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import networkx as nx
import pytest

import xgi
import networkx as nx
from xgi.exception import XGIError


Expand Down Expand Up @@ -41,11 +41,11 @@ def test_local_clustering_coefficient(edgelist8):
3: 0.625,
4: 0.5833333333333334,
5: 1.0,
6: 1.0
6: 1.0,
}
for n in cc:
assert round(cc[n], 3) == round(true_cc[n], 3)

G = nx.erdos_renyi_graph(50, 0.1, seed=0)
H = xgi.Hypergraph()
H.add_nodes_from(G.nodes)
Expand Down
6 changes: 3 additions & 3 deletions xgi/algorithms/clustering.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
"""Algorithms for computing nodal clustering coefficients."""

import numpy as np
from itertools import combinations

import numpy as np

from ..exception import XGIError
from ..linalg import adjacency_matrix

Expand Down Expand Up @@ -151,8 +152,7 @@ def local_clustering_coefficient(H):
neighD2 = {i for d in D2 for i in H.nodes.neighbors(d)}
# compute extra overlap [len() is used for cardinality of edges]
eo = (
len(neighD1.intersection(D2))
+ len(neighD2.intersection(D1))
len(neighD1.intersection(D2)) + len(neighD2.intersection(D1))
) / len(
D1.union(D2)
) # add it up
Expand Down

0 comments on commit 4e0858d

Please sign in to comment.