Skip to content

update-19-11-06 #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 348 commits into from
Nov 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
348 commits
Select commit Hold shift + click to select a range
e6eaa07
Pytest the entire repo (#980)
cclauss Jul 10, 2019
add1aef
Rename average.py to average_mean.py (#939)
PatOnTheBack Jul 10, 2019
34dee74
add canny edge detection algorithm and modify sobel_filter (#991)
lighttxu Jul 10, 2019
2ad5be9
Modified Docstrings to Fix Errors (#975)
PatOnTheBack Jul 10, 2019
897f1d0
Improved Formatting and Style of Math Algos (#960)
PatOnTheBack Jul 10, 2019
37fbd8c
Update average_median.py (#998)
SandersLin Jul 10, 2019
b79a197
Update abs_Max.py (#997)
SandersLin Jul 11, 2019
5f991f7
#315 Renamed all files to snake_case (#993)
Alfro Jul 11, 2019
c2f2fa8
Update abs_Min.py (#1004)
SandersLin Jul 11, 2019
f2eb965
Update ~script.py (#990)
FrogBattle Jul 11, 2019
1dc9ec8
Update Bucket Sort time complexity analysis (#918)
obelisk0114 Jul 12, 2019
1e0b33d
Update 3n+1.py (#996)
SandersLin Jul 13, 2019
7a6ebb8
Update edit_distance.py (#1001)
SandersLin Jul 13, 2019
7271c0d
Update rod_cutting.py (#995)
SandersLin Jul 13, 2019
d72586c
Updated ~script.py per #978 (#1013)
qckzr Jul 13, 2019
0d61539
Log_likelihood update (#1008)
ChillOrb Jul 13, 2019
628794d
Add combinations (#1015)
obelisk0114 Jul 14, 2019
3b2738e
Add rotate matrix problem (#1021)
obelisk0114 Jul 15, 2019
1e55bfd
Create climbing_stairs.py (#1002)
SandersLin Jul 15, 2019
2fb3bee
Fix error message and format with python/black (#1025)
cclauss Jul 16, 2019
267b5ef
Added doctest and more explanation about Dijkstra execution. (#1014)
brunohadlich Jul 16, 2019
7cdda93
Travis CI: Add pytest --doctest-modules graphs (#1018)
cclauss Jul 17, 2019
f195d92
adding factorial (#930)
jpg-130 Jul 17, 2019
f64b602
Update max_sub_array.py (#1000)
SandersLin Jul 17, 2019
e662a5a
Added Burrows-Wheeler transform algorithm. (#1029)
brunohadlich Jul 17, 2019
4658f4a
lgtm fixes (#1032)
jpg-130 Jul 18, 2019
c2e8582
Travis CI: Add pytest --doctest-modules neural_network (#1028)
cclauss Jul 18, 2019
9a55f2b
Remove the space: lucas series.py --> lucas_series.py (#1036)
cclauss Jul 18, 2019
f438440
Fixes for issue "Fix the LGTM issues #1024" (#1034)
brunohadlich Jul 18, 2019
9f8953d
Update find_lcm.py (#1019)
thiru15 Jul 18, 2019
f7ac8b5
Commented doctests that were causing slowness at Travis. (#1039)
brunohadlich Jul 18, 2019
9fcfe6a
Commented doctests that were causing slowness at Travis. #2 (#1041)
brunohadlich Jul 19, 2019
60c608d
Added matrix exponentiation approach for finding fibonacci number. (#…
mahbubcseju Jul 19, 2019
dc1de94
Use correct function names in nth_fibonacci_using_matrix_exponentiati…
cclauss Jul 19, 2019
4e0717c
Add error & test checks for matrix_operations.py (#925)
StephenGemin Jul 20, 2019
f5e6d4e
Update DIRECTORY.md (#1046)
cclauss Jul 20, 2019
61fec83
Adds Gaussian Function in maths section (#1054)
QuantumNovice Jul 20, 2019
5b5beb6
Update newton_raphson_method.py (#1057)
QuantumNovice Jul 20, 2019
0f09530
dijkstra.py: Use r"strings" to fix two pylint warnings (#1052)
cclauss Jul 20, 2019
b35f5d9
Update CONTRIBUTING.md (#1059)
poyea Jul 20, 2019
93fdc9f
Travis CI: Add pytest --doctest-modules maths (#1020)
cclauss Jul 21, 2019
c964d74
Added Mobius Function (#1058)
QuantumNovice Jul 21, 2019
05e567c
Code to change contrast (#1060)
QuantumNovice Jul 21, 2019
b2ed8d4
rotate_matrix.py: Add type hints for return values (#1023)
cclauss Jul 22, 2019
7c3ef98
Implement ruling hash to appropriate complexity of Rabin Karp (#1066)
mahbubcseju Jul 24, 2019
46bcee0
Add badges to the top of README.md (#1064)
QuantumNovice Jul 24, 2019
3c8e931
Travis CI: Add a flake8 test for unused imports (#1038)
cclauss Jul 25, 2019
c27bd51
in_static_equilibrium checks if a 2D static system is in equilibrium …
QuantumNovice Jul 25, 2019
46bc673
Add doctest to maths/sieve_of_eratosthenes.py and remove other/findin…
obelisk0114 Jul 26, 2019
3b63857
added automated doctest to decimal_to_hexadecimal.py in conversions (…
jasper256 Jul 26, 2019
a0817bd
Rewrite build_directory_md.py (#1076)
cclauss Jul 28, 2019
7b2c954
LargestOfVeryLargeNumbers (#818)
abhikmp Jul 30, 2019
a9ecdb3
Validate Python filenames (#1086)
cclauss Jul 30, 2019
861a8c3
Add Lucas_Lehmer_primality_test (#1050)
obelisk0114 Jul 30, 2019
e58a5e6
Update tim_sort.py (#972)
FrogBattle Jul 30, 2019
4a5589f
project_euler/problem_10 (#1089)
itsvinayak Jul 31, 2019
7b267e5
Fix data_structures to pass our Travis CI pytests (#1088)
cclauss Jul 31, 2019
9c0cbe3
Create collatz_sequence.py (#639)
SandersLin Aug 1, 2019
e313141
bin(num). convert ZERO and negative decimal numbers to binary. (#1093)
syedwaleedhyder Aug 3, 2019
bdbe682
Zeller's Congruence Algorithm (#1095)
mrvnmchm Aug 5, 2019
87a789a
Boolean algebra pytests (#1097)
mrvnmchm Aug 5, 2019
4437439
Added Unicode test to strings/rabin_karp.py (#1096)
qckzr Aug 5, 2019
47bc34a
Added pytests to sha1.py (#1098)
QuantumNovice Aug 6, 2019
22d2453
Create Quadratic Equations(Complexes Numbers) (#941)
AugustofCravo Aug 6, 2019
5812640
pytests for closest_pair_of_points.py (#1099)
rsun0013 Aug 6, 2019
6654e1e
remove from __future__, propre filename (#1102)
harshildarji Aug 6, 2019
89acf5d
print() is a function just like every other function (#1101)
cclauss Aug 6, 2019
d21b4cf
Added pytests to hashes/md5.py (#1100)
QuantumNovice Aug 6, 2019
762482d
Update closest_pair_of_points.py (#1109)
harshildarji Aug 6, 2019
7b5a184
print() is a function just like every other function (#1104)
cclauss Aug 6, 2019
7cf3db1
Add test for QuadraticEquation() (#1107)
cclauss Aug 6, 2019
561a414
Travis CI: Run each failing pytest in allow_failures mode (#1087)
cclauss Aug 6, 2019
9456e81
Seperate client and server of FTP (#1106)
AlexDvorak Aug 7, 2019
c92d06b
Delete redundant files (#1115)
poyea Aug 7, 2019
32c0418
Infinite loop was fixed. (#1105)
AmritK10 Aug 7, 2019
3ba67c7
rename non-ftp files (#1116)
AlexDvorak Aug 7, 2019
c686cc5
fix outdated fork error (#1117)
mrvnmchm Aug 8, 2019
91c3c98
Rename file_transfer and linear_algebra (#1118)
cclauss Aug 9, 2019
36684db
Travis CI: Add pytest --doctest-modules machine_learning (#1016)
cclauss Aug 10, 2019
55cea57
Fix tests for file_transfer and perceptron.py (#1121)
cclauss Aug 11, 2019
158b319
New linear algebra algorithm (#1122)
nic-dern Aug 12, 2019
4fea480
Add type hints to binary_tree_traversals.py (#1123)
cclauss Aug 12, 2019
c74fd0c
Add maths/test_prime_check.py (#1125)
cclauss Aug 13, 2019
dc2b575
Add doctests to networking_flow/minimum_cut.py (#1126)
cclauss Aug 13, 2019
f3c0b13
Added sudoku solving program in backtracking algorithms (#1128)
adithbharadwaj Aug 13, 2019
8eab2f1
Solution for Problem Euler 56 (#1131)
shuklalok Aug 13, 2019
27205d4
Update DIRECTORY.md (#1129)
cclauss Aug 14, 2019
3e69733
Remove 'python' from the filename (#1130)
cclauss Aug 15, 2019
5bdcd48
EHN: A divide-and-conquer, and brute-force algorithms for array inver…
maxwell-aladago Aug 15, 2019
a18a8fe
Update .gitignore to remove __pycache__/ (#1127)
cclauss Aug 16, 2019
05c9a05
ENH: two algorithms for the convex hull problem of a set of 2d points…
maxwell-aladago Aug 17, 2019
5d46a4d
ENH: Added a functionality to make it possible to reconstruct an opti…
maxwell-aladago Aug 19, 2019
32aa7ff
ENH: refactored longest common subsequence, also fixed a bug with the…
maxwell-aladago Aug 19, 2019
47a9ea2
Simplify code by dropping support for legacy Python (#1143)
cclauss Aug 19, 2019
2304e31
Fixing lgtm issue in basic graphs (#1141)
qckzr Aug 20, 2019
47cb394
added doctests for compare_string and is_for_table (#1138)
pathak-deep15 Aug 22, 2019
e694e59
Added a few doctests for traversals (#1149)
naklecha Aug 25, 2019
2f8516e
implementation of sorted vector machines (#1156)
anand-371 Aug 28, 2019
82a079c
add .github/stale.yml (#1158)
harshildarji Aug 28, 2019
d327f10
Update stale.yml
r0hit-gupta Aug 28, 2019
d4151bd
Fix possible error in longest_common_subsequence.py (#1163)
rwithik Aug 31, 2019
d567a9e
solution to problem 551 from project euler (#1164)
b63 Sep 1, 2019
9492e7a
Created Sherman Morrison method (#1162)
McDic Sep 3, 2019
a4ed40b
changing typo (#1168)
maxwell-aladago Sep 4, 2019
f31a812
Add Binomial Heap (#1146)
KirilBangachev Sep 5, 2019
2dfe01e
Fully refactored the rod cutting module. (#1169)
maxwell-aladago Sep 5, 2019
ab25079
Update DIRECTORY (#1161)
jai-dewani Sep 6, 2019
a41a14f
Add radix2 FFT (#1166)
KirilBangachev Sep 6, 2019
5b483be
Added OOP approach to matrices (#1165)
jasper256 Sep 8, 2019
3c3f92d
Add problem 67 solution (#1170)
Hyftar Sep 8, 2019
030600f
Update matrix_class.py (#1175)
cclauss Sep 10, 2019
47d1795
Add Kth lexicographic permutation (#1179)
KirilBangachev Sep 13, 2019
f8e30cf
Digital Image Processing Tests (#1178)
mrvnmchm Sep 13, 2019
6fa3c0b
Add Flake8 F4 Tests to .travis.yml (#974)
PatOnTheBack Sep 13, 2019
768700b
Add delete to trie.py + tests (#1177)
ksangeet9ap Sep 13, 2019
a2b5a90
Added sequential minimum optimization algorithm for SVM (#508)
zqbake Sep 18, 2019
04962c0
Fix lgtm error display #1024 (#1190)
denis-trofimov Sep 21, 2019
837bfff
Rename sorted_vector_machines.py to support_vector_machines.py (#1195)
Holden-Lin Sep 22, 2019
01601e6
Add disjoint set (#1194)
luoheng23 Sep 23, 2019
e40d4a2
Added Matrix Exponentiation (#1203)
anirudnits Sep 25, 2019
6ac7b13
Min head with decrease key functionality (#1202)
Raj1998 Sep 25, 2019
2375bfb
Adding stooge sort (#1206)
Charitoc Sep 26, 2019
a79fc2b
Fix the build typo: fn --> fn1 (#1205)
cclauss Sep 26, 2019
4617aa7
DBSCAN algorithm (#1207)
cozek Sep 29, 2019
189b350
Deque (#1200)
Sep 30, 2019
b738281
maths-polynomial_evalutation (#1214)
msk4862 Oct 1, 2019
df44d1b
Update CONTRIBUTING.md (#1250)
cclauss Oct 2, 2019
b8490ed
Removed owners from README (#1254)
AnupKumarPanwar Oct 3, 2019
390feb0
Add doctests for sorting algorithms (#1263)
parth-paradkar Oct 3, 2019
0e333ae
added bogobogosort (#1258)
WilliamHYZhang Oct 3, 2019
0e2d6b2
adding softmax function (#1267)
cozek Oct 3, 2019
03aba96
added defination (#1244)
shubhamgarg2000 Oct 3, 2019
f970c73
Add problem 23 solution (#1261)
Hyftar Oct 3, 2019
d28fc71
Add problem18 solution (#1260)
Hyftar Oct 3, 2019
6e69208
Add problem 32 solution (#1257)
Hyftar Oct 3, 2019
309204a
Add problem 42 solution (#1259)
Hyftar Oct 3, 2019
07f04a2
adding jaccard similarity (#1270)
cozek Oct 4, 2019
9eac17a
psf/black code formatting (#1277)
WilliamHYZhang Oct 5, 2019
6ebd899
CONTRIBUTING.md: Fix mistake in doctest ;-) (#1266)
cclauss Oct 5, 2019
c4a9767
Update fibonacci_sequence_recursion.py (#1287)
NikhilCodes Oct 6, 2019
0a7d387
Added a python script for finding sum of arithmetic series (#1279)
TheRealDarkCoder Oct 6, 2019
b1a769c
Add pure implementation of K-Nearest Neighbours (#1278)
parth-paradkar Oct 6, 2019
9cc9f67
Chinese Remainder Theorem | Diophantine Equation | Modular Division (…
OddExtension5 Oct 6, 2019
067a9b5
adding input option and increasing the number of doctest (#1281)
mvhb Oct 6, 2019
01bc785
Fixed links in DIRECTORY.md (#1291)
AnupKumarPanwar Oct 7, 2019
22bd6ff
Update average_mean.py (#1293)
maramsumanth Oct 7, 2019
06d7361
Added comment (#1294)
nishant-ingle Oct 7, 2019
3a06aba
Update Linear Algebra Readme (#1298)
AgentEnder Oct 7, 2019
25701a9
added doctests to scoring_functions.py (#1300)
cozek Oct 8, 2019
0da4d0a
make code more readable (#1304)
realDuYuanChao Oct 8, 2019
f0568d6
less code (#1292)
realDuYuanChao Oct 8, 2019
e80d248
optimization (#1303)
realDuYuanChao Oct 8, 2019
61f7f94
Create karatsuba.py (#1309)
rishabh0098 Oct 8, 2019
b6cc37d
mergesort added (#1313)
jpg-130 Oct 9, 2019
ea47ae2
Adding missing Doctests (#1330)
jpg-130 Oct 9, 2019
e678879
Adding doctests for sum_of_subset.py (#1333)
jpg-130 Oct 11, 2019
67291a5
Modified longest_common_ssubsequence.py for successful doctests (#1332)
jpg-130 Oct 11, 2019
b190c8f
Rename GCD File (#1354)
AliabbasMerchant Oct 14, 2019
dcee2ea
Update build badge (#1378)
siriak Oct 17, 2019
927a8c7
added horner's method (#1360)
stephen-ryan-ansys Oct 17, 2019
63d8cad
Fixing Some Minor Issues (#1386)
Cor3Down Oct 17, 2019
83c104e
Divide and Conquer (#1308)
realDuYuanChao Oct 18, 2019
28b964c
Added missing problem statements (#1364)
aritrartira Oct 18, 2019
14c23bc
create qr_decomposition (#1363)
stephen-ryan-ansys Oct 18, 2019
870eebf
rewrite the algorithm from scratch (#1351)
yuriimchg Oct 18, 2019
3cc3531
Feature/update least common multiple (#1352)
yuriimchg Oct 18, 2019
b7fb063
Feature/fix caesar cipher (#1350)
yuriimchg Oct 18, 2019
9c63473
added fibonacci_search.py (#1341)
laishawadhwa Oct 18, 2019
ddb0949
Adding doctests for fractional_knapsack.py (#1331)
jpg-130 Oct 18, 2019
455509a
Add Topological Sort (#1302)
pmba Oct 18, 2019
2197bfa
#840 adds polymonial regression program in python (#1235)
archu5 Oct 18, 2019
e177198
Add unicode support in ciphers/base64_cipher.py script. (#1316)
laurent-pck Oct 18, 2019
7376add
Implement Linked Queue and Linked Stack data structures (#1324)
mariuszskon Oct 18, 2019
179284a
Update treap.py (#1358)
Hocnonsense Oct 18, 2019
4590363
Added Pytests for Decission Tree mean_squared_error method (#1374)
hrishi84 Oct 18, 2019
a7f3851
fuzzy operations added (#1310)
jpg-130 Oct 18, 2019
5ef5f67
Added more details about the problem statement (#1367)
jai-dewani Oct 18, 2019
43f99e5
Python program that surfs 3 site at a time (#1389)
Kunal614 Oct 18, 2019
8366782
Create ActivitySelection (#1384)
swatiprajapati08 Oct 18, 2019
86a2d5f
fixed some typos (#1392)
Iqrar99 Oct 18, 2019
e0158c2
fixed project eular readme (#1391)
Oct 18, 2019
acd962b
adding program to print diamond pattern (#1338)
souravs17031999 Oct 18, 2019
5c351d8
Implementation of Hardy Ramanujan Algorithm in /maths (#1355)
alfinwilliam Oct 19, 2019
dbf904f
added runge-kutta (#1393)
stephen-ryan-ansys Oct 19, 2019
ab65a39
Double sort (Added with required updates) (#1399)
ayush246 Oct 19, 2019
cd10c94
Issue #1397 (#1403)
ManuMBhat Oct 19, 2019
38d7e70
The time complexity of every algorithms make its value (#1401)
SinghSujitkumar Oct 19, 2019
313a043
Create autocomplete_using_trie.py (#1406)
ArchanaPrabhu Oct 20, 2019
afeb13b
added explicit euler's method (#1394)
stephen-ryan-ansys Oct 21, 2019
a06995a
add simple improved Sieve Of Eratosthenes Algorithm (#1412)
ShuLaPy Oct 21, 2019
67aa3cf
Added alternative way to generate password in password_generator.py (…
akankshamahajan99 Oct 21, 2019
f93cce6
some pytest on math folder (#1405)
engFelipeMonteiro Oct 21, 2019
4531ea4
Transfer .ipynb files to TheAlgorithms/Jupyter (#1414)
cclauss Oct 22, 2019
ce7faa5
Largest subarray sum (#1404)
anubhav-sharma13 Oct 22, 2019
8b572e6
added solution 7 for problem_01 (#1416)
suadjelili Oct 22, 2019
9226856
Aho-Corasick String Matching Algorithm (#346)
AashayShingre Oct 22, 2019
5483064
Create newton_forward_interpolation.py (#333)
jainanmol123 Oct 22, 2019
13802fc
Create greedy.py (#1359)
DanishSheikh1999 Oct 22, 2019
7444a1f
Another method added for GCD (#1387)
subahanii Oct 22, 2019
906c985
Create dinic.py (#1396)
danielx285 Oct 22, 2019
11e2207
Project Euler problems 06, 20 (#1419)
chttrjeankr Oct 22, 2019
7592cba
psf/black code formatting (#1421)
chttrjeankr Oct 22, 2019
5fd868c
Add algorithm to rotate images (#1420)
matheustguimaraes Oct 22, 2019
5683025
Readability of CONTRIBUTING.md (#1422)
poyea Oct 22, 2019
d477a4d
introduced shuffled_shift_cipher.py in /ciphers (#1424)
chttrjeankr Oct 23, 2019
7b3d385
create simple binary search (#1430)
praisearts Oct 24, 2019
0748313
Added determinate function (#1429)
codecalec Oct 24, 2019
ec85cc8
Fixes in methods and tests in Linear Algebra (#1432)
codecalec Oct 24, 2019
03e9a75
Add gaussian_elimination.py for solving linear systems (#1448)
isaacgdo Oct 25, 2019
a2a3ca6
Update treap.py (#1455)
samarthsehgal97 Oct 25, 2019
182062d
Adding deterministic miller rabin primality test (#1453)
bizzfitch Oct 25, 2019
3ea0992
Update aho-corasick.py (#1457)
samarthsehgal97 Oct 25, 2019
a61b05b
minor changes in format of DIRECTORY.md (#1461)
chttrjeankr Oct 25, 2019
a57809a
Added binomial coefficient (#1467)
prathmesh1199 Oct 26, 2019
bc52aa6
Some grammatical and spelling corrections (#1475)
ArjunwadkarAjay Oct 27, 2019
a7078d7
added solution 4 for problem_20 (#1476)
suadjelili Oct 27, 2019
8b52e44
Python program that listing top 'n' movie in imdb (#1477)
orkunincili Oct 27, 2019
39c40e7
added solution 3 for problem_25 (#1478)
suadjelili Oct 27, 2019
8a5b1ab
finding max (#1488)
Deekshaesha Oct 28, 2019
e36fe34
Hard coded inputs to mixed_keyword cypher (#1500)
arjun1299 Oct 28, 2019
bf50ea0
Add Travis_CI_tests_are_failing.md (#1499)
cclauss Oct 28, 2019
3fc276c
rename and add doctest (#1501)
realDuYuanChao Oct 28, 2019
1da1ab0
Improve doctest and comment for maximum sub-array problem (#1503)
poyea Oct 28, 2019
3ada8bb
Page replacement algorithm, LRU (#871)
phileasme Oct 28, 2019
f8a30b4
Addition of Secant Method (#876)
dimgrichr Oct 28, 2019
4f86f58
Create GAN.py (#1445)
DevilLord9967 Oct 28, 2019
e463c0b
Update dictionary.txt (#1507)
Kumar-Nishchay Oct 29, 2019
e3d4d2b
Update greatest_common_divisor.py (#1513)
percy07 Oct 29, 2019
1ed47ad
Update palindrome.py (#1509)
percy07 Oct 29, 2019
dfea6f3
:white_check_mark: added tests for Perceptron in Neural Networks (#1506)
janithwanni Oct 29, 2019
bfac867
Add doctests to other/word_patterns.py (#1518)
cclauss Oct 29, 2019
4880e54
Create prime_numbers.py (#1519)
5ur3 Oct 29, 2019
f8e97aa
Update basic_maths.py (#1517)
percy07 Oct 29, 2019
53ff735
Factors of a number (#1493)
himanshujaindev Oct 29, 2019
6343361
average_mode.py (#1491)
LokiUvaraj Oct 29, 2019
fc533a7
Simplified DES (#1382)
srisumapasumarthi Oct 30, 2019
df95f43
Update quick_select.py (#1523)
percy07 Oct 30, 2019
357dbd4
Doctest, type hints and bug in LIS_O(nlogn) (#1525)
poyea Oct 30, 2019
8a5633a
Euler Problem 27 solution script Added (#1466)
RitwickGhosh Oct 31, 2019
6d44cdd
perfect square (#1534)
realDuYuanChao Oct 31, 2019
80e1c87
Added Problem 33 (#1440)
charleyr0 Oct 31, 2019
814750e
update factorial (#1535)
realDuYuanChao Oct 31, 2019
c717f8d
add max sum contigous subsequence (#1537)
taufikalgi Oct 31, 2019
62e51fe
recursive quick sort (#1536)
metehaansever Oct 31, 2019
7bc0462
Non-recursive Segment Tree implementation (#1543)
qf-jonathan Nov 1, 2019
8107548
Travis CI: Write & print DIRECTORY.md on one line (#1542)
mrvnmchm Nov 1, 2019
0e3357a
added solution 1 for problem_99 in project_euler (#1545)
itsvinayak Nov 1, 2019
8c443cc
add floor() (#1551)
realDuYuanChao Nov 4, 2019
5452e94
Porta cipher (#1550)
mrvnmchm Nov 4, 2019
a9d5378
Doctest and typing for longest_increasing_subsequence.py (#1526)
poyea Nov 4, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 12 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: TheAlgorithms
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: ['http://paypal.me/TheAlgorithms/1000', 'https://donorbox.org/thealgorithms']
18 changes: 18 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 30
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- bug
- help wanted
- OK to merge
# Label to use when marking an issue as stale
staleLabel: wontfix
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: true
34 changes: 34 additions & 0 deletions .github/workflows/autoblack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# GitHub Action that uses Black to reformat the Python code in an incoming pull request.
# If all Python code in the pull request is complient with Black then this Action does nothing.
# Othewrwise, Black is run and its changes are committed back to the incoming pull request.
# https://github.com/cclauss/autoblack

name: autoblack
on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 1
matrix:
python-version: [3.7]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install psf/black
run: pip install black
- name: Run black --check .
run: black --check .
- name: If needed, commit black changes to the pull request
if: failure()
run: |
black .
git config --global user.name 'autoblack'
git config --global user.email '[email protected]'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
git checkout $GITHUB_HEAD_REF
git commit -am "fixup: Format Python code with psf/black"
git push
33 changes: 25 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ __pycache__/
*.so

# Distribution / packaging
.vscode/
.Python
env/
build/
develop-eggs/
dist/
Expand All @@ -21,9 +19,11 @@ lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
Expand All @@ -43,8 +43,9 @@ htmlcov/
.cache
nosetests.xml
coverage.xml
*,cover
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
Expand All @@ -53,6 +54,7 @@ coverage.xml
# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
Expand All @@ -67,7 +69,7 @@ docs/_build/
# PyBuilder
target/

# IPython Notebook
# Jupyter Notebook
.ipynb_checkpoints

# pyenv
Expand All @@ -76,17 +78,32 @@ target/
# celery beat schedule file
celerybeat-schedule

# dotenv
.env
# SageMath parsed files
*.sage.py

# virtualenv
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/

.DS_Store
.idea
.DS_Store
.try
.vscode/
12 changes: 0 additions & 12 deletions .lgtm.yml

This file was deleted.

32 changes: 10 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,14 @@
language: python
python: 3.7
cache: pip
python:
- 2.7
- 3.6
#- nightly
#- pypy
#- pypy3
matrix:
allow_failures:
- python: nightly
- python: pypy
- python: pypy3
install:
#- pip install -r requirements.txt
- pip install flake8 # pytest # add another testing frameworks later
before_install: pip install --upgrade pip setuptools
install: pip install -r requirements.txt
before_script:
# stop the build if there are Python syntax errors or undefined names
- flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
- flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- black --check . || true
- flake8 . --count --select=E9,F4,F63,F7,F82 --show-source --statistics
script:
- true # pytest --capture=sys # add other tests here
notifications:
on_success: change
on_failure: change # `always` will be the setting once code changes slow down
- scripts/validate_filenames.py # no uppercase, no spaces, in a directory
- mypy --ignore-missing-imports .
- pytest . --doctest-modules
after_success:
- scripts/build_directory_md.py 2>&1 | tee DIRECTORY.md
Binary file removed .vs/Python/v15/.suo
Binary file not shown.
Binary file removed .vs/slnx.sqlite
Binary file not shown.
160 changes: 160 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
# Contributing guidelines

## Before contributing

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).

## Contributing

### Contributor

We are very happy that you consider implementing algorithms and data structure for others! This repository is referenced and used by learners from all over the globe. Being one of our contributors, you agree and confirm that:

- You did your work - no plagiarism allowed
- Any plagiarized work will not be merged.
- Your work will be distributed under [MIT License](License) once your pull request is merged
- You submitted work fulfils or mostly fulfils our styles and standards

**New implementation** is welcome! For example, new solutions for a problem, different representations for a graph data structure or algorithm designs with different complexity.

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

### Contribution

We appreciate any contribution, from fixing a grammar mistake in a comment to implementing complex algorithms. Please read this section if you are contributing your work.

Your contribution will be tested by our [automated testing on Travis CI](https://travis-ci.org/TheAlgorithms/Python/pull_requests) to save time and mental energy. After you have submitted your pull request, you should see the Travis 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 Travis 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.

#### Coding Style

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

- Please write in Python 3.7+. __print()__ is a function in Python 3 so __print "Hello"__ will _not_ work but __print("Hello")__ will.
- 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.
- Single letter variable names are _old school_ so please avoid them unless their life only spans a few lines.
- Expand acronyms because __gcd()__ is hard to understand but __greatest_common_divisor()__ is not.
- Please follow the [Python Naming Conventions](https://pep8.org/#prescriptive-naming-conventions) so variable_names and function_names should be lower_case, CONSTANTS in UPPERCASE, ClassNames should be CamelCase, etc.



- We encourage the use of Python [f-strings](https://realpython.com/python-f-strings/#f-strings-a-new-and-improved-way-to-format-strings-in-python) where the make the code easier to read.



- Please consider running [__psf/black__](https://github.com/python/black) on your Python file(s) before submitting your pull request. This is not yet a requirement but it does make your code more readable and automatically aligns it with much of [PEP 8](https://www.python.org/dev/peps/pep-0008/). There are other code formatters (autopep8, yapf) but the __black__ style is now the recommendation of the Python Core Team. To use it,

```bash
pip3 install black # only required the first time
black .
```

- All submissions will need to pass the test __flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics__ before they will be accepted so if possible, try this test locally on your Python file(s) before submitting your pull request.

```bash
pip3 install flake8 # only required the first time
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
```



- Original code submission require docstrings or comments to describe your work.

- More on docstrings and comments:

If you are using a Wikipedia article or some other source material to create your algorithm, please add the URL in a docstring or comment to help your reader.

The following are considered to be bad and may be requested to be improved:

```python
x = x + 2 # increased by 2
```

This is too trivial. Comments are expected to be explanatory. For comments, you can write them above, on or below a line of code, as long as you are consistent within the same piece of code.

We encourage you to put docstrings inside your functions but please pay attention to indentation of docstrings. The following is acceptable in this case:

```python
def sumab(a, b):
"""
This function returns the sum of two integers a and b
Return: a + b
"""
return a + b
```

- Write tests (especially [__doctests__](https://docs.python.org/3/library/doctest.html)) to illustrate and verify your work. We highly encourage the use of _doctests on all functions_.

```python
def sumab(a, b):
"""
This function returns the sum of two integers a and b
Return: a + b
>>> sumab(2, 2)
4
>>> sumab(-2, 3)
1
>>> sumab(4.9, 5.1)
10.0
"""
return a + b
```

These doctests will be run by pytest as part of our automated testing so please try to run your doctests locally and make sure that they are found and pass:

```bash
python3 -m doctest -v my_submission.py
```

The use of the Python builtin __input()__ function is **not** encouraged:

```python
input('Enter your input:')
# Or even worse...
input = eval(input("Enter your input: "))
```

However, if your code uses __input()__ then we encourage you to gracefully deal with leading and trailing whitespace in user input by adding __.strip()__ as in:

```python
starting_value = int(input("Please enter a starting value: ").strip())
```

The use of [Python type hints](https://docs.python.org/3/library/typing.html) is encouraged for function parameters and return values. Our automated testing will run [mypy](http://mypy-lang.org) so run that locally before making your submission.

```python
def sumab(a: int, b: int) --> int:
pass
```



- [__List comprehensions and generators__](https://docs.python.org/3/tutorial/datastructures.html#list-comprehensions) are preferred over the use of `lambda`, `map`, `filter`, `reduce` but the important thing is to demonstrate the power of Python in code that is easy to read and maintain.



- Avoid importing external libraries for basic algorithms. Only use those libraries for complicated algorithms.
- 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.

#### Other Standard While Submitting Your Work

- File extension for code should be `.py`. Jupiter notebook files are acceptable in machine learning algorithms.
- Strictly use snake_case (underscore_separated) in your file_name, as it will be easy to parse in future using scripts.
- Please avoid creating new directories if at all possible. Try to fit your work into the existing directory structure.
- If possible, follow the standard *within* the folder you are submitting to.



- If you have modified/added code work, make sure the code compiles before submitting.
- If you have modified/added documentation work, ensure your language is concise and contains no grammar errors.
- Do not update the README.md or DIRECTORY.md file which will be periodically autogenerated by our Travis CI processes.
- Add a corresponding explanation to [Algorithms-Explanation](https://github.com/TheAlgorithms/Algorithms-Explanation) (Optional but recommended).
- All submissions will be tested with [__mypy__](http://www.mypy-lang.org) so we encourage to add [__Python type hints__](https://docs.python.org/3/library/typing.html) where it makes sense to do so.



- Most importantly,
- **Be consistent in the use of these guidelines when submitting.**
- **Join** [Gitter](https://gitter.im/TheAlgorithms) **now!**
- Happy coding!

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