Skip to content

Commit df251aa

Browse files
committed
Pass flake8
1 parent ccb0025 commit df251aa

5 files changed

Lines changed: 8 additions & 9 deletions

File tree

src/diffupy/cli.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ def kernel(
7575

7676
click.secho(f'{EMOJI} Calculating regulatised Laplacian kernel. This might take a while... {EMOJI}')
7777

78-
7978
exe_t_0 = time.time()
8079
background_mat = regularised_laplacian_kernel(graph)
8180
exe_t_f = time.time()

src/diffupy/diffuse.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ def diffuse(
3737
:return: The diffused scores within the matrix transformation of the network, with the diffusion operation
3838
[k x input_vector] performed
3939
"""
40-
4140
# Sanity checks
4241
scores = copy.copy(input_scores)
4342

src/diffupy/diffuse_raw.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def diffuse_raw(
5555
scores: Matrix,
5656
z: bool = False,
5757
k: Matrix = None,
58-
) -> Matrix:
58+
) -> Matrix:
5959
"""Compute the score diffusion procedure, given an initial state as a set of scores and a network where diffuse it.
6060
6161
:param graph: background network

src/diffupy/kernels.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
log = logging.getLogger(__name__)
1818

19-
2019
__all__ = [
2120
'diffusion_kernel',
2221
'commute_time_kernel',
@@ -25,6 +24,7 @@
2524
'p_step_kernel',
2625
]
2726

27+
2828
def commute_time_kernel(graph: nx.Graph, normalized: bool = False) -> Matrix:
2929
"""Compute the commute-time kernel, which is the expected time of going back and forth between a couple of nodes.
3030

tests/diffusion_tests.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
"""Tests checking kernel functions py implementation based on R package computations."""
44

55
import logging
6+
import unittest
7+
68
import networkx as nx
79
import numpy as np
8-
import unittest
910

1011
from diffupy.diffuse import diffuse
11-
1212
from diffupy.matrix import Matrix
1313
from .constants import *
1414

@@ -17,9 +17,9 @@
1717
"""Helper functions for testing"""
1818

1919

20-
def _run_diffusion_method_test(method, G, input_scores, test_output_scores):
21-
"""Helper for test class."""
22-
computed_output_scores = diffuse(input_scores, method, graph=G)
20+
def _run_diffusion_method_test(method, g, input_scores, test_output_scores):
21+
"""Help for test class."""
22+
computed_output_scores = diffuse(input_scores, method, graph=g)
2323

2424
if isinstance(computed_output_scores, Matrix):
2525
computed_output_scores = computed_output_scores.mat
@@ -39,6 +39,7 @@ def _run_diffusion_method_test(method, G, input_scores, test_output_scores):
3939

4040
class DiffuseTest(unittest.TestCase):
4141
"""Test diffusion methods."""
42+
4243
graph = nx.read_gml(GML_FILE_EXAMPLE, label='id')
4344

4445
_run_diffusion_method_test('raw', graph, INPUT_SCORES, OUTPUT_RAW_SCORES)

0 commit comments

Comments
 (0)