Skip to content

Commit 2b3600e

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent d548d5d commit 2b3600e

11 files changed

+17
-6
lines changed

setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Setup module."""
2+
23
import setuptools
34

45
if __name__ == "__main__":

src/pecanpy/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""PecanPy: parallelized, efficient, and accelerated node2vec."""
2+
23
from . import graph
34
from . import pecanpy
45

src/pecanpy/cli.py

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
$ pecanpy --help
1313
1414
"""
15+
1516
import argparse
1617
import warnings
1718

src/pecanpy/experimental.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Experimental features."""
2+
23
import numpy as np
34
from numba import njit
45
from pecanpy.pecanpy import Base

src/pecanpy/graph.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Lite graph objects used by pecanpy."""
2+
23
import warnings
34

45
import numpy as np

src/pecanpy/pecanpy.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Different strategies for generating node2vec walks."""
2+
23
import numpy as np
34
from gensim.models import Word2Vec
45
from numba import njit

src/pecanpy/rw/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Graph objects equipped with random walk transition functions."""
2+
23
from .dense_rw import DenseRWGraph
34
from .sparse_rw import SparseRWGraph
45

src/pecanpy/rw/dense_rw.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Dense Graph object equipped with random walk computation."""
2+
23
import numpy as np
34
from numba import njit
45

@@ -106,9 +107,9 @@ def get_extended_normalized_probs(
106107
alpha = 1 / q + (1 - 1 / q) * t
107108

108109
# suppress noisy edges
109-
alpha[
110-
unnormalized_probs[out_ind] < noise_threshold_ary[cur_idx]
111-
] = np.minimum(1, 1 / q)
110+
alpha[unnormalized_probs[out_ind] < noise_threshold_ary[cur_idx]] = (
111+
np.minimum(1, 1 / q)
112+
)
112113
unnormalized_probs[out_ind] *= alpha # apply out biases
113114
unnormalized_probs[prev_idx] /= p # apply the return bias
114115

src/pecanpy/rw/sparse_rw.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Sparse Graph equipped with random walk computation."""
2+
23
import numpy as np
34
from numba import boolean
45
from numba import njit
@@ -119,9 +120,9 @@ def get_extended_normalized_probs(
119120
alpha = 1 / q + (1 - 1 / q) * t[out_ind]
120121

121122
# suppress noisy edges
122-
alpha[
123-
unnormalized_probs[out_ind] < noise_threshold_ary[cur_idx]
124-
] = np.minimum(1, 1 / q)
123+
alpha[unnormalized_probs[out_ind] < noise_threshold_ary[cur_idx]] = (
124+
np.minimum(1, 1 / q)
125+
)
125126
unnormalized_probs[out_ind] *= alpha # apply out biases
126127
unnormalized_probs[prev_ptr] /= p # apply the return bias
127128

src/pecanpy/typing.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Type annotations."""
2+
23
from typing import Any
34
from typing import Callable
45
from typing import Dict

src/pecanpy/wrappers.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Wrappers used by pecanpy."""
2+
23
import time
34

45

0 commit comments

Comments
 (0)