Skip to content

Commit c1b3c99

Browse files
authored
Merge branch 'master' into master
2 parents 6d8410c + 678dedb commit c1b3c99

Some content is hidden

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

59 files changed

+1044
-135
lines changed

β€Ž.github/workflows/build.ymlβ€Ž

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,25 @@ jobs:
99
build:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v5
13-
- uses: astral-sh/setup-uv@v6
12+
- run: sudo apt-get update && sudo apt-get install -y libhdf5-dev
13+
- uses: actions/checkout@v6
14+
- uses: astral-sh/setup-uv@v7
1415
with:
1516
enable-cache: true
1617
cache-dependency-glob: uv.lock
17-
- uses: actions/setup-python@v5
18+
- uses: actions/setup-python@v6
1819
with:
19-
python-version: 3.x
20+
python-version: 3.14
2021
allow-prereleases: true
2122
- run: uv sync --group=test
2223
- name: Run tests
2324
# TODO: #8818 Re-enable quantum tests
24-
run: uv run pytest
25+
run: uv run --with=pytest-run-parallel pytest
26+
--iterations=8 --parallel-threads=auto
2527
--ignore=computer_vision/cnn_classification.py
2628
--ignore=docs/conf.py
2729
--ignore=dynamic_programming/k_means_clustering_tensorflow.py
30+
--ignore=machine_learning/local_weighted_learning/local_weighted_learning.py
2831
--ignore=machine_learning/lstm/lstm_prediction.py
2932
--ignore=neural_network/input_data.py
3033
--ignore=project_euler/

β€Ž.github/workflows/devcontainer_ci.ymlβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
build:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v5
15+
- uses: actions/checkout@v6
1616
- uses: devcontainers/ci@v0.3
1717
with:
1818
push: never

β€Ž.github/workflows/directory_writer.ymlβ€Ž

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ jobs:
66
directory_writer:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v5
9+
- uses: actions/checkout@v6
1010
with:
1111
fetch-depth: 0
12-
- uses: actions/setup-python@v5
12+
- uses: actions/setup-python@v6
1313
with:
14-
python-version: 3.x
14+
python-version: 3.14
15+
allow-prereleases: true
1516
- name: Write DIRECTORY.md
1617
run: |
1718
scripts/build_directory_md.py 2>&1 | tee DIRECTORY.md

β€Ž.github/workflows/project_euler.ymlβ€Ž

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,37 @@ jobs:
1414
project-euler:
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v5
18-
- uses: astral-sh/setup-uv@v6
19-
- uses: actions/setup-python@v5
17+
- run:
18+
sudo apt-get update && sudo apt-get install -y libtiff5-dev libjpeg8-dev libopenjp2-7-dev
19+
zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python3-tk
20+
libharfbuzz-dev libfribidi-dev libxcb1-dev
21+
libxml2-dev libxslt-dev
22+
libhdf5-dev
23+
libopenblas-dev
24+
- uses: actions/checkout@v6
25+
- uses: astral-sh/setup-uv@v7
26+
- uses: actions/setup-python@v6
2027
with:
21-
python-version: 3.x
28+
python-version: 3.14
29+
allow-prereleases: true
2230
- run: uv sync --group=euler-validate --group=test
2331
- run: uv run pytest --doctest-modules --cov-report=term-missing:skip-covered --cov=project_euler/ project_euler/
2432
validate-solutions:
2533
runs-on: ubuntu-latest
2634
steps:
27-
- uses: actions/checkout@v5
28-
- uses: astral-sh/setup-uv@v6
29-
- uses: actions/setup-python@v5
35+
- run:
36+
sudo apt-get update && sudo apt-get install -y libtiff5-dev libjpeg8-dev libopenjp2-7-dev
37+
zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python3-tk
38+
libharfbuzz-dev libfribidi-dev libxcb1-dev
39+
libxml2-dev libxslt-dev
40+
libhdf5-dev
41+
libopenblas-dev
42+
- uses: actions/checkout@v6
43+
- uses: astral-sh/setup-uv@v7
44+
- uses: actions/setup-python@v6
3045
with:
31-
python-version: 3.x
46+
python-version: 3.14
47+
allow-prereleases: true
3248
- run: uv sync --group=euler-validate --group=test
3349
- run: uv run pytest scripts/validate_solutions.py
3450
env:

