Skip to content

Commit b69635d

Browse files
committed
Merge branch 'master' into enable-ruff-PGH003-rule
2 parents d9b495a + f5bbea3 commit b69635d

File tree

18 files changed

+10
-8
lines changed

18 files changed

+10
-8
lines changed

data_structures/arrays/__init__.py

Whitespace-only changes.

data_structures/binary_tree/binary_search_tree.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ def inorder(curr_node: Node | None) -> list[Node]:
336336
"""
337337
node_list = []
338338
if curr_node is not None:
339-
node_list = inorder(curr_node.left) + [curr_node] + inorder(curr_node.right)
339+
node_list = [*inorder(curr_node.left), curr_node, *inorder(curr_node.right)]
340340
return node_list
341341

342342

data_structures/hashing/tests/__init__.py

Whitespace-only changes.

digital_image_processing/morphological_operations/__init__.py

Whitespace-only changes.

dynamic_programming/subset_generation.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def subset_combinations(elements: list[int], n: int) -> list:
4545
for i in range(1, r + 1):
4646
for j in range(i, 0, -1):
4747
for prev_combination in dp[j - 1]:
48-
dp[j].append(tuple(prev_combination) + (elements[i - 1],))
48+
dp[j].append((*prev_combination, elements[i - 1]))
4949

5050
try:
5151
return sorted(dp[n])

electronics/__init__.py

Whitespace-only changes.

electronics/circular_convolution.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ def circular_convolution(self) -> list[float]:
3737
using matrix method
3838
3939
Usage:
40-
>>> import circular_convolution as cc
41-
>>> convolution = cc.CircularConvolution()
40+
>>> convolution = CircularConvolution()
4241
>>> convolution.circular_convolution()
4342
[10, 10, 6, 14]
4443

fractals/__init__.py

Whitespace-only changes.

geometry/__init__.py

Whitespace-only changes.

greedy_methods/__init__.py

Whitespace-only changes.

linear_algebra/src/gaussian_elimination_pivoting/__init__.py

Whitespace-only changes.

linear_programming/__init__.py

Whitespace-only changes.

maths/numerical_analysis/__init__.py

Whitespace-only changes.

maths/odd_sieve.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def odd_sieve(num: int) -> list[int]:
3333
0, ceil((num - i_squared) / (i << 1))
3434
)
3535

36-
return [2] + list(compress(range(3, num, 2), sieve))
36+
return [2, *list(compress(range(3, num, 2), sieve))]
3737

3838

3939
if __name__ == "__main__":

maths/special_numbers/__init__.py

Whitespace-only changes.

neural_network/activation_functions/__init__.py

Whitespace-only changes.

neural_network/activation_functions/mish.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"""
88

99
import numpy as np
10-
from softplus import softplus
10+
11+
from .softplus import softplus
1112

1213

1314
def mish(vector: np.ndarray) -> np.ndarray:

pyproject.toml

+4-2
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ lint.ignore = [ # `ruff rule S101` for a description of that rule
66
"EM101", # Exception must not use a string literal, assign to variable first
77
"EXE001", # Shebang is present but file is not executable" -- FIX ME
88
"G004", # Logging statement uses f-string
9-
"INP001", # File `x/y/z.py` is part of an implicit namespace package. Add an `__init__.py`. -- FIX ME
109
"PLC1901", # `{}` can be simplified to `{}` as an empty string is falsey
1110
"PLW060", # Using global for `{name}` but no assignment is done -- DO NOT FIX
1211
"PLW2901", # PLW2901: Redefined loop variable -- FIX ME
1312
"PT011", # `pytest.raises(Exception)` is too broad, set the `match` parameter or use a more specific exception
1413
"PT018", # Assertion should be broken down into multiple parts
15-
"RUF00", # Ambiguous unicode character and other rules
14+
"RUF001", # String contains ambiguous {}. Did you mean {}?
15+
"RUF002", # Docstring contains ambiguous {}. Did you mean {}?
16+
"RUF003", # Comment contains ambiguous {}. Did you mean {}?
17+
"RUF007", # Prefer itertools.pairwise() over zip() when iterating over successive pairs
1618
"S101", # Use of `assert` detected -- DO NOT FIX
1719
"S113", # Probable use of requests call without timeout -- FIX ME
1820
"S311", # Standard pseudo-random generators are not suitable for cryptographic purposes -- FIX ME

0 commit comments

Comments
 (0)