Skip to content

Commit

Permalink
🚨 Manually fix
Browse files Browse the repository at this point in the history
  • Loading branch information
EarlMilktea committed Nov 1, 2024
1 parent 9498955 commit 9328828
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions graphix/gflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,8 +678,8 @@ def flow_from_pattern(pattern: Pattern) -> tuple[dict[int, set[int]], dict[int,
for n in layers[1][l]:
l_k[n] = l
lmax = max(l_k.values()) if l_k else 0
for node in l_k.keys():
l_k[node] = lmax - l_k[node] + 1
for node, layer in l_k.items():
l_k[node] = lmax - layer + 1

Check warning on line 682 in graphix/gflow.py

View check run for this annotation

Codecov / codecov/patch

graphix/gflow.py#L681-L682

Added lines #L681 - L682 were not covered by tests
for output_node in pattern.output_nodes:
l_k[output_node] = 0

Expand Down Expand Up @@ -728,8 +728,8 @@ def gflow_from_pattern(pattern: Pattern) -> tuple[dict[int, set[int]], dict[int,
for n in layers[1][l]:
l_k[n] = l
lmax = max(l_k.values()) if l_k else 0
for node in l_k.keys():
l_k[node] = lmax - l_k[node] + 1
for node, layer in l_k.keys():
l_k[node] = lmax - layer + 1

Check warning on line 732 in graphix/gflow.py

View check run for this annotation

Codecov / codecov/patch

graphix/gflow.py#L731-L732

Added lines #L731 - L732 were not covered by tests
for output_node in pattern.output_nodes:
l_k[output_node] = 0

Expand Down Expand Up @@ -955,8 +955,8 @@ def get_layers(l_k: dict[int, int]) -> tuple[int, dict[int, set[int]]]:
"""
d = get_min_depth(l_k)
layers = {k: set() for k in range(d + 1)}
for i in l_k.keys():
layers[l_k[i]] |= {i}
for i, li in l_k.items():
layers[li] |= {i}
return d, layers


Expand Down
2 changes: 1 addition & 1 deletion graphix/linalg.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ def backward_substitute(self, b) -> tuple[npt.NDArray, list[sp.Symbol]]:
rank = self.get_rank()
b = MatGF2(b)
x = list()
kernels = sp.symbols("x0:%d" % (self.data.shape[1] - rank))
kernels = sp.symbols(f"x0:{self.data.shape[1] - rank}")
for col in range(b.data.shape[1]):
x_col = list()
b_col = b.data[:, col]
Expand Down
8 changes: 4 additions & 4 deletions graphix/pattern.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,12 +309,12 @@ def fresh_node():
else:
raise ValueError(f"command {cmd} is invalid!")
nodes = dict()
for index in node_prop.keys():
for index, prop in node_prop.items():
if index in self.output_nodes:
node_prop[index]["is_output"] = True
prop["is_output"] = True
if index in self.input_nodes:
node_prop[index]["is_input"] = True
node = CommandNode(index, **node_prop[index])
prop["is_input"] = True
node = CommandNode(index, **prop)
nodes[index] = node
return LocalPattern(nodes, self.input_nodes, self.output_nodes, morder)

Expand Down

0 comments on commit 9328828

Please sign in to comment.