Skip to content

Commit 9127fa1

Browse files
committed
Merge branch 'master' into reduce-the-complexity-of-graphs/bi_directional_dijkstra.py
2 parents b6ecc4d + 19c3897 commit 9127fa1

Some content is hidden

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

49 files changed

+711
-223
lines changed

Diff for: .flake8

-10
This file was deleted.

Diff for: .github/ISSUE_TEMPLATE/other.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Other
2+
description: Use this for any other issues. PLEASE do not create blank issues
3+
labels: ["awaiting triage"]
4+
body:
5+
- type: textarea
6+
id: issuedescription
7+
attributes:
8+
label: What would you like to share?
9+
description: Provide a clear and concise explanation of your issue.
10+
validations:
11+
required: true
12+
13+
- type: textarea
14+
id: extrainfo
15+
attributes:
16+
label: Additional information
17+
description: Is there anything else we should know about this issue?
18+
validations:
19+
required: false

Diff for: .github/stale.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pulls:
4545
closeComment: >
4646
Please reopen this pull request once you commit the changes requested
4747
or make improvements on the code. If this is not the case and you need
48-
some help, feel free to seek help from our [Gitter](https://gitter.im/TheAlgorithms)
48+
some help, feel free to seek help from our [Gitter](https://gitter.im/TheAlgorithms/community)
4949
or ping one of the reviewers. Thank you for your contributions!
5050
5151
issues:
@@ -59,5 +59,5 @@ issues:
5959
closeComment: >
6060
Please reopen this issue once you add more information and updates here.
6161
If this is not the case and you need some help, feel free to seek help
62-
from our [Gitter](https://gitter.im/TheAlgorithms) or ping one of the
62+
from our [Gitter](https://gitter.im/TheAlgorithms/community) or ping one of the
6363
reviewers. Thank you for your contributions!

Diff for: .github/workflows/ruff.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# https://beta.ruff.rs
2+
name: ruff
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
jobs:
11+
ruff:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
- run: pip install --user ruff
16+
- run: ruff --format=github .

Diff for: .pre-commit-config.yaml

+20-60
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ repos:
33
rev: v4.4.0
44
hooks:
55
- id: check-executables-have-shebangs
6+
- id: check-toml
67
- id: check-yaml
78
- id: end-of-file-fixer
89
types: [python]
@@ -14,88 +15,47 @@ repos:
1415
hooks:
1516
- id: auto-walrus
1617

18+
- repo: https://github.com/charliermarsh/ruff-pre-commit
19+
rev: v0.0.259
20+
hooks:
21+
- id: ruff
22+
1723
- repo: https://github.com/psf/black
1824
rev: 23.1.0
1925
hooks:
2026
- id: black
2127

22-
- repo: https://github.com/PyCQA/isort
23-
rev: 5.12.0
28+
- repo: https://github.com/codespell-project/codespell
29+
rev: v2.2.4
2430
hooks:
25-
- id: isort
26-
args:
27-
- --profile=black
31+
- id: codespell
32+
additional_dependencies:
33+
- tomli
2834

2935
- repo: https://github.com/tox-dev/pyproject-fmt
3036
rev: "0.9.2"
3137
hooks:
3238
- id: pyproject-fmt
3339

40+
- repo: local
41+
hooks:
42+
- id: validate-filenames
43+
name: Validate filenames
44+
entry: ./scripts/validate_filenames.py
45+
language: script
46+
pass_filenames: false
47+
3448
- repo: https://github.com/abravalheri/validate-pyproject
3549
rev: v0.12.1
3650
hooks:
3751
- id: validate-pyproject
3852

39-
- repo: https://github.com/asottile/pyupgrade
40-
rev: v3.3.1
41-
hooks:
42-
- id: pyupgrade
43-
args:
44-
- --py311-plus
45-
46-
- repo: https://github.com/charliermarsh/ruff-pre-commit
47-
rev: v0.0.253
48-
hooks:
49-
- id: ruff
50-
args:
51-
- --ignore=E741
52-
53-
- repo: https://github.com/PyCQA/flake8
54-
rev: 6.0.0
55-
hooks:
56-
- id: flake8 # See .flake8 for args
57-
additional_dependencies: &flake8-plugins
58-
- flake8-bugbear
59-
- flake8-builtins
60-
# - flake8-broken-line
61-
- flake8-comprehensions
62-
- pep8-naming
63-
64-
- repo: https://github.com/asottile/yesqa
65-
rev: v1.4.0
66-
hooks:
67-
- id: yesqa
68-
additional_dependencies:
69-
*flake8-plugins
70-
7153
- repo: https://github.com/pre-commit/mirrors-mypy
72-
rev: v1.0.1
54+
rev: v1.1.1
7355
hooks:
7456
- id: mypy
7557
args:
7658
- --ignore-missing-imports
7759
- --install-types # See mirrors-mypy README.md
7860
- --non-interactive
7961
additional_dependencies: [types-requests]
80-
81-
- repo: https://github.com/codespell-project/codespell
82-
rev: v2.2.2
83-
hooks:
84-
- id: codespell
85-
args:
86-
- --ignore-words-list=ans,crate,damon,fo,followings,hist,iff,mater,secant,som,sur,tim,zar
87-
exclude: |
88-
(?x)^(
89-
ciphers/prehistoric_men.txt |
90-
strings/dictionary.txt |
91-
strings/words.txt |
92-
project_euler/problem_022/p022_names.txt
93-
)$
94-
95-
- repo: local
96-
hooks:
97-
- id: validate-filenames
98-
name: Validate filenames
99-
entry: ./scripts/validate_filenames.py
100-
language: script
101-
pass_filenames: false

Diff for: CONTRIBUTING.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Before contributing
44

5-
Welcome to [TheAlgorithms/Python](https://github.com/TheAlgorithms/Python)! Before sending your pull requests, make sure that you __read the whole guidelines__. If you have any doubt on the contributing guide, please feel free to [state it clearly in an issue](https://github.com/TheAlgorithms/Python/issues/new) or ask the community in [Gitter](https://gitter.im/TheAlgorithms).
5+
Welcome to [TheAlgorithms/Python](https://github.com/TheAlgorithms/Python)! Before sending your pull requests, make sure that you __read the whole guidelines__. If you have any doubt on the contributing guide, please feel free to [state it clearly in an issue](https://github.com/TheAlgorithms/Python/issues/new) or ask the community in [Gitter](https://gitter.im/TheAlgorithms/community).
66

77
## Contributing
88

@@ -81,11 +81,11 @@ We want your work to be readable by others; therefore, we encourage you to note
8181
black .
8282
```
8383

84-
- All submissions will need to pass the test `flake8 . --ignore=E203,W503 --max-line-length=88` before they will be accepted so if possible, try this test locally on your Python file(s) before submitting your pull request.
84+
- All submissions will need to pass the test `ruff .` before they will be accepted so if possible, try this test locally on your Python file(s) before submitting your pull request.
8585

8686
```bash
87-
python3 -m pip install flake8 # only required the first time
88-
flake8 . --ignore=E203,W503 --max-line-length=88 --show-source
87+
python3 -m pip install ruff # only required the first time
88+
ruff .
8989
```
9090

9191
- Original code submission require docstrings or comments to describe your work.
@@ -176,7 +176,7 @@ We want your work to be readable by others; therefore, we encourage you to note
176176

177177
- Most importantly,
178178
- __Be consistent in the use of these guidelines when submitting.__
179-
- __Join__ us on [Discord](https://discord.com/invite/c7MnfGFGa6) and [Gitter](https://gitter.im/TheAlgorithms) __now!__
179+
- __Join__ us on [Discord](https://discord.com/invite/c7MnfGFGa6) and [Gitter](https://gitter.im/TheAlgorithms/community) __now!__
180180
- Happy coding!
181181

182182
Writer [@poyea](https://github.com/poyea), Jun 2019.

Diff for: DIRECTORY.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,14 @@
196196
* [Disjoint Set](data_structures/disjoint_set/disjoint_set.py)
197197
* Hashing
198198
* [Double Hash](data_structures/hashing/double_hash.py)
199+
* [Hash Map](data_structures/hashing/hash_map.py)
199200
* [Hash Table](data_structures/hashing/hash_table.py)
200201
* [Hash Table With Linked List](data_structures/hashing/hash_table_with_linked_list.py)
201202
* Number Theory
202203
* [Prime Numbers](data_structures/hashing/number_theory/prime_numbers.py)
203204
* [Quadratic Probing](data_structures/hashing/quadratic_probing.py)
205+
* Tests
206+
* [Test Hash Map](data_structures/hashing/tests/test_hash_map.py)
204207
* Heap
205208
* [Binomial Heap](data_structures/heap/binomial_heap.py)
206209
* [Heap](data_structures/heap/heap.py)
@@ -334,6 +337,7 @@
334337
## Electronics
335338
* [Builtin Voltage](electronics/builtin_voltage.py)
336339
* [Carrier Concentration](electronics/carrier_concentration.py)
340+
* [Circular Convolution](electronics/circular_convolution.py)
337341
* [Coulombs Law](electronics/coulombs_law.py)
338342
* [Electric Conductivity](electronics/electric_conductivity.py)
339343
* [Electric Power](electronics/electric_power.py)
@@ -936,6 +940,8 @@
936940
* [Sol1](project_euler/problem_097/sol1.py)
937941
* Problem 099
938942
* [Sol1](project_euler/problem_099/sol1.py)
943+
* Problem 100
944+
* [Sol1](project_euler/problem_100/sol1.py)
939945
* Problem 101
940946
* [Sol1](project_euler/problem_101/sol1.py)
941947
* Problem 102
@@ -970,6 +976,8 @@
970976
* [Sol1](project_euler/problem_125/sol1.py)
971977
* Problem 129
972978
* [Sol1](project_euler/problem_129/sol1.py)
979+
* Problem 131
980+
* [Sol1](project_euler/problem_131/sol1.py)
973981
* Problem 135
974982
* [Sol1](project_euler/problem_135/sol1.py)
975983
* Problem 144
@@ -1167,7 +1175,6 @@
11671175
* [Get Amazon Product Data](web_programming/get_amazon_product_data.py)
11681176
* [Get Imdb Top 250 Movies Csv](web_programming/get_imdb_top_250_movies_csv.py)
11691177
* [Get Imdbtop](web_programming/get_imdbtop.py)
1170-
* [Get Top Billionaires](web_programming/get_top_billionaires.py)
11711178
* [Get Top Hn Posts](web_programming/get_top_hn_posts.py)
11721179
* [Get User Tweets](web_programming/get_user_tweets.py)
11731180
* [Giphy](web_programming/giphy.py)

Diff for: README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<a href="https://discord.gg/c7MnfGFGa6">
1717
<img src="https://img.shields.io/discord/808045925556682782.svg?logo=discord&colorB=7289DA&style=flat-square" height="20" alt="Discord chat">
1818
</a>
19-
<a href="https://gitter.im/TheAlgorithms">
19+
<a href="https://gitter.im/TheAlgorithms/community">
2020
<img src="https://img.shields.io/badge/Chat-Gitter-ff69b4.svg?label=Chat&logo=gitter&style=flat-square" height="20" alt="Gitter chat">
2121
</a>
2222
<!-- Second row: -->
@@ -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 channels are a great way for you to ask questions and get help. Please join us!
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!
4646

4747
## List of Algorithms
4848

Diff for: arithmetic_analysis/newton_raphson.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from __future__ import annotations
66

77
from decimal import Decimal
8-
from math import * # noqa: F401, F403
8+
from math import * # noqa: F403
99

1010
from sympy import diff
1111

Diff for: arithmetic_analysis/newton_raphson_new.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# Newton's Method - https://en.wikipedia.org/wiki/Newton's_method
99

1010
from sympy import diff, lambdify, symbols
11-
from sympy.functions import * # noqa: F401, F403
11+
from sympy.functions import * # noqa: F403
1212

1313

1414
def newton_raphson(

Diff for: audio_filters/equal_loudness_filter.py.broken.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class EqualLoudnessFilter:
2020
samplerate, use with caution.
2121

2222
Code based on matlab implementation at https://bit.ly/3eqh2HU
23-
(url shortened for flake8)
23+
(url shortened for ruff)
2424

2525
Target curve: https://i.imgur.com/3g2VfaM.png
2626
Yulewalk response: https://i.imgur.com/J9LnJ4C.png

0 commit comments

Comments
 (0)