changed formating to match reqs.

This commit is contained in:
zirtidik 2024-12-03 18:41:24 -05:00
parent f3bfc4f5a7
commit 0aa8e1912c
7 changed files with 24 additions and 13 deletions

View File

@ -48,9 +48,9 @@ def gabor_filter_kernel(
_y = -sin_theta * px + cos_theta * py _y = -sin_theta * px + cos_theta * py
# fill kernel # fill kernel
gabor[y, x] = np.exp(-(_x**2 + gamma**2 * _y**2) / (2 * sigma**2)) * np.cos( gabor[y, x] = np.exp(
2 * np.pi * _x / lambd + psi -(_x**2 + gamma**2 * _y**2) / (2 * sigma**2)
) ) * np.cos(2 * np.pi * _x / lambd + psi)
return gabor return gabor

View File

@ -10,7 +10,7 @@ class DirectedGraph:
def __init__(self): def __init__(self):
""" """
Initialize an empty directed graph. Initialize an empty directed graph.
Example: Example:
>>> g = DirectedGraph() >>> g = DirectedGraph()
>>> g.graph >>> g.graph
@ -545,4 +545,5 @@ class Graph:
if __name__ == "__main__": if __name__ == "__main__":
import doctest import doctest
doctest.testmod(verbose=True) doctest.testmod(verbose=True)

View File

@ -39,9 +39,11 @@ def frac_knapsack(vl, wt, w, n):
return ( return (
0 0
if k == 0 if k == 0
else sum(vl[:k]) + (w - acc[k - 1]) * (vl[k]) / (wt[k]) else (
if k != n sum(vl[:k]) + (w - acc[k - 1]) * (vl[k]) / (wt[k])
else sum(vl[:k]) if k != n
else sum(vl[:k])
)
) )

View File

@ -240,7 +240,9 @@ def ascend_tree(leaf_node: TreeNode, prefix_path: list[str]) -> None:
ascend_tree(leaf_node.parent, prefix_path) ascend_tree(leaf_node.parent, prefix_path)
def find_prefix_path(base_pat: frozenset, tree_node: TreeNode | None) -> dict: # noqa: ARG001 def find_prefix_path(
base_pat: frozenset, tree_node: TreeNode | None
) -> dict: # noqa: ARG001
""" """
Find the conditional pattern base for a given base pattern. Find the conditional pattern base for a given base pattern.

View File

@ -204,9 +204,11 @@ class Matrix:
return Matrix( return Matrix(
[ [
[ [
self.minors().rows[row][column] (
if (row + column) % 2 == 0 self.minors().rows[row][column]
else self.minors().rows[row][column] * -1 if (row + column) % 2 == 0
else self.minors().rows[row][column] * -1
)
for column in range(self.minors().num_columns) for column in range(self.minors().num_columns)
] ]
for row in range(self.minors().num_rows) for row in range(self.minors().num_rows)

View File

@ -31,7 +31,9 @@ def bead_sort(sequence: list) -> list:
if any(not isinstance(x, int) or x < 0 for x in sequence): if any(not isinstance(x, int) or x < 0 for x in sequence):
raise TypeError("Sequence must be list of non-negative integers") raise TypeError("Sequence must be list of non-negative integers")
for _ in range(len(sequence)): for _ in range(len(sequence)):
for i, (rod_upper, rod_lower) in enumerate(zip(sequence, sequence[1:])): # noqa: RUF007 for i, (rod_upper, rod_lower) in enumerate(
zip(sequence, sequence[1:])
): # noqa: RUF007
if rod_upper > rod_lower: if rod_upper > rod_lower:
sequence[i] -= rod_upper - rod_lower sequence[i] -= rod_upper - rod_lower
sequence[i + 1] += rod_upper - rod_lower sequence[i + 1] += rod_upper - rod_lower

View File

@ -132,7 +132,9 @@ if __name__ == "__main__":
elif op[0] == "R": elif op[0] == "R":
string[i] = op[2] string[i] = op[2]
file.write("%-16s" % ("Replace %c" % op[1] + " with " + str(op[2]))) # noqa: UP031 file.write(
"%-16s" % ("Replace %c" % op[1] + " with " + str(op[2]))
) # noqa: UP031
file.write("\t\t" + "".join(string)) file.write("\t\t" + "".join(string))
file.write("\r\n") file.write("\r\n")