β€Ž.github/workflows/ruff.ymlβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ jobs:
1111
ruff:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v5
15-
- uses: astral-sh/setup-uv@v6
14+
- uses: actions/checkout@v6
15+
- uses: astral-sh/setup-uv@v7
1616
- run: uvx ruff check --output-format=github .

β€Ž.github/workflows/sphinx.ymlβ€Ž

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,18 @@ jobs:
2525
build_docs:
2626
runs-on: ubuntu-24.04-arm
2727
steps:
28-
- uses: actions/checkout@v5
29-
- uses: astral-sh/setup-uv@v6
30-
- uses: actions/setup-python@v5
28+
- run:
29+
sudo apt-get update && sudo apt-get install -y libtiff5-dev libjpeg8-dev libopenjp2-7-dev
30+
zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python3-tk
31+
libharfbuzz-dev libfribidi-dev libxcb1-dev
32+
libxml2-dev libxslt-dev
33+
libhdf5-dev
34+
libopenblas-dev
35+
- uses: actions/checkout@v6
36+
- uses: astral-sh/setup-uv@v7
37+
- uses: actions/setup-python@v6
3138
with:
32-
python-version: 3.13
39+
python-version: 3.14
3340
allow-prereleases: true
3441
- run: uv sync --group=docs
3542
- uses: actions/configure-pages@v5

β€Ž.pre-commit-config.yamlβ€Ž

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
ci:
2+
autoupdate_schedule: monthly
3+
14
repos:
25
- repo: https://github.com/pre-commit/pre-commit-hooks
36
rev: v6.0.0
@@ -11,12 +14,12 @@ repos:
1114
- id: requirements-txt-fixer
1215

1316
- repo: https://github.com/MarcoGorelli/auto-walrus
14-
rev: 0.3.4
17+
rev: 0.4.1
1518
hooks:
1619
- id: auto-walrus
1720

1821
- repo: https://github.com/astral-sh/ruff-pre-commit
19-
rev: v0.12.10
22+
rev: v0.14.14
2023
hooks:
2124
- id: ruff-check
2225
- id: ruff-format
@@ -29,7 +32,7 @@ repos:
2932
- tomli
3033

3134
- repo: https://github.com/tox-dev/pyproject-fmt
32-
rev: v2.6.0
35+
rev: v2.12.1
3336
hooks:
3437
- id: pyproject-fmt
3538

@@ -47,7 +50,7 @@ repos:
4750
- id: validate-pyproject
4851

4952
- repo: https://github.com/pre-commit/mirrors-mypy
50-
rev: v1.17.1
53+
rev: v1.19.1
5154
hooks:
5255
- id: mypy
5356
args:

