Skip to content

Commit 84287f1

Browse files
committed
fix: type for md5_bytes
1 parent 09ab141 commit 84287f1

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

pyrdf2vec/walkers/community.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import math
33
from collections import defaultdict
44
from hashlib import md5
5-
from typing import List, Set
5+
from typing import List, Optional, Set
66

77
import attr
88
import community
@@ -76,7 +76,13 @@ class CommunityWalker(Walker):
7676
type=float,
7777
validator=attr.validators.instance_of(float),
7878
)
79-
md5_bytes = attr.ib(kw_only=True, default=8, type=int, repr=False)
79+
80+
md5_bytes = attr.ib(
81+
kw_only=True,
82+
type=Optional[int],
83+
default=8,
84+
repr=False,
85+
)
8086

8187
resolution = attr.ib(
8288
kw_only=True,

pyrdf2vec/walkers/halk.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ class HALKWalker(RandomWalker):
5454
),
5555
)
5656

57-
md5_bytes = attr.ib(kw_only=True, default=8, type=int, repr=False)
58-
5957
def build_dictionary(
6058
self, walks: List[SWalk]
6159
) -> DefaultDict[str, Set[int]]:

pyrdf2vec/walkers/random.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from hashlib import md5
2-
from typing import List, Set
2+
from typing import List, Optional, Set
33

44
import attr
55

@@ -39,7 +39,12 @@ class RandomWalker(Walker):
3939
4040
"""
4141

42-
md5_bytes = attr.ib(kw_only=True, default=8, type=int, repr=False)
42+
md5_bytes = attr.ib(
43+
kw_only=True,
44+
type=Optional[int],
45+
default=8,
46+
repr=False,
47+
)
4348

4449
def _bfs(
4550
self, kg: KG, entity: Vertex, is_reverse: bool = False

pyrdf2vec/walkers/weisfeiler_lehman.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ class WLWalker(RandomWalker):
4646
4747
"""
4848

49-
md5_bytes = attr.ib(kw_only=True, default=8, type=int, repr=False)
50-
5149
wl_iterations = attr.ib(
5250
kw_only=True,
5351
default=4,

0 commit comments

Comments
 (0)