Add pep8-naming to pre-commit hooks and fixes incorrect naming conventions (#7062)

* ci(pre-commit): Add pep8-naming to `pre-commit` hooks (#7038)

* refactor: Fix naming conventions (#7038)

* Update arithmetic_analysis/lu_decomposition.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* refactor(lu_decomposition): Replace `NDArray` with `ArrayLike` (#7038)

* chore: Fix naming conventions in doctests (#7038)

* fix: Temporarily disable project euler problem 104 (#7069)

* chore: Fix naming conventions in doctests (#7038)

Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Caeden
2022-10-12 23:54:20 +01:00
committed by GitHub
parent e2cd982b11
commit 07e991d553
140 changed files with 1552 additions and 1536 deletions

View File

@@ -7,7 +7,7 @@
from __future__ import annotations
def CeilIndex(v, l, r, key): # noqa: E741
def ceil_index(v, l, r, key): # noqa: E741
while r - l > 1:
m = (l + r) // 2
if v[m] >= key:
@@ -17,16 +17,16 @@ def CeilIndex(v, l, r, key): # noqa: E741
return r
def LongestIncreasingSubsequenceLength(v: list[int]) -> int:
def longest_increasing_subsequence_length(v: list[int]) -> int:
"""
>>> LongestIncreasingSubsequenceLength([2, 5, 3, 7, 11, 8, 10, 13, 6])
>>> longest_increasing_subsequence_length([2, 5, 3, 7, 11, 8, 10, 13, 6])
6
>>> LongestIncreasingSubsequenceLength([])
>>> longest_increasing_subsequence_length([])
0
>>> LongestIncreasingSubsequenceLength([0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3,
... 11, 7, 15])
>>> longest_increasing_subsequence_length([0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13,
... 3, 11, 7, 15])
6
>>> LongestIncreasingSubsequenceLength([5, 4, 3, 2, 1])
>>> longest_increasing_subsequence_length([5, 4, 3, 2, 1])
1
"""
if len(v) == 0:
@@ -44,7 +44,7 @@ def LongestIncreasingSubsequenceLength(v: list[int]) -> int:
tail[length] = v[i]
length += 1
else:
tail[CeilIndex(tail, -1, length - 1, v[i])] = v[i]
tail[ceil_index(tail, -1, length - 1, v[i])] = v[i]
return length