Skip to content

Commit d0c31af

Browse files
authored
Merge branch 'master' into add-clear_least_significant_set_bit
2 parents 7e2985b + 678dedb commit d0c31af

33 files changed

+636
-73
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 4 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
1718
- 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/[email protected]
1717
with:
1818
push: never

.github/workflows/directory_writer.yml

Lines changed: 3 additions & 2 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
1212
- 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: 22 additions & 6 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
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
1926
- 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
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
2944
- 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: 10 additions & 3 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
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
3037
- 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: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ repos:
1414
- id: requirements-txt-fixer
1515

1616
- repo: https://github.com/MarcoGorelli/auto-walrus
17-
rev: 0.3.4
17+
rev: 0.4.1
1818
hooks:
1919
- id: auto-walrus
2020

2121
- repo: https://github.com/astral-sh/ruff-pre-commit
22-
rev: v0.13.2
22+
rev: v0.14.14
2323
hooks:
2424
- id: ruff-check
2525
- id: ruff-format
@@ -32,7 +32,7 @@ repos:
3232
- tomli
3333

3434
- repo: https://github.com/tox-dev/pyproject-fmt
35-
rev: v2.6.0
35+
rev: v2.12.1
3636
hooks:
3737
- id: pyproject-fmt
3838

@@ -50,7 +50,7 @@ repos:
5050
- id: validate-pyproject
5151

5252
- repo: https://github.com/pre-commit/mirrors-mypy
53-
rev: v1.18.2
53+
rev: v1.19.1
5454
hooks:
5555
- id: mypy
5656
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: 4 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)
@@ -878,6 +881,7 @@
878881
* [Quine](other/quine.py)
879882
* [Scoring Algorithm](other/scoring_algorithm.py)
880883
* [Sdes](other/sdes.py)
884+
* [Sliding Window Maximum](other/sliding_window_maximum.py)
881885
* [Tower Of Hanoi](other/tower_of_hanoi.py)
882886
* [Word Search](other/word_search.py)
883887

ciphers/caesar_cipher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def encrypt(input_string: str, key: int, alphabet: str | None = None) -> str:
4545
And our shift is ``2``
4646
4747
We can then encode the message, one letter at a time. ``H`` would become ``J``,
48-
since ``J`` is two letters away, and so on. If the shift is ever two large, or
48+
since ``J`` is two letters away, and so on. If the shift is ever too large, or
4949
our letter is at the end of the alphabet, we just start at the beginning
5050
(``Z`` would shift to ``a`` then ``b`` and so on).
5151

0 commit comments

Comments
 (0)