Skip to content

Commit bf4ddd0

Browse files
Merge branch 'master' into fix-pigeonhole-bug
2 parents f605cfa + f944b91 commit bf4ddd0

File tree

17 files changed

+47
-51
lines changed

17 files changed

+47
-51
lines changed

.github/workflows/sphinx.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
python-version: 3.14
4040
allow-prereleases: true
4141
- run: uv sync --group=docs
42-
- uses: actions/configure-pages@v5
42+
- uses: actions/configure-pages@v6
4343
- run: uv run sphinx-build -c docs . docs/_build/html
4444
- uses: actions/upload-pages-artifact@v4
4545
with:

.pre-commit-config.yaml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,20 @@ repos:
1919
- id: auto-walrus
2020

2121
- repo: https://github.com/astral-sh/ruff-pre-commit
22-
rev: v0.14.14
22+
rev: v0.15.9
2323
hooks:
2424
- id: ruff-check
2525
- id: ruff-format
2626

2727
- repo: https://github.com/codespell-project/codespell
28-
rev: v2.4.1
28+
rev: v2.4.2
2929
hooks:
3030
- id: codespell
3131
additional_dependencies:
3232
- tomli
3333

3434
- repo: https://github.com/tox-dev/pyproject-fmt
35-
rev: v2.12.1
35+
rev: v2.21.0
3636
hooks:
3737
- id: pyproject-fmt
3838

@@ -45,19 +45,19 @@ repos:
4545
pass_filenames: false
4646

4747
- repo: https://github.com/abravalheri/validate-pyproject
48-
rev: v0.24.1
48+
rev: v0.25
4949
hooks:
5050
- id: validate-pyproject
5151

52-
- repo: https://github.com/pre-commit/mirrors-mypy
53-
rev: v1.19.1
54-
hooks:
55-
- id: mypy
56-
args:
57-
- --explicit-package-bases
58-
- --ignore-missing-imports
59-
- --install-types
60-
- --non-interactive
52+
# - repo: https://github.com/pre-commit/mirrors-mypy
53+
# rev: v1.20.0
54+
# hooks:
55+
# - id: mypy
56+
# args:
57+
# - --explicit-package-bases
58+
# - --ignore-missing-imports
59+
# - --install-types
60+
# - --non-interactive
6161

6262
- repo: https://github.com/pre-commit/mirrors-prettier
6363
rev: v4.0.0-alpha.8

digital_image_processing/filters/local_binary_pattern.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def get_neighbors_pixel(
1919

2020
try:
2121
return int(image[x_coordinate][y_coordinate] >= center)
22-
except (IndexError, TypeError):
22+
except IndexError, TypeError:
2323
return 0
2424

2525

divide_and_conquer/convex_hull.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def _construct_points(
124124
else:
125125
try:
126126
points.append(Point(p[0], p[1]))
127-
except (IndexError, TypeError):
127+
except IndexError, TypeError:
128128
print(
129129
f"Ignoring deformed point {p}. All points"
130130
" must have at least 2 coordinates."

dynamic_programming/catalan_numbers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def catalan_numbers(upper_limit: int) -> "list[int]":
7171
print(f"The Catalan numbers from 0 through {N} are:")
7272
print(catalan_numbers(N))
7373
print("Try another upper limit for the sequence: ", end="")
74-
except (NameError, ValueError):
74+
except NameError, ValueError:
7575
print("\n********* Invalid input, goodbye! ************\n")
7676

7777
import doctest

hashes/hamming_code.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ def emitter_converter(size_par, data):
118118
data_ord.append(None)
119119

120120
# Calculates parity
121-
qtd_bp = 0 # parity bit counter
122121
for bp in range(1, size_par + 1):
123122
# Bit counter one for a given parity
124123
cont_bo = 0
@@ -133,8 +132,6 @@ def emitter_converter(size_par, data):
133132
cont_bo += 1
134133
parity.append(cont_bo % 2)
135134

136-
qtd_bp += 1
137-
138135
# Mount the message
139136
cont_bp = 0 # parity bit counter
140137
for x in range(size_par + len(data)):
@@ -208,7 +205,6 @@ def receptor_converter(size_par, data):
208205
data_ord.append(None)
209206

210207
# Calculates parity
211-
qtd_bp = 0 # parity bit counter
212208
for bp in range(1, size_par + 1):
213209
# Bit counter one for a certain parity
214210
cont_bo = 0
@@ -222,8 +218,6 @@ def receptor_converter(size_par, data):
222218
cont_bo += 1
223219
parity.append(str(cont_bo % 2))
224220

225-
qtd_bp += 1
226-
227221
# Mount the message
228222
cont_bp = 0 # Parity bit counter
229223
for x in range(size_par + len(data_output)):

maths/greatest_common_divisor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def main():
7373
f"{greatest_common_divisor(num_1, num_2)}"
7474
)
7575
print(f"By iterative gcd({num_1}, {num_2}) = {gcd_by_iterative(num_1, num_2)}")
76-
except (IndexError, UnboundLocalError, ValueError):
76+
except IndexError, UnboundLocalError, ValueError:
7777
print("Wrong input")
7878

7979

project_euler/problem_002/sol4.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def solution(n: int = 4000000) -> int:
5656

5757
try:
5858
n = int(n)
59-
except (TypeError, ValueError):
59+
except TypeError, ValueError:
6060
raise TypeError("Parameter n must be int or castable to int.")
6161
if n <= 0:
6262
raise ValueError("Parameter n must be greater than or equal to one.")

project_euler/problem_003/sol1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def solution(n: int = 600851475143) -> int:
8080

8181
try:
8282
n = int(n)
83-
except (TypeError, ValueError):
83+
except TypeError, ValueError:
8484
raise TypeError("Parameter n must be int or castable to int.")
8585
if n <= 0:
8686
raise ValueError("Parameter n must be greater than or equal to one.")

project_euler/problem_003/sol2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def solution(n: int = 600851475143) -> int:
4444

4545
try:
4646
n = int(n)
47-
except (TypeError, ValueError):
47+
except TypeError, ValueError:
4848
raise TypeError("Parameter n must be int or castable to int.")
4949
if n <= 0:
5050
raise ValueError("Parameter n must be greater than or equal to one.")

0 commit comments

Comments
 (0)