Skip to content

Commit 0aa8e19

Browse files
committed
changed formating to match reqs.
1 parent f3bfc4f commit 0aa8e19

File tree

7 files changed

+24
-13
lines changed

7 files changed

+24
-13
lines changed

digital_image_processing/filters/gabor_filter.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ def gabor_filter_kernel(
4848
_y = -sin_theta * px + cos_theta * py
4949

5050
# fill kernel
51-
gabor[y, x] = np.exp(-(_x**2 + gamma**2 * _y**2) / (2 * sigma**2)) * np.cos(
52-
2 * np.pi * _x / lambd + psi
53-
)
51+
gabor[y, x] = np.exp(
52+
-(_x**2 + gamma**2 * _y**2) / (2 * sigma**2)
53+
) * np.cos(2 * np.pi * _x / lambd + psi)
5454

5555
return gabor
5656

graphs/directed_and_undirected_weighted_graph.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class DirectedGraph:
1010
def __init__(self):
1111
"""
1212
Initialize an empty directed graph.
13-
13+
1414
Example:
1515
>>> g = DirectedGraph()
1616
>>> g.graph
@@ -545,4 +545,5 @@ def bfs_time(self, s=-2):
545545

546546
if __name__ == "__main__":
547547
import doctest
548+
548549
doctest.testmod(verbose=True)

greedy_methods/fractional_knapsack.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,11 @@ def frac_knapsack(vl, wt, w, n):
3939
return (
4040
0
4141
if k == 0
42-
else sum(vl[:k]) + (w - acc[k - 1]) * (vl[k]) / (wt[k])
43-
if k != n
44-
else sum(vl[:k])
42+
else (
43+
sum(vl[:k]) + (w - acc[k - 1]) * (vl[k]) / (wt[k])
44+
if k != n
45+
else sum(vl[:k])
46+
)
4547
)
4648

4749

machine_learning/frequent_pattern_growth.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,9 @@ def ascend_tree(leaf_node: TreeNode, prefix_path: list[str]) -> None:
240240
ascend_tree(leaf_node.parent, prefix_path)
241241

242242

243-
def find_prefix_path(base_pat: frozenset, tree_node: TreeNode | None) -> dict: # noqa: ARG001
243+
def find_prefix_path(
244+
base_pat: frozenset, tree_node: TreeNode | None
245+
) -> dict: # noqa: ARG001
244246
"""
245247
Find the conditional pattern base for a given base pattern.
246248

matrix/matrix_class.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,11 @@ def cofactors(self) -> Matrix:
204204
return Matrix(
205205
[
206206
[
207-
self.minors().rows[row][column]
208-
if (row + column) % 2 == 0
209-
else self.minors().rows[row][column] * -1
207+
(
208+
self.minors().rows[row][column]
209+
if (row + column) % 2 == 0
210+
else self.minors().rows[row][column] * -1
211+
)
210212
for column in range(self.minors().num_columns)
211213
]
212214
for row in range(self.minors().num_rows)

sorts/bead_sort.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ def bead_sort(sequence: list) -> list:
3131
if any(not isinstance(x, int) or x < 0 for x in sequence):
3232
raise TypeError("Sequence must be list of non-negative integers")
3333
for _ in range(len(sequence)):
34-
for i, (rod_upper, rod_lower) in enumerate(zip(sequence, sequence[1:])): # noqa: RUF007
34+
for i, (rod_upper, rod_lower) in enumerate(
35+
zip(sequence, sequence[1:])
36+
): # noqa: RUF007
3537
if rod_upper > rod_lower:
3638
sequence[i] -= rod_upper - rod_lower
3739
sequence[i + 1] += rod_upper - rod_lower

strings/min_cost_string_conversion.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,9 @@ def assemble_transformation(ops: list[list[str]], i: int, j: int) -> list[str]:
132132
elif op[0] == "R":
133133
string[i] = op[2]
134134

135-
file.write("%-16s" % ("Replace %c" % op[1] + " with " + str(op[2]))) # noqa: UP031
135+
file.write(
136+
"%-16s" % ("Replace %c" % op[1] + " with " + str(op[2]))
137+
) # noqa: UP031
136138
file.write("\t\t" + "".join(string))
137139
file.write("\r\n")
138140

0 commit comments

Comments
 (0)