Commit Graph

3002 Commits

Author SHA1 Message Date
Arjit Arora
1bbb0092f3
Add signum function (#7526)
* Add signum function

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add typehints for functions

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update signum.py

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2022-10-23 13:17:30 +02:00
Caeden Perelli-Harris
a0cbc2056e
refactor: Make code more simple in maclaurin_series (#7522) 2022-10-23 13:01:51 +02:00
Abhishek Chakraborty
f32f78a9e0
Basic string grammar fix (#7534)
* Grammar edit

* Flake8 consistency fix

* Apply suggestions from code review

Co-authored-by: Christian Clauss <cclauss@me.com>
2022-10-23 12:42:02 +02:00
Akshit Gulyan
ed127032b3
Created sum_of_harmonic_series.py (#7504)
* Created sum_of_harmonic_series.py

Here in this code the formula for Harmonic sum is not used, Sum of the series is calculated by creating a list of the elements in the given Harmonic series and adding all the elements of that list !

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update maths/sum_of_harmonic_series.py

Co-authored-by: Chris O <46587501+ChrisO345@users.noreply.github.com>

* Update maths/sum_of_harmonic_series.py

Co-authored-by: Chris O <46587501+ChrisO345@users.noreply.github.com>

* Update maths/sum_of_harmonic_series.py

Co-authored-by: Chris O <46587501+ChrisO345@users.noreply.github.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update maths/sum_of_harmonic_series.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update maths/sum_of_harmonic_series.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update maths/sum_of_harmonic_series.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update sum_of_harmonic_series.py

* Add doctests

* Update sum_of_harmonic_series.py

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Chris O <46587501+ChrisO345@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2022-10-23 06:29:10 +02:00
Chris O
a5dd07c370
Maclaurin approximation of cos (#7507)
* renamed maclaurin_sin.py to maclaurin_series.py and included function for cos approximation

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* attempt to fix pytest error

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-22 18:17:07 +02:00
Tianyi Zheng
cc10b20beb
Remove some print statements within algorithmic functions (#7499)
* Remove commented-out print statements in algorithmic functions

* Encapsulate non-algorithmic code in __main__

* Remove unused print_matrix function

* Remove print statement in __init__

* Remove print statement from doctest

* Encapsulate non-algorithmic code in __main__

* Modify algorithm to return instead of print

* Encapsulate non-algorithmic code in __main__

* Refactor data_safety_checker to return instead of print

* updating DIRECTORY.md

* updating DIRECTORY.md

* Apply suggestions from code review

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-22 13:33:51 +02:00
Chris O
717f0e46d9
Maclaurin series approximation of sin (#7451)
* added maclaurin_sin.py function

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* added type hints and fixed line overflows

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* removed incompatable type examples

* Update maths/maclaurin_sin.py

Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>

* changed error details

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fixed grammatical errors

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* improved function accuracy and added test case

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update maths/maclaurin_sin.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* removed redundant return

* fixed pytest

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2022-10-21 09:03:57 +02:00
Modassir Afzal
42b56f2345
XGBoost Classifier (#7106)
* Fixes: #{6551}

* Update xgboostclassifier.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update xgboostclassifier.py

* Update xgboostclassifier.py

* Update xgboostclassifier.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fixes: #{6551}

* Update xgboostclassifier.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update xgboostclassifier.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update xgboostclassifier.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update xgboostclassifier.py

* Fixes : #6551

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fixes : #6551

* Fixes : #6551

* Fixes: #6551

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update xgboostclassifier.py

* Update xgboostclassifier.py

* Update xgboostclassifier.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fixes: #6551

* Fixes #6551

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fixes: {#6551}

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fixes: {#6551}

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fixes: #6551

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* FIXES: {#6551}

* Fixes : { #6551}

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fixes : { #6551}

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fixes: { #6551]

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update xgboostclassifier.py

* Update xgboostclassifier.py

* Apply suggestions from code review

* Update xgboostclassifier.py

* Update xgboostclassifier.py

* Update xgboostclassifier.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fixes: { #6551}

* Update xgboostclassifier.py

* Fixes: { #6551}

* Update xgboostclassifier.py

* Fixes: ( #6551)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fixes: { #6551}

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2022-10-20 23:59:11 +02:00
Alan Paul
831280cedd
Add quantum_random.py (#7446)
* Create quantum_random.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update quantum_random.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update quantum_random.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update quantum/quantum_random.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update quantum/quantum_random.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update quantum/quantum_random.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update quantum_random.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update quantum_random.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* requirements.txt: Add projectq

* Update quantum_random.py

* Update quantum/quantum_random.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update quantum_random.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update quantum_random.py

* Update quantum_random.py

* Update quantum/quantum_random.py

* Update quantum/quantum_random.py

* Update quantum_random.py

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2022-10-20 12:27:13 +02:00
Atul Rajput
4829fea24d
Create graphs/dijkstra_alternate.py (#7405)
* Update dijkstra.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update dijkstra.py

* Update graphs/dijkstra.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update graphs/dijkstra.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update graphs/dijkstra.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update dijkstra.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update dijkstra.py

* Apply suggestions from code review

* Create dijkstra_alternate.py

* Update dijkstra.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* int(1e7)

* Update dijkstra_alternate.py

* Update graphs/dijkstra_alternate.py

* sptset --> visited

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2022-10-20 09:48:28 +02:00
Tianyi Zheng
2859d4bf3a
Remove references to depreciated QasmSimulator (#7417)
* Fix typos

* Replace depreciated QasmSimulator in Deutsch-Jozsa algorithm

* Replace depreciated QasmSimulator in half adder algorithm

* Replace depreciated QasmSimulator in not gate algorithm

* Replace depreciated QasmSimulator in full adder algorithm

* Simplify qiskit import

* Make formatting more consistent

* Replace depreciated QasmSimulator in quantum entanglement algorithm

* Replace depreciated QasmSimulator in ripple adder algorithm

* Replace depreciated QasmSimulator in qubit measure algorithm

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* updating DIRECTORY.md

* updating DIRECTORY.md

* Remove qiskit import alias for clarity

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2022-10-19 22:12:44 +02:00
Kuldeep Borkar
50da472ddc
Implemented Gelu Function (#7368)
* Implemented Gelu Function

* Renamed file and added more description to function

* Extended the name GELU

* Update gaussian_error_linear_unit.py

Co-authored-by: Christian Clauss <cclauss@me.com>
2022-10-19 19:18:33 +02:00
Kuldeep Borkar
b8281d79ef
Fixed a typo of 'a' and 'an' and used f string in print statement (#7398) 2022-10-19 13:46:56 +02:00
Sai Ganesh Manda
80ff25ed38
Update gaussian_naive_bayes.py (#7406)
* Update gaussian_naive_bayes.py

Just adding in a final metric of accuracy to declare...

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-19 13:43:26 +02:00
Nadirhan Şahin
b90ec30398
Create combination_sum.py (#7403)
* Create combination_sum.py

* Update DIRECTORY.md

* Adds doctests

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update combination_sum.py

* Update combination_sum.py

Co-authored-by: Christian Clauss <cclauss@me.com>
2022-10-18 21:55:43 +02:00
Manish Kumar
5bfcab1aa4
Create minmax.py (#7409)
* Create minmax.py

* Update minmax.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-18 21:22:38 +02:00
Shubham Kondekar
2ca695b0fe
[Matrix] Max area of island problem solved DFS algorithm (#6918)
* Maximum area of island program added

* Update matrix/max_area_of_island.py

Co-authored-by: Caeden <caedenperelliharris@gmail.com>

* Update matrix/max_area_of_island.py

Co-authored-by: Caeden <caedenperelliharris@gmail.com>

* Update matrix/max_area_of_island.py

Co-authored-by: Caeden <caedenperelliharris@gmail.com>

* Review's comment resolved

* max area of island

* PR Comments resolved

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Test case fail fix

* Grammer correction

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* flake8 issue resolved

* some variable name fix

* Update matrix/max_area_of_island.py

Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>

* Update matrix/max_area_of_island.py

Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>

* PR, comments resolved

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update matrix/max_area_of_island.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update matrix/max_area_of_island.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* PR, comments resolved

* Update max_area_of_island.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Typo

Co-authored-by: Caeden <caedenperelliharris@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2022-10-18 20:05:18 +02:00
Tianyi Zheng
6d1e009f35
Remove depreciated np.float (#7394) 2022-10-18 11:57:03 +02:00
Tianyi Zheng
49cd46acea
Update convolve function namespace (#7390) 2022-10-18 08:09:41 +02:00
Shubham Kondekar
3448ae5cec
[Binary Tree] Different views of binary tree added (#6965)
* Different views of binary tree added

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* mypy errors resolved

* doc test for remaining functions

* Flake8 comments resolved

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Example moved in if block

* doctest cases added

* Cases from if block removed

* Update data_structures/binary_tree/diff_views_of_binary_tree.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update data_structures/binary_tree/diff_views_of_binary_tree.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* PR Comments resolved

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* flake8 warning resolved

* Changes revered

* flake8 issue resolved

* Put the diagrams just above the doctests

* Update diff_views_of_binary_tree.py

* Update diff_views_of_binary_tree.py

* I love mypy

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2022-10-17 22:30:01 +02:00
pre-commit-ci[bot]
0c7c5fa7b0
[pre-commit.ci] pre-commit autoupdate (#7387)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/asottile/pyupgrade: v3.0.0 → v3.1.0](https://github.com/asottile/pyupgrade/compare/v3.0.0...v3.1.0)
- [github.com/codespell-project/codespell: v2.2.1 → v2.2.2](https://github.com/codespell-project/codespell/compare/v2.2.1...v2.2.2)

* updating DIRECTORY.md

* Fix typo discovered by codespell

* Fix typo discovered by codespell

* Update .pre-commit-config.yaml

* Update .pre-commit-config.yaml

* Update .pre-commit-config.yaml

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2022-10-17 21:59:25 +02:00
Caeden Perelli-Harris
a34b756fd4
ci: Add `yesqa (flake8-plugin) to pre-commit` (#7340) 2022-10-16 22:51:40 +02:00
Caeden Perelli-Harris
f15cc2f01c
Follow Flake8 pep3101 and remove modulo formatting (#7339)
* ci: Add ``flake8-pep3101`` plugin to ``pre-commit``

* refactor: Remove all modulo string formatting

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* refactor: Remove ``flake8-pep3101`` plugin from ``pre-commit``

* revert: Revert to modulo formatting

* refactor: Use f-string instead of `join`

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-16 22:50:11 +02:00
SudhanshuSuman
7f6e0b656f
Corrected the directory of Fractional Knapsack algorithm (#7086)
* Moved fractional knapsack from 'dynamic_programming' to 'greedy_methods'

* Updated DIRECTORY.md
2022-10-16 22:41:28 +02:00
Caeden Perelli-Harris
6d20e2b750
Add flake8-broken-line to pre-commit (#7338)
* ci: Add ``flake8-broken-line`` plugin to ``pre-commit``

* refactor: Fix errors from ``flake8-broken-line``
2022-10-16 21:50:48 +02:00
Sagar Giri
b5b1eb2f00
Fix broken links by PR #7277 (#7319) 2022-10-16 15:45:25 +02:00
Advik Sharma
d728f5a96b
Added some more comments to volume.py in maths folder (#7080)
* Added some more comments

added some more comments (to formulas which need it) which make the code more readable and understandable. might make a list of all the formulas on the top, later

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Apply suggestions from code review

* The order changes the result

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix long line

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2022-10-16 15:28:10 +02:00
Caeden
c6582b35bf
refactor: Move constants outside of variable scope (#7262)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2022-10-16 15:03:29 +05:30
Kevin Joven
7776411621
Create q_full_adder.py (#6735)
* Create q_full_adder.py

This is for the #Hacktoberfest.
This circuit is the quantum full adder. I saw that in the repo is the half adder so I decided to build the full adder to complete the set of adders.
I hope that this is enough to be consider a contribution.
Best,
Kevin

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Erase the unused numpy library

* Create the doctest.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* doctest for negative numbers, float, etc.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-16 09:47:54 +02:00
Sagar Giri
e7b6d2824a
Change to https. (#7277)
* Change to https.

* Revert the py_tf file.
2022-10-16 09:43:29 +02:00
CenTdemeern1
04698538d8
Misc fixes across multiple algorithms (#6912)
Source: Snyk code quality
Add scikit-fuzzy to requirements

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com>
2022-10-16 10:55:38 +05:30
Caeden
c94e215c8d
types: Update binary search tree typehints (#7197)
* types: Update binary search tree typehints

* refactor: Don't return `self` in `:meth:insert`

* test: Fix failing doctests

* Apply suggestions from code review

Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com>
2022-10-16 00:51:23 +02:00
Paul
553624fcd4
Add algorithm for Casimir Effect (#7141)
* Add algorithm for Casimir Effect

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix the line length

* Fix the line length

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Import math module and use Pi

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update doctest results

* from math import pi

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2022-10-15 19:39:27 +02:00
Caeden
a652905b60
Add Flake8 comprehensions to pre-commit (#7235)
* ci(pre-commit): Add ``flake8-comprehensions`` to ``pre-commit`` (#7233)

* refactor: Fix ``flake8-comprehensions`` errors

* fix: Replace `map` with generator (#7233)

* fix: Cast `range` objects to `list`
2022-10-15 19:29:42 +02:00
Caeden
98a4c24878
feat: Binary tree node sum (#7020) (#7162)
* feat: Binary tree node sum (#7020)

* feat: Sum of all nodes in binary tree explanation (#7020)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update data_structures/binary_tree/binary_tree_node_sum.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* refactor: Change replace method with `__iter__` overriding (#7020)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2022-10-15 14:58:09 +02:00
Christian Clauss
6be9500b2f
chore: remove checkbox in feature issue template (#7212)
We do not assign issues in this repo

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2022-10-15 12:32:07 +05:30
Dhruv Manilawala
70b60dc323
chore: remove inactive user from CODEOWNERS (#7205)
* chore: remove inactive user from CODEOWNERS

* updating DIRECTORY.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2022-10-15 08:37:59 +02:00
Caeden
6e69181d1f
refactor: Replace list() and dict() calls with literals (#7198) 2022-10-15 06:37:03 +05:30
Claudio Lucisano
dcca5351c9
Added astronomical_length_scale_conversion.py (#7183) 2022-10-15 00:45:12 +02:00
Lukas Esc
5dc0dc4d23
remove useless bool() call (#7189) 2022-10-15 00:37:15 +02:00
Caeden
2058775005
refactor: Make code more understandable (#7196)
* refactor: Make code more understandable

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-15 00:25:15 +02:00
Abinash Satapathy
0c06b25582
Create speed_conversions.py (#7128)
* Update README.md

Added Google Cirq references

* Create barcode_validator.py

Barcode/EAN validator

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update barcode_validator.py

Included docstring and updated variables to snake_case

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update barcode_validator.py

Included docset and updated bugs

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update barcode_validator.py

Implemented the changes asked in review.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update barcode_validator.py

Updated with f-string format

* Update barcode_validator.py

* Update volume_conversions.py

Simpler doctest output

* Create speed_conversions.py

Conversion of speed units

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update speed_conversions.py

Doctests updated, dictionary implemented.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update speed_conversions.py

Reduced LOC

* Update volume_conversions.py

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2022-10-14 23:42:41 +02:00
Abinash Satapathy
fd5ab45492
Doctest output simpler version (#7116)
* Update README.md

Added Google Cirq references

* Create barcode_validator.py

Barcode/EAN validator

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update barcode_validator.py

Included docstring and updated variables to snake_case

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update barcode_validator.py

Included docset and updated bugs

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update barcode_validator.py

Implemented the changes asked in review.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update barcode_validator.py

Updated with f-string format

* Update barcode_validator.py

* Update volume_conversions.py

Simpler doctest output

* Update volume_conversions.py

Fixed indentation

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2022-10-14 17:47:39 +02:00
Dhruv Manilawala
e40c7b4bf1
refactor: move flake8 config (#7167)
* refactor: move flake8 config

* Update .pre-commit-config.yaml

Co-authored-by: Christian Clauss <cclauss@me.com>
2022-10-14 16:34:44 +02:00
Md Mahiuddin
26fe4c6539
Remove extra Semicolon (#7152) 2022-10-14 09:20:40 +02:00
AkshajV1309
05e19128f7
Create norgate.py (#7133)
* Create norgate.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Create norgate.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update boolean_algebra/norgate.py

* Update boolean_algebra/norgate.py

* Update boolean_algebra/norgate.py

* Update boolean_algebra/norgate.py

* Update boolean_algebra/norgate.py

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2022-10-13 22:24:31 +02:00
Anurag Shukla
3deb4a3042
Create binary_search_matrix.py (#6995)
* Create binary_search_matrix.py

Added an algorithm to search in matrix

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update binary_search_matrix.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix Indentation

* Update matrix/binary_search_matrix.py

Co-authored-by: Christian Clauss <cclauss@me.com>

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2022-10-13 22:03:15 +02:00
Advik Sharma
71353ed797
refined readme.md (#7081)
* refined readme.md

added some refinements to readme.md

* Update README.md

Co-authored-by: Christian Clauss <cclauss@me.com>
2022-10-13 19:09:48 +02:00
Caeden
4d0c830d2c
Add flake8 pluin flake8 bugbear to pre-commit (#7132)
* ci(pre-commit): Add ``flake8-builtins`` additional dependency to ``pre-commit`` (#7104)

* refactor: Fix ``flake8-builtins`` (#7104)

* fix(lru_cache): Fix naming conventions in docstrings (#7104)

* ci(pre-commit): Order additional dependencies alphabetically (#7104)

* fix(lfu_cache): Correct function name in docstring (#7104)

* Update strings/snake_case_to_camel_pascal_case.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update data_structures/stacks/next_greater_element.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update digital_image_processing/index_calculation.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update graphs/prim.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update hashes/djb2.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* refactor: Rename `_builtin` to `builtin_` ( #7104)

* fix: Rename all instances (#7104)

* refactor: Update variable names (#7104)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* ci: Create ``tox.ini`` and ignore ``A003`` (#7123)

* revert: Remove function name changes (#7104)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Rename tox.ini to .flake8

* Update data_structures/heap/heap.py

Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com>

* refactor: Rename `next_` to `next_item` (#7104)

* ci(pre-commit): Add `flake8` plugin `flake8-bugbear` (#7127)

* refactor: Follow `flake8-bugbear` plugin (#7127)

* fix: Correct `knapsack` code (#7127)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com>
2022-10-13 18:03:06 +02:00
Praveen
f176786d12
Update open_google_results.py (#7085)
* update crawl_google_results.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update and rename crawl_google_results.py to open_google_results.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Create crawl_google_results.py

* Update web_programming/open_google_results.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update open_google_results.py

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2022-10-13 17:34:52 +02:00