Skip to content

[pre-commit.ci] pre-commit autoupdate #321

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: trailing-whitespace
exclude: .bumpversion.cfg
- id: end-of-file-fixer

- repo: https://github.com/asottile/reorder-python-imports
rev: v3.12.0
rev: v3.15.0
hooks:
- id: reorder-python-imports
args: ["--py38-plus"]

- repo: https://github.com/asottile/add-trailing-comma
rev: v3.1.0
rev: v3.2.0
hooks:
- id: add-trailing-comma

- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
rev: v3.20.0
hooks:
- id: pyupgrade

- repo: https://github.com/psf/black
rev: 23.12.1
rev: 25.1.0
hooks:
- id: black
args: [--safe]
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__":
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

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

"""

import argparse
import warnings

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
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
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
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

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

@@ -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

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
@@ -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

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
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