diff options
author | Mridul Seth <seth.mridul@gmail.com> | 2022-03-29 18:01:52 +0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-29 07:01:52 -0700 |
commit | f6755ffa00211b523c6c0bec5398bc6c3c43c8b1 (patch) | |
tree | 328c18e52cf8f563064ed319e5d4b46be064149a /networkx/linalg | |
parent | fd52aa52ada0c08dfc25fc749f08589d7b734c00 (diff) | |
download | networkx-f6755ffa00211b523c6c0bec5398bc6c3c43c8b1.tar.gz |
Update black (#5438)
* CI: sync up black dev requirements version with precommit
* Run black
Co-authored-by: Jarrod Millman <jarrod.millman@gmail.com>
Diffstat (limited to 'networkx/linalg')
-rw-r--r-- | networkx/linalg/bethehessianmatrix.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/networkx/linalg/bethehessianmatrix.py b/networkx/linalg/bethehessianmatrix.py index cb008465..d0354e36 100644 --- a/networkx/linalg/bethehessianmatrix.py +++ b/networkx/linalg/bethehessianmatrix.py @@ -66,7 +66,7 @@ def bethe_hessian_matrix(G, r=None, nodelist=None): if nodelist is None: nodelist = list(G) if r is None: - r = sum(d ** 2 for v, d in nx.degree(G)) / sum(d for v, d in nx.degree(G)) - 1 + r = sum(d**2 for v, d in nx.degree(G)) / sum(d for v, d in nx.degree(G)) - 1 A = nx.to_scipy_sparse_array(G, nodelist=nodelist, format="csr") n, m = A.shape # TODO: Rm csr_array wrapper when spdiags array creation becomes available @@ -81,4 +81,4 @@ def bethe_hessian_matrix(G, r=None, nodelist=None): stacklevel=2, ) # TODO: Remove the csr_matrix wrapper in NetworkX 3.0 - return sp.sparse.csr_matrix((r ** 2 - 1) * I - r * A + D) + return sp.sparse.csr_matrix((r**2 - 1) * I - r * A + D) |