Skip to content

Commit 485661f

Browse files
committed
Merge remote-tracking branch 'upstream/master' into mypy-fix-other-lru_cache
2 parents 3412ffa + 7e81551 commit 485661f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+35403
-298
lines changed

Diff for: .github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
run: |
2222
python -m pip install --upgrade pip setuptools six wheel
2323
python -m pip install mypy pytest-cov -r requirements.txt
24-
- run: mypy --install-types --non-interactive .
24+
- run: mypy . # See `mypy.ini` for configuration settings.
2525
- name: Run tests
2626
run: pytest --doctest-modules --ignore=project_euler/ --ignore=scripts/validate_solutions.py --cov-report=term-missing:skip-covered --cov=. .
2727
- if: ${{ success() }}

Diff for: CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ __Improving comments__ and __writing proper tests__ are also highly welcome.
2323

2424
We appreciate any contribution, from fixing a grammar mistake in a comment to implementing complex algorithms. Please read this section if you are contributing your work.
2525

26-
Your contribution will be tested by our [automated testing on Travis CI](https://travis-ci.org/TheAlgorithms/Python/pull_requests) to save time and mental energy. After you have submitted your pull request, you should see the Travis tests start to run at the bottom of your submission page. If those tests fail, then click on the ___details___ button try to read through the Travis output to understand the failure. If you do not understand, please leave a comment on your submission page and a community member will try to help.
26+
Your contribution will be tested by our [automated testing on GitHub Actions](https://github.com/TheAlgorithms/Python/actions) to save time and mental energy. After you have submitted your pull request, you should see the GitHub Actions tests start to run at the bottom of your submission page. If those tests fail, then click on the ___details___ button try to read through the GitHub Actions output to understand the failure. If you do not understand, please leave a comment on your submission page and a community member will try to help.
2727

2828
Please help us keep our issue list small by adding fixes: #{$ISSUE_NO} to the commit message of pull requests that resolve open issues. GitHub will use this tag to auto-close the issue when the PR is merged.
2929

@@ -170,7 +170,7 @@ We want your work to be readable by others; therefore, we encourage you to note
170170
- If possible, follow the standard *within* the folder you are submitting to.
171171
- If you have modified/added code work, make sure the code compiles before submitting.
172172
- If you have modified/added documentation work, ensure your language is concise and contains no grammar errors.
173-
- Do not update the README.md or DIRECTORY.md file which will be periodically autogenerated by our Travis CI processes.
173+
- Do not update the README.md or DIRECTORY.md file which will be periodically autogenerated by our GitHub Actions processes.
174174
- Add a corresponding explanation to [Algorithms-Explanation](https://github.com/TheAlgorithms/Algorithms-Explanation) (Optional but recommended).
175175
- All submissions will be tested with [__mypy__](http://www.mypy-lang.org) so we encourage you to add [__Python type hints__](https://docs.python.org/3/library/typing.html) where it makes sense to do so.
176176

Diff for: DIRECTORY.md

+16-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* [Gaussian Elimination](https://github.com/TheAlgorithms/Python/blob/master/arithmetic_analysis/gaussian_elimination.py)
55
* [In Static Equilibrium](https://github.com/TheAlgorithms/Python/blob/master/arithmetic_analysis/in_static_equilibrium.py)
66
* [Intersection](https://github.com/TheAlgorithms/Python/blob/master/arithmetic_analysis/intersection.py)
7+
* [Jacobi Iteration Method](https://github.com/TheAlgorithms/Python/blob/master/arithmetic_analysis/jacobi_iteration_method.py)
78
* [Lu Decomposition](https://github.com/TheAlgorithms/Python/blob/master/arithmetic_analysis/lu_decomposition.py)
89
* [Newton Forward Interpolation](https://github.com/TheAlgorithms/Python/blob/master/arithmetic_analysis/newton_forward_interpolation.py)
910
* [Newton Method](https://github.com/TheAlgorithms/Python/blob/master/arithmetic_analysis/newton_method.py)
@@ -39,6 +40,7 @@
3940
* [Binary Xor Operator](https://github.com/TheAlgorithms/Python/blob/master/bit_manipulation/binary_xor_operator.py)
4041
* [Count 1S Brian Kernighan Method](https://github.com/TheAlgorithms/Python/blob/master/bit_manipulation/count_1s_brian_kernighan_method.py)
4142
* [Count Number Of One Bits](https://github.com/TheAlgorithms/Python/blob/master/bit_manipulation/count_number_of_one_bits.py)
43+
* [Gray Code Sequence](https://github.com/TheAlgorithms/Python/blob/master/bit_manipulation/gray_code_sequence.py)
4244
* [Reverse Bits](https://github.com/TheAlgorithms/Python/blob/master/bit_manipulation/reverse_bits.py)
4345
* [Single Bit Manipulation Operations](https://github.com/TheAlgorithms/Python/blob/master/bit_manipulation/single_bit_manipulation_operations.py)
4446

@@ -63,7 +65,7 @@
6365
* [Baconian Cipher](https://github.com/TheAlgorithms/Python/blob/master/ciphers/baconian_cipher.py)
6466
* [Base16](https://github.com/TheAlgorithms/Python/blob/master/ciphers/base16.py)
6567
* [Base32](https://github.com/TheAlgorithms/Python/blob/master/ciphers/base32.py)
66-
* [Base64 Encoding](https://github.com/TheAlgorithms/Python/blob/master/ciphers/base64_encoding.py)
68+
* [Base64](https://github.com/TheAlgorithms/Python/blob/master/ciphers/base64.py)
6769
* [Base85](https://github.com/TheAlgorithms/Python/blob/master/ciphers/base85.py)
6870
* [Beaufort Cipher](https://github.com/TheAlgorithms/Python/blob/master/ciphers/beaufort_cipher.py)
6971
* [Bifid](https://github.com/TheAlgorithms/Python/blob/master/ciphers/bifid.py)
@@ -108,8 +110,10 @@
108110

109111
## Computer Vision
110112
* [Cnn Classification](https://github.com/TheAlgorithms/Python/blob/master/computer_vision/cnn_classification.py)
113+
* [Flip Augmentation](https://github.com/TheAlgorithms/Python/blob/master/computer_vision/flip_augmentation.py)
111114
* [Harris Corner](https://github.com/TheAlgorithms/Python/blob/master/computer_vision/harris_corner.py)
112115
* [Mean Threshold](https://github.com/TheAlgorithms/Python/blob/master/computer_vision/mean_threshold.py)
116+
* [Mosaic Augmentation](https://github.com/TheAlgorithms/Python/blob/master/computer_vision/mosaic_augmentation.py)
113117

114118
## Conversions
115119
* [Binary To Decimal](https://github.com/TheAlgorithms/Python/blob/master/conversions/binary_to_decimal.py)
@@ -219,6 +223,7 @@
219223
* Filters
220224
* [Bilateral Filter](https://github.com/TheAlgorithms/Python/blob/master/digital_image_processing/filters/bilateral_filter.py)
221225
* [Convolve](https://github.com/TheAlgorithms/Python/blob/master/digital_image_processing/filters/convolve.py)
226+
* [Gabor Filter](https://github.com/TheAlgorithms/Python/blob/master/digital_image_processing/filters/gabor_filter.py)
222227
* [Gaussian Filter](https://github.com/TheAlgorithms/Python/blob/master/digital_image_processing/filters/gaussian_filter.py)
223228
* [Median Filter](https://github.com/TheAlgorithms/Python/blob/master/digital_image_processing/filters/median_filter.py)
224229
* [Sobel Filter](https://github.com/TheAlgorithms/Python/blob/master/digital_image_processing/filters/sobel_filter.py)
@@ -251,6 +256,7 @@
251256

252257
## Dynamic Programming
253258
* [Abbreviation](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/abbreviation.py)
259+
* [All Construct](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/all_construct.py)
254260
* [Bitmask](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/bitmask.py)
255261
* [Catalan Numbers](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/catalan_numbers.py)
256262
* [Climbing Stairs](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/climbing_stairs.py)
@@ -294,6 +300,7 @@
294300
* [Test Send File](https://github.com/TheAlgorithms/Python/blob/master/file_transfer/tests/test_send_file.py)
295301

296302
## Financial
303+
* [Equated Monthly Installments](https://github.com/TheAlgorithms/Python/blob/master/financial/equated_monthly_installments.py)
297304
* [Interest](https://github.com/TheAlgorithms/Python/blob/master/financial/interest.py)
298305

299306
## Fractals
@@ -511,6 +518,7 @@
511518
* [Modular Exponential](https://github.com/TheAlgorithms/Python/blob/master/maths/modular_exponential.py)
512519
* [Monte Carlo](https://github.com/TheAlgorithms/Python/blob/master/maths/monte_carlo.py)
513520
* [Monte Carlo Dice](https://github.com/TheAlgorithms/Python/blob/master/maths/monte_carlo_dice.py)
521+
* [Nevilles Method](https://github.com/TheAlgorithms/Python/blob/master/maths/nevilles_method.py)
514522
* [Newton Raphson](https://github.com/TheAlgorithms/Python/blob/master/maths/newton_raphson.py)
515523
* [Number Of Digits](https://github.com/TheAlgorithms/Python/blob/master/maths/number_of_digits.py)
516524
* [Numerical Integration](https://github.com/TheAlgorithms/Python/blob/master/maths/numerical_integration.py)
@@ -546,6 +554,7 @@
546554
* [Sieve Of Eratosthenes](https://github.com/TheAlgorithms/Python/blob/master/maths/sieve_of_eratosthenes.py)
547555
* [Sigmoid](https://github.com/TheAlgorithms/Python/blob/master/maths/sigmoid.py)
548556
* [Simpson Rule](https://github.com/TheAlgorithms/Python/blob/master/maths/simpson_rule.py)
557+
* [Sock Merchant](https://github.com/TheAlgorithms/Python/blob/master/maths/sock_merchant.py)
549558
* [Softmax](https://github.com/TheAlgorithms/Python/blob/master/maths/softmax.py)
550559
* [Square Root](https://github.com/TheAlgorithms/Python/blob/master/maths/square_root.py)
551560
* [Sum Of Arithmetic Series](https://github.com/TheAlgorithms/Python/blob/master/maths/sum_of_arithmetic_series.py)
@@ -608,6 +617,7 @@
608617

609618
## Physics
610619
* [N Body Simulation](https://github.com/TheAlgorithms/Python/blob/master/physics/n_body_simulation.py)
620+
* [Newtons Second Law Of Motion](https://github.com/TheAlgorithms/Python/blob/master/physics/newtons_second_law_of_motion.py)
611621

612622
## Project Euler
613623
* Problem 001
@@ -844,6 +854,8 @@
844854
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_135/sol1.py)
845855
* Problem 144
846856
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_144/sol1.py)
857+
* Problem 145
858+
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_145/sol1.py)
847859
* Problem 173
848860
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_173/sol1.py)
849861
* Problem 174
@@ -856,6 +868,8 @@
856868
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_191/sol1.py)
857869
* Problem 203
858870
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_203/sol1.py)
871+
* Problem 205
872+
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_205/sol1.py)
859873
* Problem 206
860874
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_206/sol1.py)
861875
* Problem 207
@@ -1014,6 +1028,7 @@
10141028
* [Nasa Data](https://github.com/TheAlgorithms/Python/blob/master/web_programming/nasa_data.py)
10151029
* [Random Anime Character](https://github.com/TheAlgorithms/Python/blob/master/web_programming/random_anime_character.py)
10161030
* [Recaptcha Verification](https://github.com/TheAlgorithms/Python/blob/master/web_programming/recaptcha_verification.py)
1031+
* [Reddit](https://github.com/TheAlgorithms/Python/blob/master/web_programming/reddit.py)
10171032
* [Search Books By Isbn](https://github.com/TheAlgorithms/Python/blob/master/web_programming/search_books_by_isbn.py)
10181033
* [Slack Message](https://github.com/TheAlgorithms/Python/blob/master/web_programming/slack_message.py)
10191034
* [Test Fetch Github Info](https://github.com/TheAlgorithms/Python/blob/master/web_programming/test_fetch_github_info.py)

Diff for: arithmetic_analysis/README.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Arithmetic analysis
2+
3+
Arithmetic analysis is a branch of mathematics that deals with solving linear equations.
4+
5+
* <https://en.wikipedia.org/wiki/System_of_linear_equations>
6+
* <https://en.wikipedia.org/wiki/Gaussian_elimination>
7+
* <https://en.wikipedia.org/wiki/Root-finding_algorithms>

Diff for: arithmetic_analysis/jacobi_iteration_method.py

+163
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
"""
2+
Jacobi Iteration Method - https://en.wikipedia.org/wiki/Jacobi_method
3+
"""
4+
from __future__ import annotations
5+
6+
import numpy as np
7+
8+
9+
# Method to find solution of system of linear equations
10+
def jacobi_iteration_method(
11+
coefficient_matrix: np.ndarray,
12+
constant_matrix: np.ndarray,
13+
init_val: list,
14+
iterations: int,
15+
) -> list[float]:
16+
"""
17+
Jacobi Iteration Method:
18+
An iterative algorithm to determine the solutions of strictly diagonally dominant
19+
system of linear equations
20+
21+
4x1 + x2 + x3 = 2
22+
x1 + 5x2 + 2x3 = -6
23+
x1 + 2x2 + 4x3 = -4
24+
25+
x_init = [0.5, -0.5 , -0.5]
26+
27+
Examples:
28+
29+
>>> coefficient = np.array([[4, 1, 1], [1, 5, 2], [1, 2, 4]])
30+
>>> constant = np.array([[2], [-6], [-4]])
31+
>>> init_val = [0.5, -0.5, -0.5]
32+
>>> iterations = 3
33+
>>> jacobi_iteration_method(coefficient, constant, init_val, iterations)
34+
[0.909375, -1.14375, -0.7484375]
35+
36+
37+
>>> coefficient = np.array([[4, 1, 1], [1, 5, 2]])
38+
>>> constant = np.array([[2], [-6], [-4]])
39+
>>> init_val = [0.5, -0.5, -0.5]
40+
>>> iterations = 3
41+
>>> jacobi_iteration_method(coefficient, constant, init_val, iterations)
42+
Traceback (most recent call last):
43+
...
44+
ValueError: Coefficient matrix dimensions must be nxn but received 2x3
45+
46+
>>> coefficient = np.array([[4, 1, 1], [1, 5, 2], [1, 2, 4]])
47+
>>> constant = np.array([[2], [-6]])
48+
>>> init_val = [0.5, -0.5, -0.5]
49+
>>> iterations = 3
50+
>>> jacobi_iteration_method(coefficient, constant, init_val, iterations)
51+
Traceback (most recent call last):
52+
...
53+
ValueError: Coefficient and constant matrices dimensions must be nxn and nx1 but
54+
received 3x3 and 2x1
55+
56+
>>> coefficient = np.array([[4, 1, 1], [1, 5, 2], [1, 2, 4]])
57+
>>> constant = np.array([[2], [-6], [-4]])
58+
>>> init_val = [0.5, -0.5]
59+
>>> iterations = 3
60+
>>> jacobi_iteration_method(coefficient, constant, init_val, iterations)
61+
Traceback (most recent call last):
62+
...
63+
ValueError: Number of initial values must be equal to number of rows in coefficient
64+
matrix but received 2 and 3
65+
66+
>>> coefficient = np.array([[4, 1, 1], [1, 5, 2], [1, 2, 4]])
67+
>>> constant = np.array([[2], [-6], [-4]])
68+
>>> init_val = [0.5, -0.5, -0.5]
69+
>>> iterations = 0
70+
>>> jacobi_iteration_method(coefficient, constant, init_val, iterations)
71+
Traceback (most recent call last):
72+
...
73+
ValueError: Iterations must be at least 1
74+
"""
75+
76+
rows1, cols1 = coefficient_matrix.shape
77+
rows2, cols2 = constant_matrix.shape
78+
79+
if rows1 != cols1:
80+
raise ValueError(
81+
f"Coefficient matrix dimensions must be nxn but received {rows1}x{cols1}"
82+
)
83+
84+
if cols2 != 1:
85+
raise ValueError(f"Constant matrix must be nx1 but received {rows2}x{cols2}")
86+
87+
if rows1 != rows2:
88+
raise ValueError(
89+
f"""Coefficient and constant matrices dimensions must be nxn and nx1 but
90+
received {rows1}x{cols1} and {rows2}x{cols2}"""
91+
)
92+
93+
if len(init_val) != rows1:
94+
raise ValueError(
95+
f"""Number of initial values must be equal to number of rows in coefficient
96+
matrix but received {len(init_val)} and {rows1}"""
97+
)
98+
99+
if iterations <= 0:
100+
raise ValueError("Iterations must be at least 1")
101+
102+
table = np.concatenate((coefficient_matrix, constant_matrix), axis=1)
103+
104+
rows, cols = table.shape
105+
106+
strictly_diagonally_dominant(table)
107+
108+
# Iterates the whole matrix for given number of times
109+
for i in range(iterations):
110+
new_val = []
111+
for row in range(rows):
112+
temp = 0
113+
for col in range(cols):
114+
if col == row:
115+
denom = table[row][col]
116+
elif col == cols - 1:
117+
val = table[row][col]
118+
else:
119+
temp += (-1) * table[row][col] * init_val[col]
120+
temp = (temp + val) / denom
121+
new_val.append(temp)
122+
init_val = new_val
123+
124+
return [float(i) for i in new_val]
125+
126+
127+
# Checks if the given matrix is strictly diagonally dominant
128+
def strictly_diagonally_dominant(table: np.ndarray) -> bool:
129+
"""
130+
>>> table = np.array([[4, 1, 1, 2], [1, 5, 2, -6], [1, 2, 4, -4]])
131+
>>> strictly_diagonally_dominant(table)
132+
True
133+
134+
>>> table = np.array([[4, 1, 1, 2], [1, 5, 2, -6], [1, 2, 3, -4]])
135+
>>> strictly_diagonally_dominant(table)
136+
Traceback (most recent call last):
137+
...
138+
ValueError: Coefficient matrix is not strictly diagonally dominant
139+
"""
140+
141+
rows, cols = table.shape
142+
143+
is_diagonally_dominant = True
144+
145+
for i in range(0, rows):
146+
sum = 0
147+
for j in range(0, cols - 1):
148+
if i == j:
149+
continue
150+
else:
151+
sum += table[i][j]
152+
153+
if table[i][i] <= sum:
154+
raise ValueError("Coefficient matrix is not strictly diagonally dominant")
155+
156+
return is_diagonally_dominant
157+
158+
159+
# Test Cases
160+
if __name__ == "__main__":
161+
import doctest
162+
163+
doctest.testmod()

Diff for: audio_filters/README.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Audio Filter
2+
3+
Audio filters work on the frequency of an audio signal to attenuate unwanted frequency and amplify wanted ones.
4+
They are used within anything related to sound, whether it is radio communication or a hi-fi system.
5+
6+
* <https://www.masteringbox.com/filter-types/>
7+
* <http://ethanwiner.com/filters.html>
8+
* <https://en.wikipedia.org/wiki/Audio_filter>
9+
* <https://en.wikipedia.org/wiki/Electronic_filter>

Diff for: backtracking/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Backtracking
2+
3+
Backtracking is a way to speed up the search process by removing candidates when they can't be the solution of a problem.
4+
5+
* <https://en.wikipedia.org/wiki/Backtracking>
6+
* <https://en.wikipedia.org/wiki/Decision_tree_pruning>
7+
* <https://medium.com/@priyankmistry1999/backtracking-sudoku-6e4439e4825c>
8+
* <https://www.geeksforgeeks.org/sudoku-backtracking-7/>

Diff for: bit_manipulation/README.md

+11-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
* https://docs.python.org/3/reference/expressions.html#binary-bitwise-operations
2-
* https://docs.python.org/3/reference/expressions.html#unary-arithmetic-and-bitwise-operations
3-
* https://docs.python.org/3/library/stdtypes.html#bitwise-operations-on-integer-types
4-
* https://wiki.python.org/moin/BitManipulation
5-
* https://wiki.python.org/moin/BitwiseOperators
6-
* https://www.tutorialspoint.com/python3/bitwise_operators_example.htm
1+
# Bit manipulation
2+
3+
Bit manipulation is the act of manipulating bits to detect errors (hamming code), encrypts and decrypts messages (more on that in the 'ciphers' folder) or just do anything at the lowest level of your computer.
4+
5+
* <https://en.wikipedia.org/wiki/Bit_manipulation>
6+
* <https://docs.python.org/3/reference/expressions.html#binary-bitwise-operations>
7+
* <https://docs.python.org/3/reference/expressions.html#unary-arithmetic-and-bitwise-operations>
8+
* <https://docs.python.org/3/library/stdtypes.html#bitwise-operations-on-integer-types>
9+
* <https://wiki.python.org/moin/BitManipulation>
10+
* <https://wiki.python.org/moin/BitwiseOperators>
11+
* <https://www.tutorialspoint.com/python3/bitwise_operators_example.htm>

Diff for: boolean_algebra/README.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Boolean Algebra
2+
3+
Boolean algebra is used to do arithmetic with bits of values True (1) or False (0).
4+
There are three basic operations: 'and', 'or' and 'not'.
5+
6+
* <https://en.wikipedia.org/wiki/Boolean_algebra>
7+
* <https://plato.stanford.edu/entries/boolalg-math/>

0 commit comments

Comments
 (0)