Skip to content

Commit a0a8322

Browse files
github-actionsgithub-actions
github-actions
authored and
github-actions
committed
fixup! Format Python code with psf/black push
1 parent 8f7c19a commit a0a8322

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

other/markov_chain.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44

55

66
class MarkovChainGraphUndirectedUnweighted:
7-
'''
7+
"""
88
Undirected Unweighted Graph for running Markov Chain Algorithm
9-
'''
9+
"""
1010

1111
def __init__(self):
1212
self.connections = {}
1313

1414
def add_node(self, node: str) -> None:
1515
self.connections[node] = {}
1616

17-
def add_transition_probability(self, node1: str,
18-
node2: str,
19-
probability: float) -> None:
17+
def add_transition_probability(
18+
self, node1: str, node2: str, probability: float
19+
) -> None:
2020
if node1 not in self.connections:
2121
self.add_node(node1)
2222
if node2 not in self.connections:
@@ -36,10 +36,10 @@ def transition(self, node: str) -> str:
3636
return dest
3737

3838

39-
def get_transitions(start: str,
40-
transitions: List[Tuple[str, str, float]],
41-
steps: int) -> Dict[str, int]:
42-
'''
39+
def get_transitions(
40+
start: str, transitions: List[Tuple[str, str, float]], steps: int
41+
) -> Dict[str, int]:
42+
"""
4343
Running Markov Chain algorithm and calculating the number of times each node is
4444
visited
4545
@@ -59,7 +59,7 @@ def get_transitions(start: str,
5959
6060
>>> result['a'] > result['b'] > result['c']
6161
True
62-
'''
62+
"""
6363

6464
graph = MarkovChainGraphUndirectedUnweighted()
6565

0 commit comments

Comments
 (0)