From dd17a258bec6a8a1ab9f28749092deb918791bb2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 3 Oct 2022 19:21:24 +0000 Subject: [PATCH 1/9] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 22.6.0 → 22.8.0](https://github.com/psf/black/compare/22.6.0...22.8.0) - [github.com/asottile/pyupgrade: v2.37.0 → v2.38.2](https://github.com/asottile/pyupgrade/compare/v2.37.0...v2.38.2) - https://gitlab.com/pycqa/flake8 → https://github.com/PyCQA/flake8 - [github.com/PyCQA/flake8: 3.9.2 → 5.0.4](https://github.com/PyCQA/flake8/compare/3.9.2...5.0.4) - [github.com/pre-commit/mirrors-mypy: v0.961 → v0.981](https://github.com/pre-commit/mirrors-mypy/compare/v0.961...v0.981) - [github.com/codespell-project/codespell: v2.1.0 → v2.2.1](https://github.com/codespell-project/codespell/compare/v2.1.0...v2.2.1) --- .pre-commit-config.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 325063c3b8a5..6cfe848553c8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 @@ -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: @@ -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: @@ -52,7 +52,7 @@ repos: additional_dependencies: [types-requests] - repo: https://github.com/codespell-project/codespell - rev: v2.1.0 + rev: v2.2.1 hooks: - id: codespell args: From f5444d78748ba6949fabdb01c29952082d49b9fc Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 3 Oct 2022 21:34:57 +0200 Subject: [PATCH 2/9] Fix a long line --- web_programming/download_images_from_google_query.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web_programming/download_images_from_google_query.py b/web_programming/download_images_from_google_query.py index b11a7f883085..9c0c21dc804e 100644 --- a/web_programming/download_images_from_google_query.py +++ b/web_programming/download_images_from_google_query.py @@ -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 From 24f37ec7118f030b6251a538f67a4d6386be96e5 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 3 Oct 2022 21:38:45 +0200 Subject: [PATCH 3/9] Update sol1.py --- project_euler/problem_113/sol1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project_euler/problem_113/sol1.py b/project_euler/problem_113/sol1.py index 951d9b49c104..2077c0fa62f3 100644 --- a/project_euler/problem_113/sol1.py +++ b/project_euler/problem_113/sol1.py @@ -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) From 899010ebdb585a80df96dde1c9d3b3bcff3d25fc Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 3 Oct 2022 21:41:07 +0200 Subject: [PATCH 4/9] Update sol1.py --- project_euler/problem_045/sol1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project_euler/problem_045/sol1.py b/project_euler/problem_045/sol1.py index cdf5c14cf362..d921b2802c2d 100644 --- a/project_euler/problem_045/sol1.py +++ b/project_euler/problem_045/sol1.py @@ -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. """ From 7fcb3fcf9a9c678cfb169c6e067dfbd0be188d63 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 3 Oct 2022 21:45:27 +0200 Subject: [PATCH 5/9] lambda_ --- linear_algebra/src/power_iteration.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/linear_algebra/src/power_iteration.py b/linear_algebra/src/power_iteration.py index 4c6525b6e4af..4b866331b8e3 100644 --- a/linear_algebra/src/power_iteration.py +++ b/linear_algebra/src/power_iteration.py @@ -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 @@ -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: From b9497c5cd8c19cb6879f05b2c366dab6f09c7a46 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 3 Oct 2022 21:47:34 +0200 Subject: [PATCH 6/9] Update multi_level_feedback_queue.py --- scheduling/multi_level_feedback_queue.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduling/multi_level_feedback_queue.py b/scheduling/multi_level_feedback_queue.py index 95ca827e062d..b54cc8719039 100644 --- a/scheduling/multi_level_feedback_queue.py +++ b/scheduling/multi_level_feedback_queue.py @@ -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()}" ) From 83d47d7391ab4e6a2cf721f976c9daa5f1c7367a Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 3 Oct 2022 21:48:55 +0200 Subject: [PATCH 7/9] Update double_ended_queue.py --- data_structures/queue/double_ended_queue.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data_structures/queue/double_ended_queue.py b/data_structures/queue/double_ended_queue.py index 1603e50bc7f2..f38874788df1 100644 --- a/data_structures/queue/double_ended_queue.py +++ b/data_structures/queue/double_ended_queue.py @@ -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 From ea79cfabaca8799256c85fc90ccf1f346bc10520 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 3 Oct 2022 21:50:03 +0200 Subject: [PATCH 8/9] Update sequential_minimum_optimization.py --- machine_learning/sequential_minimum_optimization.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/machine_learning/sequential_minimum_optimization.py b/machine_learning/sequential_minimum_optimization.py index c217a370a975..cc7868d0fd8e 100644 --- a/machine_learning/sequential_minimum_optimization.py +++ b/machine_learning/sequential_minimum_optimization.py @@ -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]: From 6f67cc9773a586001e0057ab1ac701df34a3bb27 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 3 Oct 2022 21:52:18 +0200 Subject: [PATCH 9/9] Update .pre-commit-config.yaml --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6cfe848553c8..a2fcf12c9bbd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -56,7 +56,7 @@ repos: 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)^(