Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Aug 6, 2024
1 parent d548d5d commit 2b3600e
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 6 deletions.
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Setup module."""

import setuptools

if __name__ == "__main__":
Expand Down
1 change: 1 addition & 0 deletions src/pecanpy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""PecanPy: parallelized, efficient, and accelerated node2vec."""

from . import graph
from . import pecanpy

Expand Down
1 change: 1 addition & 0 deletions src/pecanpy/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
$ pecanpy --help
"""

import argparse
import warnings

Expand Down
1 change: 1 addition & 0 deletions src/pecanpy/experimental.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Experimental features."""

import numpy as np
from numba import njit
from pecanpy.pecanpy import Base
Expand Down
1 change: 1 addition & 0 deletions src/pecanpy/graph.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Lite graph objects used by pecanpy."""

import warnings

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions src/pecanpy/pecanpy.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Different strategies for generating node2vec walks."""

import numpy as np
from gensim.models import Word2Vec
from numba import njit
Expand Down
1 change: 1 addition & 0 deletions src/pecanpy/rw/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Graph objects equipped with random walk transition functions."""

from .dense_rw import DenseRWGraph
from .sparse_rw import SparseRWGraph

Expand Down
7 changes: 4 additions & 3 deletions src/pecanpy/rw/dense_rw.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Dense Graph object equipped with random walk computation."""

import numpy as np
from numba import njit

Expand Down Expand Up @@ -106,9 +107,9 @@ def get_extended_normalized_probs(
alpha = 1 / q + (1 - 1 / q) * t

# suppress noisy edges
alpha[
unnormalized_probs[out_ind] < noise_threshold_ary[cur_idx]
] = np.minimum(1, 1 / q)
alpha[unnormalized_probs[out_ind] < noise_threshold_ary[cur_idx]] = (
np.minimum(1, 1 / q)
)
unnormalized_probs[out_ind] *= alpha # apply out biases
unnormalized_probs[prev_idx] /= p # apply the return bias

Expand Down
7 changes: 4 additions & 3 deletions src/pecanpy/rw/sparse_rw.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Sparse Graph equipped with random walk computation."""

import numpy as np
from numba import boolean
from numba import njit
Expand Down Expand Up @@ -119,9 +120,9 @@ def get_extended_normalized_probs(
alpha = 1 / q + (1 - 1 / q) * t[out_ind]

# suppress noisy edges
alpha[
unnormalized_probs[out_ind] < noise_threshold_ary[cur_idx]
] = np.minimum(1, 1 / q)
alpha[unnormalized_probs[out_ind] < noise_threshold_ary[cur_idx]] = (
np.minimum(1, 1 / q)
)
unnormalized_probs[out_ind] *= alpha # apply out biases
unnormalized_probs[prev_ptr] /= p # apply the return bias

Expand Down
1 change: 1 addition & 0 deletions src/pecanpy/typing.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Type annotations."""

from typing import Any
from typing import Callable
from typing import Dict
Expand Down
1 change: 1 addition & 0 deletions src/pecanpy/wrappers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Wrappers used by pecanpy."""

import time


Expand Down

0 comments on commit 2b3600e

Please sign in to comment.