Skip to content

Commit 053832c

Browse files
Merge branch 'master' into fix-mypy-errs-5
2 parents e005f90 + bfed2fb commit 053832c

File tree

129 files changed

+5370
-1419
lines changed

Some content is hidden

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

129 files changed

+5370
-1419
lines changed

Diff for: .devcontainer/Dockerfile

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# https://github.com/microsoft/vscode-dev-containers/blob/main/containers/python-3/README.md
2+
ARG VARIANT=3.11-bookworm
3+
FROM mcr.microsoft.com/vscode/devcontainers/python:${VARIANT}
4+
COPY requirements.txt /tmp/pip-tmp/
5+
RUN python3 -m pip install --upgrade pip \
6+
&& python3 -m pip install --no-cache-dir install -r /tmp/pip-tmp/requirements.txt \
7+
&& pipx install pre-commit ruff \
8+
&& pre-commit install

Diff for: .devcontainer/devcontainer.json

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"name": "Python 3",
3+
"build": {
4+
"dockerfile": "Dockerfile",
5+
"context": "..",
6+
"args": {
7+
// Update 'VARIANT' to pick a Python version: 3, 3.10, 3.9, 3.8, 3.7, 3.6
8+
// Append -bullseye or -buster to pin to an OS version.
9+
// Use -bullseye variants on local on arm64/Apple Silicon.
10+
"VARIANT": "3.11-bookworm",
11+
}
12+
},
13+
14+
// Configure tool-specific properties.
15+
"customizations": {
16+
// Configure properties specific to VS Code.
17+
"vscode": {
18+
// Set *default* container specific settings.json values on container create.
19+
"settings": {
20+
"python.defaultInterpreterPath": "/usr/local/bin/python",
21+
"python.linting.enabled": true,
22+
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
23+
"python.linting.mypyPath": "/usr/local/py-utils/bin/mypy"
24+
},
25+
26+
// Add the IDs of extensions you want installed when the container is created.
27+
"extensions": [
28+
"ms-python.python",
29+
"ms-python.vscode-pylance"
30+
]
31+
}
32+
},
33+
34+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
35+
// "forwardPorts": [],
36+
37+
// Use 'postCreateCommand' to run commands after the container is created.
38+
// "postCreateCommand": "pip3 install --user -r requirements.txt",
39+
40+
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
41+
"remoteUser": "vscode"
42+
}

