Skip to content

Commit 75c7da7

Browse files
committed
Merge branch 'master' of https://github.com/TheAlgorithms/Python
2 parents b790eb9 + 786b324 commit 75c7da7

File tree

336 files changed

+7923
-4446
lines changed

Some content is hidden

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

336 files changed

+7923
-4446
lines changed

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto

.github/CODEOWNERS

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# This is a comment.
2+
# Each line is a file pattern followed by one or more owners.
3+
4+
# More details are here: https://help.github.com/articles/about-codeowners/
5+
6+
# The '*' pattern is global owners.
7+
8+
# Order is important. The last matching pattern has the most precedence.
9+
10+
/.* @cclauss @dhruvmanila
11+
12+
# /arithmetic_analysis/
13+
14+
# /backtracking/
15+
16+
# /bit_manipulation/
17+
18+
# /blockchain/
19+
20+
# /boolean_algebra/
21+
22+
# /cellular_automata/
23+
24+
# /ciphers/ @cclauss # TODO: Uncomment this line after Hacktoberfest
25+
26+
# /compression/
27+
28+
# /computer_vision/
29+
30+
# /conversions/ @cclauss # TODO: Uncomment this line after Hacktoberfest
31+
32+
# /data_structures/ @cclauss # TODO: Uncomment this line after Hacktoberfest
33+
34+
/digital_image_processing/ @mateuszz0000
35+
36+
# /divide_and_conquer/
37+
38+
/dynamic_programming/ @Kush1101
39+
40+
# /file_transfer/
41+
42+
# /fuzzy_logic/
43+
44+
# /genetic_algorithm/
45+
46+
# /geodesy/
47+
48+
# /graphics/
49+
50+
# /graphs/
51+
52+
# /greedy_method/
53+
54+
# /hashes/
55+
56+
# /images/
57+
58+
# /linear_algebra/
59+
60+
# /machine_learning/
61+
62+
/maths/ @Kush1101
63+
64+
# /matrix/
65+
66+
# /networking_flow/
67+
68+
# /neural_network/
69+
70+
# /other/ @cclauss # TODO: Uncomment this line after Hacktoberfest
71+
72+
/project_euler/ @dhruvmanila @Kush1101
73+
74+
# /quantum/
75+
76+
# /scheduling/
77+
78+
# /scripts/
79+
80+
# /searches/
81+
82+
/sorts/ @mateuszz0000
83+
84+
# /strings/ @cclauss # TODO: Uncomment this line after Hacktoberfest
85+
86+
# /traversals/
87+
88+
/web_programming/ @cclauss

.github/stale.yml

-20
This file was deleted.

.github/workflows/autoblack.yml

-25
This file was deleted.

.github/workflows/codespell.yml

-17
This file was deleted.

.github/workflows/directory_writer.yml

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ jobs:
88
steps:
99
- uses: actions/checkout@v1 # v1, NOT v2
1010
- uses: actions/setup-python@v2
11-
with:
12-
python-version: 3.x
1311
- name: Write DIRECTORY.md
1412
run: |
1513
scripts/build_directory_md.py 2>&1 | tee DIRECTORY.md

.github/workflows/project_euler.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
on:
2+
pull_request:
3+
# only check if a file is changed within the project_euler directory and related files
4+
paths:
5+
- 'project_euler/**'
6+
- '.github/workflows/project_euler.yml'
7+
- 'scripts/validate_solutions.py'
8+
9+
name: 'Project Euler'
10+
11+
jobs:
12+
project-euler:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
- uses: actions/setup-python@v2
17+
- name: Install pytest and pytest-cov
18+
run: |
19+
python -m pip install --upgrade pip
20+
python -m pip install --upgrade pytest pytest-cov
21+
- run: pytest --doctest-modules --cov-report=term-missing:skip-covered --cov=project_euler/ project_euler/
22+
validate-solutions:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v2
26+
- uses: actions/setup-python@v2
27+
- name: Install pytest
28+
run: |
29+
python -m pip install --upgrade pip
30+
python -m pip install --upgrade pytest
31+
- run: pytest scripts/validate_solutions.py

.github/workflows/stale.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
stale:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/stale@v1
9+
- uses: actions/stale@v3
1010
with:
1111
repo-token: ${{ secrets.GITHUB_TOKEN }}
1212
stale-issue-message: >

