Skip to content

[pre-commit.ci] pre-commit autoupdate #6629

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Oct 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repos:
- id: requirements-txt-fixer

- repo: https://github.com/psf/black
rev: 22.6.0
rev: 22.8.0
hooks:
- id: black

Expand All @@ -26,14 +26,14 @@ repos:
- --profile=black

- repo: https://github.com/asottile/pyupgrade
rev: v2.37.0
rev: v2.38.2
hooks:
- id: pyupgrade
args:
- --py310-plus

- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
hooks:
- id: flake8
args:
Expand All @@ -42,7 +42,7 @@ repos:
- --max-line-length=88

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.961
rev: v0.981
hooks:
- id: mypy
args:
Expand All @@ -52,11 +52,11 @@ repos:
additional_dependencies: [types-requests]

- repo: https://github.com/codespell-project/codespell
rev: v2.1.0
rev: v2.2.1
hooks:
- id: codespell
args:
- --ignore-words-list=ans,crate,fo,followings,hist,iff,mater,secant,som,sur,tim
- --ignore-words-list=ans,crate,damon,fo,followings,hist,iff,mater,secant,som,sur,tim,zar
- --skip="./.*,./strings/dictionary.txt,./strings/words.txt,./project_euler/problem_022/p022_names.txt"
exclude: |
(?x)^(
Expand Down
2 changes: 1 addition & 1 deletion data_structures/queue/double_ended_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ def __eq__(self, other: object) -> bool:
me = self._front
oth = other._front

# if the length of the deques are not the same, they are not equal
# if the length of the dequeues are not the same, they are not equal
if len(self) != len(other):
return False

Expand Down
12 changes: 6 additions & 6 deletions linear_algebra/src/power_iteration.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def power_iteration(
# or when we have small changes from one iteration to next.

convergence = False
lamda_previous = 0
lambda_previous = 0
iterations = 0
error = 1e12

Expand All @@ -64,21 +64,21 @@ def power_iteration(
# Find rayleigh quotient
# (faster than usual b/c we know vector is normalized already)
vectorH = vector.conj().T if is_complex else vector.T
lamda = np.dot(vectorH, np.dot(input_matrix, vector))
lambda_ = np.dot(vectorH, np.dot(input_matrix, vector))

# Check convergence.
error = np.abs(lamda - lamda_previous) / lamda
error = np.abs(lambda_ - lambda_previous) / lambda_
iterations += 1

if error <= error_tol or iterations >= max_iterations:
convergence = True

lamda_previous = lamda
lambda_previous = lambda_

if is_complex:
lamda = np.real(lamda)
lambda_ = np.real(lambda_)

return lamda, vector
return lambda_, vector


def test_power_iteration() -> None:
Expand Down
2 changes: 1 addition & 1 deletion machine_learning/sequential_minimum_optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def fit(self):
if self._is_unbound(i2):
self._error[i2] = 0

# Predict test samles
# Predict test samples
def predict(self, test_samples, classify=True):

if test_samples.shape[1] > self.samples.shape[1]:
Expand Down
2 changes: 1 addition & 1 deletion project_euler/problem_045/sol1.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
It can be verified that T(285) = P(165) = H(143) = 40755.

Find the next triangle number that is also pentagonal and hexagonal.
All trinagle numbers are hexagonal numbers.
All triangle numbers are hexagonal numbers.
T(2n-1) = n * (2 * n - 1) = H(n)
So we shall check only for hexagonal numbers which are also pentagonal.
"""
Expand Down
2 changes: 1 addition & 1 deletion project_euler/problem_113/sol1.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def non_bouncy_upto(n: int) -> int:

def solution(num_digits: int = 100) -> int:
"""
Caclulate the number of non-bouncy numbers less than a googol.
Calculate the number of non-bouncy numbers less than a googol.
>>> solution(6)
12951
>>> solution(10)
Expand Down
2 changes: 1 addition & 1 deletion scheduling/multi_level_feedback_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,6 @@ def multi_level_feedback_queue(self) -> deque[Process]:
)
# print sequence of finished processes
print(
f"sequnece of finished processes:\
f"sequence of finished processes:\
{mlfq.calculate_sequence_of_finish_queue()}"
)
3 changes: 2 additions & 1 deletion web_programming/download_images_from_google_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@


def download_images_from_google_query(query: str = "dhaka", max_images: int = 5) -> int:
"""Searches google using the provided query term and downloads the images in a folder.
"""
Searches google using the provided query term and downloads the images in a folder.

Args:
query : The image search term to be provided by the user. Defaults to
Expand Down