Skip to content

Commit 21b38c2

Browse files
committed
style: fix linter
1 parent b633093 commit 21b38c2

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

pyrdf2vec/walkers/anonymous.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ class AnonymousWalker(RandomWalker):
2929
Defaults to UniformSampler.
3030
with_reverse: True to extracts parents and children hops from an
3131
entity, creating (max_walks * max_walks) more walks of 2 * depth,
32-
allowing also to centralize this entity in the walks. False otherwise.
32+
allowing also to centralize this entity in the walks. False
33+
otherwise.
3334
Defaults to False.
3435
3536
"""

pyrdf2vec/walkers/halk.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ def _extract(self, kg: KG, entity: Vertex) -> EntityWalks:
114114
"""
115115
return super()._extract(kg, entity)
116116

117+
# flake8: noqa: C901
117118
def _post_extract(self, res: List[EntityWalks]) -> List[List[SWalk]]:
118119
"""Post processed walks.
119120

pyrdf2vec/walkers/split.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import os
21
import re
32
from typing import Set
43

@@ -50,6 +49,7 @@ def __attrs_post_init__(self):
5049
if self.func_split is None:
5150
self.func_split = self.basic_split
5251

52+
# flake8: noqa: C901
5353
def basic_split(self, walks: List[Walk]) -> Set[SWalk]:
5454
"""Splits vertices of random walks for an entity based. To achieve
5555
this, each vertex (except the root node) is split according to symbols
@@ -77,8 +77,10 @@ def basic_split(self, walks: List[Walk]) -> Set[SWalk]:
7777
"""
7878
canonical_walks: Set[SWalk] = set()
7979
for walk in walks:
80-
tmp_vertices = []
81-
canonical_walk = [] if self.with_reverse else [walk[0].name]
80+
tmp_vertices = [] # type: ignore
81+
canonical_walk = []
82+
if self.with_reverse:
83+
canonical_walk = [walk[0].name]
8284
for i, _ in enumerate(walk[1::], 1):
8385
vertices = []
8486
if "http" in walk[i].name:

0 commit comments

Comments
 (0)