Diff for: .github/pull_request_template.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
* [ ] All function parameters and return values are annotated with Python [type hints](https://docs.python.org/3/library/typing.html).
1818
* [ ] All functions have [doctests](https://docs.python.org/3/library/doctest.html) that pass the automated testing.
1919
* [ ] All new algorithms include at least one URL that points to Wikipedia or another similar explanation.
20-
* [ ] If this pull request resolves one or more open issues then the commit message contains `Fixes: #{$ISSUE_NO}`.
20+
* [ ] If this pull request resolves one or more open issues then the description above includes the issue number(s) with a [closing keyword](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue): "Fixes #ISSUE-NUMBER".

Diff for: .github/workflows/build.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,9 @@ jobs:
2222
python -m pip install --upgrade pip setuptools six wheel
2323
python -m pip install pytest-cov -r requirements.txt
2424
- name: Run tests
25-
# See: #6591 for re-enabling tests on Python v3.11
25+
# TODO: #8818 Re-enable quantum tests
2626
run: pytest
27-
--ignore=computer_vision/cnn_classification.py
28-
--ignore=machine_learning/lstm/lstm_prediction.py
29-
--ignore=quantum/
27+
--ignore=quantum/q_fourier_transform.py
3028
--ignore=project_euler/
3129
--ignore=scripts/validate_solutions.py
3230
--cov-report=term-missing:skip-covered

Diff for: .pre-commit-config.yaml

+6-6
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,25 @@ repos:
1515
hooks:
1616
- id: auto-walrus
1717

18-
- repo: https://github.com/charliermarsh/ruff-pre-commit
19-
rev: v0.0.270
18+
- repo: https://github.com/astral-sh/ruff-pre-commit
19+
rev: v0.0.284
2020
hooks:
2121
- id: ruff
2222

2323
- repo: https://github.com/psf/black
24-
rev: 23.3.0
24+
rev: 23.7.0
2525
hooks:
2626
- id: black
2727

2828
- repo: https://github.com/codespell-project/codespell
29-
rev: v2.2.4
29+
rev: v2.2.5
3030
hooks:
3131
- id: codespell
3232
additional_dependencies:
3333
- tomli
3434

3535
- repo: https://github.com/tox-dev/pyproject-fmt
36-
rev: "0.11.2"
36+
rev: "0.13.1"
3737
hooks:
3838
- id: pyproject-fmt
3939

@@ -51,7 +51,7 @@ repos:
5151
- id: validate-pyproject
5252

5353
- repo: https://github.com/pre-commit/mirrors-mypy
54-
rev: v1.3.0
54+
rev: v1.5.0
5555
hooks:
5656
- id: mypy
5757
args:

Diff for: .vscode/settings.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"githubPullRequests.ignoredPullRequestBranches": [
3+
"master"
4+
]
5+
}

Diff for: CONTRIBUTING.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,14 @@ We appreciate any contribution, from fixing a grammar mistake in a comment to im
2525

2626
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

28-
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.
28+
If you are interested in resolving an [open issue](https://github.com/TheAlgorithms/Python/issues), simply make a pull request with your proposed fix. __We do not assign issues in this repo__ so please do not ask for permission to work on an issue.
29+
30+
Please help us keep our issue list small by adding `Fixes #{$ISSUE_NUMBER}` to the description of pull requests that resolve open issues.
31+
For example, if your pull request fixes issue #10, then please add the following to its description:
32+
```
33+
Fixes #10
34+
```
35+
GitHub will use this tag to [auto-close the issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) if and when the PR is merged.
2936

3037
#### What is an Algorithm?
3138

Diff for: DIRECTORY.md

+26-14
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
* [Minmax](backtracking/minmax.py)
3030
* [N Queens](backtracking/n_queens.py)
3131
* [N Queens Math](backtracking/n_queens_math.py)
32+
* [Power Sum](backtracking/power_sum.py)
3233
* [Rat In Maze](backtracking/rat_in_maze.py)
3334
* [Sudoku](backtracking/sudoku.py)
3435
* [Sum Of Subsets](backtracking/sum_of_subsets.py)
@@ -73,6 +74,7 @@
7374
* [Game Of Life](cellular_automata/game_of_life.py)
7475
* [Nagel Schrekenberg](cellular_automata/nagel_schrekenberg.py)
7576
* [One Dimensional](cellular_automata/one_dimensional.py)
77+
* [Wa Tor](cellular_automata/wa_tor.py)
7678

7779
## Ciphers
7880
* [A1Z26](ciphers/a1z26.py)
@@ -146,6 +148,7 @@
146148
* [Decimal To Binary Recursion](conversions/decimal_to_binary_recursion.py)
147149
* [Decimal To Hexadecimal](conversions/decimal_to_hexadecimal.py)
148150
* [Decimal To Octal](conversions/decimal_to_octal.py)
151+
* [Energy Conversions](conversions/energy_conversions.py)
149152
* [Excel Title To Column](conversions/excel_title_to_column.py)
150153
* [Hex To Bin](conversions/hex_to_bin.py)
151154
* [Hexadecimal To Decimal](conversions/hexadecimal_to_decimal.py)
@@ -166,6 +169,7 @@
166169
* Arrays
167170
* [Permutations](data_structures/arrays/permutations.py)
168171
* [Prefix Sum](data_structures/arrays/prefix_sum.py)
172+
* [Product Sum](data_structures/arrays/product_sum.py)
169173
* Binary Tree
170174
* [Avl Tree](data_structures/binary_tree/avl_tree.py)
171175
* [Basic Binary Tree](data_structures/binary_tree/basic_binary_tree.py)
@@ -233,8 +237,8 @@
233237
* [Double Ended Queue](data_structures/queue/double_ended_queue.py)
234238
* [Linked Queue](data_structures/queue/linked_queue.py)
235239
* [Priority Queue Using List](data_structures/queue/priority_queue_using_list.py)
240+
* [Queue By List](data_structures/queue/queue_by_list.py)
236241
* [Queue By Two Stacks](data_structures/queue/queue_by_two_stacks.py)
237-
* [Queue On List](data_structures/queue/queue_on_list.py)
238242
* [Queue On Pseudo Stack](data_structures/queue/queue_on_pseudo_stack.py)
239243
* Stacks
240244
* [Balanced Parentheses](data_structures/stacks/balanced_parentheses.py)
@@ -290,7 +294,7 @@
290294
* [Inversions](divide_and_conquer/inversions.py)
291295
* [Kth Order Statistic](divide_and_conquer/kth_order_statistic.py)
292296
* [Max Difference Pair](divide_and_conquer/max_difference_pair.py)
293-
* [Max Subarray Sum](divide_and_conquer/max_subarray_sum.py)
297+
* [Max Subarray](divide_and_conquer/max_subarray.py)
294298
* [Mergesort](divide_and_conquer/mergesort.py)
295299
* [Peak](divide_and_conquer/peak.py)
296300
* [Power](divide_and_conquer/power.py)
@@ -321,8 +325,7 @@
321325
* [Matrix Chain Order](dynamic_programming/matrix_chain_order.py)
322326
* [Max Non Adjacent Sum](dynamic_programming/max_non_adjacent_sum.py)
323327
* [Max Product Subarray](dynamic_programming/max_product_subarray.py)
324-
* [Max Sub Array](dynamic_programming/max_sub_array.py)
325-
* [Max Sum Contiguous Subsequence](dynamic_programming/max_sum_contiguous_subsequence.py)
328+
* [Max Subarray Sum](dynamic_programming/max_subarray_sum.py)
326329
* [Min Distance Up Bottom](dynamic_programming/min_distance_up_bottom.py)
327330
* [Minimum Coin Change](dynamic_programming/minimum_coin_change.py)
328331
* [Minimum Cost Path](dynamic_programming/minimum_cost_path.py)
@@ -333,9 +336,11 @@
333336
* [Minimum Tickets Cost](dynamic_programming/minimum_tickets_cost.py)
334337
* [Optimal Binary Search Tree](dynamic_programming/optimal_binary_search_tree.py)
335338
* [Palindrome Partitioning](dynamic_programming/palindrome_partitioning.py)
339+
* [Regex Match](dynamic_programming/regex_match.py)
336340
* [Rod Cutting](dynamic_programming/rod_cutting.py)
337341
* [Subset Generation](dynamic_programming/subset_generation.py)
338342
* [Sum Of Subset](dynamic_programming/sum_of_subset.py)
343+
* [Tribonacci](dynamic_programming/tribonacci.py)
339344
* [Viterbi](dynamic_programming/viterbi.py)
340345
* [Word Break](dynamic_programming/word_break.py)
341346

@@ -410,6 +415,7 @@
410415
* [Dijkstra 2](graphs/dijkstra_2.py)
411416
* [Dijkstra Algorithm](graphs/dijkstra_algorithm.py)
412417
* [Dijkstra Alternate](graphs/dijkstra_alternate.py)
418+
* [Dijkstra Binary Grid](graphs/dijkstra_binary_grid.py)
413419
* [Dinic](graphs/dinic.py)
414420
* [Directed And Undirected (Weighted) Graph](graphs/directed_and_undirected_(weighted)_graph.py)
415421
* [Edmonds Karp Multiple Source And Sink](graphs/edmonds_karp_multiple_source_and_sink.py)
@@ -419,8 +425,9 @@
419425
* [Frequent Pattern Graph Miner](graphs/frequent_pattern_graph_miner.py)
420426
* [G Topological Sort](graphs/g_topological_sort.py)
421427
* [Gale Shapley Bigraph](graphs/gale_shapley_bigraph.py)
428+
* [Graph Adjacency List](graphs/graph_adjacency_list.py)
429+
* [Graph Adjacency Matrix](graphs/graph_adjacency_matrix.py)
422430
* [Graph List](graphs/graph_list.py)
423-
* [Graph Matrix](graphs/graph_matrix.py)
424431
* [Graphs Floyd Warshall](graphs/graphs_floyd_warshall.py)
425432
* [Greedy Best First](graphs/greedy_best_first.py)
426433
* [Greedy Min Vertex Cover](graphs/greedy_min_vertex_cover.py)
@@ -479,11 +486,15 @@
479486
* [Lib](linear_algebra/src/lib.py)
480487
* [Polynom For Points](linear_algebra/src/polynom_for_points.py)
481488
* [Power Iteration](linear_algebra/src/power_iteration.py)
489+
* [Rank Of Matrix](linear_algebra/src/rank_of_matrix.py)
482490
* [Rayleigh Quotient](linear_algebra/src/rayleigh_quotient.py)
483491
* [Schur Complement](linear_algebra/src/schur_complement.py)
484492
* [Test Linear Algebra](linear_algebra/src/test_linear_algebra.py)
485493
* [Transformations 2D](linear_algebra/src/transformations_2d.py)
486494

495+
## Linear Programming
496+
* [Simplex](linear_programming/simplex.py)
497+
487498
## Machine Learning
488499
* [Astar](machine_learning/astar.py)
489500
* [Data Transformations](machine_learning/data_transformations.py)
@@ -503,7 +514,7 @@
503514
* Lstm
504515
* [Lstm Prediction](machine_learning/lstm/lstm_prediction.py)
505516
* [Multilayer Perceptron Classifier](machine_learning/multilayer_perceptron_classifier.py)
506-
* [Polymonial Regression](machine_learning/polymonial_regression.py)
517+
* [Polynomial Regression](machine_learning/polynomial_regression.py)
507518
* [Scoring Functions](machine_learning/scoring_functions.py)
508519
* [Self Organizing Map](machine_learning/self_organizing_map.py)
509520
* [Sequential Minimum Optimization](machine_learning/sequential_minimum_optimization.py)
@@ -514,7 +525,6 @@
514525
* [Xgboost Regressor](machine_learning/xgboost_regressor.py)
515526

516527
## Maths
517-
* [3N Plus 1](maths/3n_plus_1.py)
518528
* [Abs](maths/abs.py)
519529
* [Add](maths/add.py)
520530
* [Addition Without Arithmetic](maths/addition_without_arithmetic.py)
@@ -545,6 +555,7 @@
545555
* [Chudnovsky Algorithm](maths/chudnovsky_algorithm.py)
546556
* [Collatz Sequence](maths/collatz_sequence.py)
547557
* [Combinations](maths/combinations.py)
558+
* [Continued Fraction](maths/continued_fraction.py)
548559
* [Decimal Isolate](maths/decimal_isolate.py)
549560
* [Decimal To Fraction](maths/decimal_to_fraction.py)
550561
* [Dodecahedron](maths/dodecahedron.py)
@@ -563,9 +574,7 @@
563574
* [Fermat Little Theorem](maths/fermat_little_theorem.py)
564575
* [Fibonacci](maths/fibonacci.py)
565576
* [Find Max](maths/find_max.py)
566-
* [Find Max Recursion](maths/find_max_recursion.py)
567577
* [Find Min](maths/find_min.py)
568-
* [Find Min Recursion](maths/find_min_recursion.py)
569578
* [Floor](maths/floor.py)
570579
* [Gamma](maths/gamma.py)
571580
* [Gamma Recursive](maths/gamma_recursive.py)
@@ -578,17 +587,16 @@
578587
* [Hardy Ramanujanalgo](maths/hardy_ramanujanalgo.py)
579588
* [Hexagonal Number](maths/hexagonal_number.py)
580589
* [Integration By Simpson Approx](maths/integration_by_simpson_approx.py)
590+
* [Interquartile Range](maths/interquartile_range.py)
581591
* [Is Int Palindrome](maths/is_int_palindrome.py)
582592
* [Is Ip V4 Address Valid](maths/is_ip_v4_address_valid.py)
583593
* [Is Square Free](maths/is_square_free.py)
584594
* [Jaccard Similarity](maths/jaccard_similarity.py)
585595
* [Juggler Sequence](maths/juggler_sequence.py)
586-
* [Kadanes](maths/kadanes.py)
587596
* [Karatsuba](maths/karatsuba.py)
588597
* [Krishnamurthy Number](maths/krishnamurthy_number.py)
589598
* [Kth Lexicographic Permutation](maths/kth_lexicographic_permutation.py)
590599
* [Largest Of Very Large Numbers](maths/largest_of_very_large_numbers.py)
591-
* [Largest Subarray Sum](maths/largest_subarray_sum.py)
592600
* [Least Common Multiple](maths/least_common_multiple.py)
593601
* [Line Length](maths/line_length.py)
594602
* [Liouville Lambda](maths/liouville_lambda.py)
@@ -651,6 +659,7 @@
651659
* [Sigmoid Linear Unit](maths/sigmoid_linear_unit.py)
652660
* [Signum](maths/signum.py)
653661
* [Simpson Rule](maths/simpson_rule.py)
662+
* [Simultaneous Linear Equation Solver](maths/simultaneous_linear_equation_solver.py)
654663
* [Sin](maths/sin.py)
655664
* [Sock Merchant](maths/sock_merchant.py)
656665
* [Softmax](maths/softmax.py)
@@ -676,6 +685,7 @@
676685
## Matrix
677686
* [Binary Search Matrix](matrix/binary_search_matrix.py)
678687
* [Count Islands In Matrix](matrix/count_islands_in_matrix.py)
688+
* [Count Negative Numbers In Sorted Matrix](matrix/count_negative_numbers_in_sorted_matrix.py)
679689
* [Count Paths](matrix/count_paths.py)
680690
* [Cramers Rule 2X2](matrix/cramers_rule_2x2.py)
681691
* [Inverse Of Matrix](matrix/inverse_of_matrix.py)
@@ -702,7 +712,6 @@
702712
* [Exponential Linear Unit](neural_network/activation_functions/exponential_linear_unit.py)
703713
* [Back Propagation Neural Network](neural_network/back_propagation_neural_network.py)
704714
* [Convolution Neural Network](neural_network/convolution_neural_network.py)
705-
* [Input Data](neural_network/input_data.py)
706715
* [Perceptron](neural_network/perceptron.py)
707716
* [Simple Neural Network](neural_network/simple_neural_network.py)
708717

@@ -723,17 +732,19 @@
723732
* [Linear Congruential Generator](other/linear_congruential_generator.py)
724733
* [Lru Cache](other/lru_cache.py)
725734
* [Magicdiamondpattern](other/magicdiamondpattern.py)
726-
* [Maximum Subarray](other/maximum_subarray.py)
727735
* [Maximum Subsequence](other/maximum_subsequence.py)
728736
* [Nested Brackets](other/nested_brackets.py)
737+
* [Number Container System](other/number_container_system.py)
729738
* [Password](other/password.py)
730739
* [Quine](other/quine.py)
731740
* [Scoring Algorithm](other/scoring_algorithm.py)
732741
* [Sdes](other/sdes.py)
733742
* [Tower Of Hanoi](other/tower_of_hanoi.py)
734743

735744
## Physics
745+
* [Altitude Pressure](physics/altitude_pressure.py)
736746
* [Archimedes Principle](physics/archimedes_principle.py)
747+
* [Basic Orbital Capture](physics/basic_orbital_capture.py)
737748
* [Casimir Effect](physics/casimir_effect.py)
738749
* [Centripetal Force](physics/centripetal_force.py)
739750
* [Grahams Law](physics/grahams_law.py)
@@ -749,6 +760,7 @@
749760
* [Potential Energy](physics/potential_energy.py)
750761
* [Rms Speed Of Molecule](physics/rms_speed_of_molecule.py)
751762
* [Shear Stress](physics/shear_stress.py)
763+
* [Speed Of Sound](physics/speed_of_sound.py)
752764

753765
## Project Euler
754766
* Problem 001
@@ -1054,7 +1066,6 @@
10541066
* [Q Fourier Transform](quantum/q_fourier_transform.py)
10551067
* [Q Full Adder](quantum/q_full_adder.py)
10561068
* [Quantum Entanglement](quantum/quantum_entanglement.py)
1057-
* [Quantum Random](quantum/quantum_random.py)
10581069
* [Quantum Teleportation](quantum/quantum_teleportation.py)
10591070
* [Ripple Adder Classic](quantum/ripple_adder_classic.py)
10601071
* [Single Qubit Measure](quantum/single_qubit_measure.py)
@@ -1160,6 +1171,7 @@
11601171
* [Is Pangram](strings/is_pangram.py)
11611172
* [Is Spain National Id](strings/is_spain_national_id.py)
11621173
* [Is Srilankan Phone Number](strings/is_srilankan_phone_number.py)
1174+
* [Is Valid Email Address](strings/is_valid_email_address.py)
11631175
* [Jaro Winkler](strings/jaro_winkler.py)
11641176
* [Join](strings/join.py)
11651177
* [Knuth Morris Pratt](strings/knuth_morris_pratt.py)

Diff for: README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<img src="https://img.shields.io/static/v1.svg?label=Contributions&message=Welcome&color=0059b3&style=flat-square" height="20" alt="Contributions Welcome">
1414
</a>
1515
<img src="https://img.shields.io/github/repo-size/TheAlgorithms/Python.svg?label=Repo%20size&style=flat-square" height="20">
16-
<a href="https://discord.gg/c7MnfGFGa6">
16+
<a href="https://the-algorithms.com/discord">
1717
<img src="https://img.shields.io/discord/808045925556682782.svg?logo=discord&colorB=7289DA&style=flat-square" height="20" alt="Discord chat">
1818
</a>
1919
<a href="https://gitter.im/TheAlgorithms/community">
@@ -42,7 +42,7 @@ Read through our [Contribution Guidelines](CONTRIBUTING.md) before you contribut
4242

4343
## Community Channels
4444

45-
We are on [Discord](https://discord.gg/c7MnfGFGa6) and [Gitter](https://gitter.im/TheAlgorithms/community)! Community channels are a great way for you to ask questions and get help. Please join us!
45+
We are on [Discord](https://the-algorithms.com/discord) and [Gitter](https://gitter.im/TheAlgorithms/community)! Community channels are a great way for you to ask questions and get help. Please join us!
4646

4747
## List of Algorithms
4848

Diff for: arithmetic_analysis/newton_raphson.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@ def newton_raphson(
2525
"""
2626
x = a
2727
while True:
28-
x = Decimal(x) - (Decimal(eval(func)) / Decimal(eval(str(diff(func)))))
28+
x = Decimal(x) - (
29+
Decimal(eval(func)) / Decimal(eval(str(diff(func)))) # noqa: S307
30+
)
2931
# This number dictates the accuracy of the answer
30-
if abs(eval(func)) < precision:
32+
if abs(eval(func)) < precision: # noqa: S307
3133
return float(x)
3234

3335

0 commit comments

Comments
 (0)