.pre-commit-config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ repos:
4343
- id: codespell
4444
args:
4545
- --ignore-words-list=ans,fo,followings,hist,iff,secant,som,tim
46-
- --skip="./.*,./other/dictionary.txt,./other/words,./project_euler/problem_22/p022_names.txt"
46+
- --skip="./.*,./other/dictionary.txt,./other/words,./project_euler/problem_022/p022_names.txt"
4747
- --quiet-level=2
4848
exclude: |
4949
(?x)^(
5050
other/dictionary.txt |
5151
other/words |
52-
project_euler/problem_22/p022_names.txt
52+
project_euler/problem_022/p022_names.txt
5353
)$
5454
- repo: local
5555
hooks:

.travis.yml

+1-8
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,7 @@ jobs:
99
- name: Build
1010
install: pip install pytest-cov -r requirements.txt
1111
script:
12-
- pytest --doctest-modules --ignore=project_euler/ --durations=10 --cov-report=term-missing:skip-covered --cov=. .
13-
- name: Project Euler
14-
install:
15-
- pip install pytest-cov pytest-subtests
16-
before_script:
17-
- pytest --tb=no --no-summary --capture=no project_euler/validate_solutions.py || true # fail fast on wrong solution
18-
script:
19-
- pytest --doctest-modules --durations=10 --cov-report=term-missing:skip-covered --cov=project_euler/ project_euler/
12+
- pytest --doctest-modules --ignore=project_euler/ --cov-report=term-missing:skip-covered --cov=. .
2013
after_success:
2114
- scripts/build_directory_md.py 2>&1 | tee DIRECTORY.md
2215
notifications:

CONTRIBUTING.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ We are very happy that you consider implementing algorithms and data structure f
1515
- Your work will be distributed under [MIT License](LICENSE.md) once your pull request is merged
1616
- You submitted work fulfils or mostly fulfils our styles and standards
1717

18-
**New implementation** is welcome! For example, new solutions for a problem, different representations for a graph data structure or algorithm designs with different complexity.
18+
**New implementation** is welcome! For example, new solutions for a problem, different representations for a graph data structure or algorithm designs with different complexity but **identical implementation** of an existing implementation is not allowed. Please check whether the solution is already implemented or not before submitting your pull request.
1919

2020
**Improving comments** and **writing proper tests** are also highly welcome.
2121

@@ -53,7 +53,7 @@ Algorithms in this repo should not be how-to examples for existing Python packag
5353

5454
We want your work to be readable by others; therefore, we encourage you to note the following:
5555

56-
- Please write in Python 3.7+. __print()__ is a function in Python 3 so __print "Hello"__ will _not_ work but __print("Hello")__ will.
56+
- Please write in Python 3.7+. For instance: __print()__ is a function in Python 3 so __print "Hello"__ will _not_ work but __print("Hello")__ will.
5757
- Please focus hard on naming of functions, classes, and variables. Help your reader by using __descriptive names__ that can help you to remove redundant comments.
5858
- Single letter variable names are _old school_ so please avoid them unless their life only spans a few lines.
5959
- Expand acronyms because __gcd()__ is hard to understand but __greatest_common_divisor()__ is not.
@@ -147,9 +147,9 @@ We want your work to be readable by others; therefore, we encourage you to note
147147
- Avoid importing external libraries for basic algorithms. Only use those libraries for complicated algorithms.
148148
- If you need a third party module that is not in the file __requirements.txt__, please add it to that file as part of your submission.
149149

150-
#### Other Standard While Submitting Your Work
151-
152-
- File extension for code should be `.py`. Jupyter notebook files are acceptable in machine learning algorithms.
150+
#### Other Requirements for Submissions
151+
- If you are submitting code in the `project_euler/` directory, please also read [the dedicated Guideline](https://github.com/TheAlgorithms/Python/blob/master/project_euler/README.md) before contributing to our Project Euler library.
152+
- The file extension for code files should be `.py`. Jupyter Notebooks should be submitted to [TheAlgorithms/Jupyter](https://github.com/TheAlgorithms/Jupyter).
153153
- Strictly use snake_case (underscore_separated) in your file_name, as it will be easy to parse in future using scripts.
154154
- Please avoid creating new directories if at all possible. Try to fit your work into the existing directory structure.
155155
- If possible, follow the standard *within* the folder you are submitting to.

0 commit comments

Comments
 (0)