β€ŽCONTRIBUTING.mdβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ We want your work to be readable by others; therefore, we encourage you to note
9999
ruff check
100100
```
101101

102-
- Original code submission require docstrings or comments to describe your work.
102+
- Original code submissions require docstrings or comments to describe your work.
103103

104104
- More on docstrings and comments:
105105

β€ŽDIRECTORY.mdβ€Ž

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@
195195
* [Permutations](data_structures/arrays/permutations.py)
196196
* [Prefix Sum](data_structures/arrays/prefix_sum.py)
197197
* [Product Sum](data_structures/arrays/product_sum.py)
198+
* [Rotate Array](data_structures/arrays/rotate_array.py)
198199
* [Sparse Table](data_structures/arrays/sparse_table.py)
199200
* [Sudoku Solver](data_structures/arrays/sudoku_solver.py)
200201
* Binary Tree
@@ -397,6 +398,7 @@
397398
* [Minimum Squares To Represent A Number](dynamic_programming/minimum_squares_to_represent_a_number.py)
398399
* [Minimum Steps To One](dynamic_programming/minimum_steps_to_one.py)
399400
* [Minimum Tickets Cost](dynamic_programming/minimum_tickets_cost.py)
401+
* [Narcissistic Number](dynamic_programming/narcissistic_number.py)
400402
* [Optimal Binary Search Tree](dynamic_programming/optimal_binary_search_tree.py)
401403
* [Palindrome Partitioning](dynamic_programming/palindrome_partitioning.py)
402404
* [Range Sum Query](dynamic_programming/range_sum_query.py)
@@ -623,6 +625,7 @@
623625
* [Sequential Minimum Optimization](machine_learning/sequential_minimum_optimization.py)
624626
* [Similarity Search](machine_learning/similarity_search.py)
625627
* [Support Vector Machines](machine_learning/support_vector_machines.py)
628+
* [T Stochastic Neighbour Embedding](machine_learning/t_stochastic_neighbour_embedding.py)
626629
* [Word Frequency Functions](machine_learning/word_frequency_functions.py)
627630
* [Xgboost Classifier](machine_learning/xgboost_classifier.py)
628631
* [Xgboost Regressor](machine_learning/xgboost_regressor.py)
@@ -725,6 +728,7 @@
725728
* [Secant Method](maths/numerical_analysis/secant_method.py)
726729
* [Simpson Rule](maths/numerical_analysis/simpson_rule.py)
727730
* [Square Root](maths/numerical_analysis/square_root.py)
731+
* [Weierstrass Method](maths/numerical_analysis/weierstrass_method.py)
728732
* [Odd Sieve](maths/odd_sieve.py)
729733
* [Perfect Cube](maths/perfect_cube.py)
730734
* [Perfect Number](maths/perfect_number.py)
@@ -877,6 +881,7 @@
877881
* [Quine](other/quine.py)
878882
* [Scoring Algorithm](other/scoring_algorithm.py)
879883
* [Sdes](other/sdes.py)
884+
* [Sliding Window Maximum](other/sliding_window_maximum.py)
880885
* [Tower Of Hanoi](other/tower_of_hanoi.py)
881886
* [Word Search](other/word_search.py)
882887

@@ -1300,6 +1305,7 @@
13001305
* [Shell Sort](sorts/shell_sort.py)
13011306
* [Shrink Shell Sort](sorts/shrink_shell_sort.py)
13021307
* [Slowsort](sorts/slowsort.py)
1308+
* [Stalin Sort](sorts/stalin_sort.py)
13031309
* [Stooge Sort](sorts/stooge_sort.py)
13041310
* [Strand Sort](sorts/strand_sort.py)
13051311
* [Tim Sort](sorts/tim_sort.py)

β€ŽREADME.mdβ€Ž

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<img src="https://raw.githubusercontent.com/TheAlgorithms/website/1cd824df116b27029f17c2d1b42d81731f28a920/public/logo.svg" height="100">
55
</a>
66
<h1><a href="https://github.com/TheAlgorithms/">The Algorithms</a> - Python</h1>
7+
78
<!-- Labels: -->
89
<!-- First row: -->
910
<a href="https://gitpod.io/#https://github.com/TheAlgorithms/Python">
@@ -19,6 +20,7 @@
1920
<a href="https://gitter.im/TheAlgorithms/community">
2021
<img src="https://img.shields.io/badge/Chat-Gitter-ff69b4.svg?label=Chat&logo=gitter&style=flat-square" height="20" alt="Gitter chat">
2122
</a>
23+
2224
<!-- Second row: -->
2325
<br>
2426
<a href="https://github.com/TheAlgorithms/Python/actions">
@@ -30,20 +32,21 @@
3032
<a href="https://docs.astral.sh/ruff/formatter/">
3133
<img src="https://img.shields.io/static/v1?label=code%20style&message=ruff&color=black&style=flat-square" height="20" alt="code style: black">
3234
</a>
35+
3336
<!-- Short description: -->
34-
<h3>All algorithms implemented in Python - for education</h3>
37+
<h3>All algorithms implemented in Python - for education πŸ“š</h3>
3538
</div>
3639

3740
Implementations are for learning purposes only. They may be less efficient than the implementations in the Python standard library. Use them at your discretion.
3841

39-
## Getting Started
42+
## πŸš€ Getting Started
4043

41-
Read through our [Contribution Guidelines](CONTRIBUTING.md) before you contribute.
44+
πŸ“‹ Read through our [Contribution Guidelines](CONTRIBUTING.md) before you contribute.
4245

43-
## Community Channels
46+
## 🌐 Community Channels
4447

4548
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!
4649

47-
## List of Algorithms
50+
## πŸ“œ List of Algorithms
4851

4952
See our [directory](DIRECTORY.md) for easier navigation and a better overview of the project.

0 commit comments

Comments
Β (0)