Commit Graph

3420 Commits

Author SHA1 Message Date
Hashir Ahmad
c5cc8dd3ea
Merge aed9ddb168 into 3e9ca92ca9 2024-11-10 22:27:44 +01:00
pre-commit-ci[bot]
3e9ca92ca9
[pre-commit.ci] pre-commit autoupdate (#12349)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.7.1 → v0.7.2](https://github.com/astral-sh/ruff-pre-commit/compare/v0.7.1...v0.7.2)
- [github.com/tox-dev/pyproject-fmt: v2.4.3 → v2.5.0](https://github.com/tox-dev/pyproject-fmt/compare/v2.4.3...v2.5.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-11-04 21:09:03 +01:00
Christian Clauss
a19bede190
Add scripts/find_git_conflicts.sh (#12343) 2024-11-01 13:40:09 +01:00
pre-commit-ci[bot]
52602ea5b6
[pre-commit.ci] pre-commit autoupdate (#12313)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.7.0 → v0.7.1](https://github.com/astral-sh/ruff-pre-commit/compare/v0.7.0...v0.7.1)
- [github.com/tox-dev/pyproject-fmt: 2.4.3 → v2.4.3](https://github.com/tox-dev/pyproject-fmt/compare/2.4.3...v2.4.3)
- [github.com/abravalheri/validate-pyproject: v0.21 → v0.22](https://github.com/abravalheri/validate-pyproject/compare/v0.21...v0.22)
- [github.com/pre-commit/mirrors-mypy: v1.12.1 → v1.13.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.12.1...v1.13.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-10-28 21:27:00 +01:00
pre-commit-ci[bot]
6e24935f88
[pre-commit.ci] pre-commit autoupdate (#12234)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.6.9 → v0.7.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.6.9...v0.7.0)
- [github.com/tox-dev/pyproject-fmt: 2.3.0 → 2.4.3](https://github.com/tox-dev/pyproject-fmt/compare/2.3.0...2.4.3)
- [github.com/abravalheri/validate-pyproject: v0.20.2 → v0.21](https://github.com/abravalheri/validate-pyproject/compare/v0.20.2...v0.21)
- [github.com/pre-commit/mirrors-mypy: v1.11.2 → v1.12.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.11.2...v1.12.1)

* project_euler/problem_047/sol1.py: def solution(n: int = 4) -> int | None:

* Update sol1.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>
2024-10-22 11:22:34 +02:00
pre-commit-ci[bot]
03a42510b0
[pre-commit.ci] pre-commit autoupdate (#12071)
updates:
- [github.com/tox-dev/pyproject-fmt: 2.2.4 → 2.3.0](https://github.com/tox-dev/pyproject-fmt/compare/2.2.4...2.3.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-10-14 22:42:24 +02:00
Christian Clauss
e9e7c96465
Create GitHub Pages docs with Sphinx (#11888) 2024-10-08 19:09:28 +02:00
Jeel Rupapara
260e3d8b35
feat: add test cases in cipher's autokey (#11881) 2024-10-08 13:33:28 +02:00
pre-commit-ci[bot]
2d671df073
[pre-commit.ci] pre-commit autoupdate (#11874)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/pre-commit/pre-commit-hooks: v4.6.0 → v5.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.6.0...v5.0.0)
- [github.com/astral-sh/ruff-pre-commit: v0.6.8 → v0.6.9](https://github.com/astral-sh/ruff-pre-commit/compare/v0.6.8...v0.6.9)

* updating DIRECTORY.md

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <pre-commit-ci[bot]@users.noreply.github.com>
2024-10-07 22:49:29 +02:00
Lonercode
dba8eecb47
added gronsfeld cipher implementation (#11835)
* added gronsfeld cipher implementation

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

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

* from string import ascii_uppercase

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

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

* Update gronsfeld_cipher.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>
2024-10-07 11:58:07 +02:00
1227haran
cfd6d095f1
Added max_sum_bst.py (#11832)
* Added new algorithm

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

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

* Updated changes

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

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

* Updated filename

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

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

* Updated code

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

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

* Updated the code

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

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

* Updated code

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

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

* Updated the code

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

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

* Updated code

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

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

* Updated the code

* Updated code

* Updated code

* Updated code

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

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

* Updated the code

* Updated code

* Updated code

* Updated code

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

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

* Updated code

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

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

* Updated code

* updated

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

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

* Updated code

* Updated code

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

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

* Updated code

* Updated code

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

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

* Updated code

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

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

* Updated code

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

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

* Apply suggestions from code review

* Update maximum_sum_bst.py

* def max_sum_bst(root: TreeNode | None) -> int:

* def solver(node: TreeNode | None) -> tuple[bool, int, int, int]:

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2024-10-07 10:36:15 +02:00
Jeel Rupapara
3422ebc75b
feat: add testcase of polynom_for_points (#11811)
* feat: add testcase of polynom_for_points

* fix: remove the print from the testcase of points_to_polynomial

* fix: remove print statement from old test cases
2024-10-07 08:30:11 +02:00
Hashir Ahmad
aed9ddb168 Merge branch 'algorithm/byte-pair-encoding' of https://github.com/hash-ir/Python into algorithm/byte-pair-encoding 2024-10-05 19:53:39 +02:00
Hashir Ahmad
790475a622 feat: replace dict get with dunder method 2024-10-05 19:52:56 +02:00
Vineet Kumar
fcf82a1eda
Implemented Exponential Search with binary search for improved perfor… (#11666)
* Implemented Exponential Search with binary search for improved performance on large sorted arrays.

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

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

* Added type hints and doctests for binary_search and exponential_search functions. Improved code documentation and ensured testability.

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

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

* Update and rename Exponential_Search.py to exponential_search.py

* [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>
2024-10-05 10:34:48 -07:00
hash-ir
0f6994c67e updating DIRECTORY.md 2024-10-05 17:34:09 +00:00
Hashir Ahmad
5b58203a0f feat: String Tokenization with Byte-Pair Encoding 2024-10-05 19:31:26 +02:00
Andrey Ivanov
ad6395d340
Update ruff usage example in CONTRIBUTING.md (#11772)
* Update ruff usage example

* Update CONTRIBUTING.md

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>

---------

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
2024-10-05 10:24:58 -07:00
Jeel Rupapara
50aca04c67
feat: increase test coverage of longest_common_subsequence to 75% (#11777) 2024-10-05 10:21:43 -07:00
1227haran
5a8655d306
Added new algorithm to generate numbers in lexicographical order (#11674)
* Added algorithm to generate numbers in lexicographical order

* Removed the test cases

* Updated camelcase to snakecase

* Added doctest

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

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

* Added descriptive name for n

* Reduced the number of letters

* Updated the return type

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

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

* Updated import statement

* Updated return type to Iterator[int]

* removed parentheses

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-10-05 10:19:58 -07:00
ARNAV RAJ
9a572dec2b
feat: Implemented Matrix Exponentiation Method (#11747)
* feat: add Matrix Exponentiation method
docs: updated the header documentation and added new documentation for
the new function.

* feat: added new function matrix exponetiation method

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

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

* feat: This function uses the tail-recursive form of the Euclidean algorithm to calculate

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

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

* reduced the number of characters per line in the comments

* removed unwanted code

* feat: Implemented a new function to swaap numbers without dummy variable

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

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

* removed previos code

* Done with the required changes

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

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

* Done with the required changes

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

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

* Done with the required changes

* Done with the required changes

* Done with the required changes

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

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

* Update maths/fibonacci.py

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>

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

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

* Done with the required changes

* Done with the required changes

* Done with the required changes

* [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: Tianyi Zheng <tianyizheng02@gmail.com>
2024-10-04 09:29:39 -07:00
Lonercode
59ff87dc55
Added doctests to min_cost_string_conversion.py and removed :c specifier (#11721)
* Added doctests to min_cost_string_conversion.py and removed :c specifier

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

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

* resolved line length issues based on ruff requirements

* modified in compliance with ruff for line length

* Update strings/min_cost_string_conversion.py

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
2024-10-04 02:36:14 -07:00
Sai Aswin Madhavan
917ad62105
Removed incorrect type hints (#11711) 2024-10-04 02:28:50 -07:00
Hardik Pawar
e20b503b24
Improve comments, add doctests for kahns_algorithm_topo.py (#11668)
* Improve comments, add doctests for kahns_algorithm_topo.py

* Improve function docstring

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

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

* Rename variables, remove print

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-10-04 02:06:08 -07:00
JeevaRamanathan
40f65e8150
Improve comments, docstrings in next_greatest_element.py (#11685)
* Improve comments in next_greatest_element.py

Signed-off-by: JeevaRamanathan <jeevaramanathan.m@infosys.com>

* few changes

Signed-off-by: JeevaRamanathan <jeevaramanathan.m@infosys.com>

* updated descriptions of the functions parameters

Signed-off-by: JeevaRamanathan <jeevaramanathan.m@infosys.com>

---------

Signed-off-by: JeevaRamanathan <jeevaramanathan.m@infosys.com>
2024-10-02 17:18:01 -07:00
Aswin P Kumar
080e7903a0
Add Word Break algorithm (#11687)
* Add Word Break algorithm

* Add Word Break algorithm

* [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>
2024-10-02 17:03:48 -07:00
Ali Rashid
f4b4ac159a
Adding Doctests to floyd_warshall.py (#11690)
* Ruff test resolution

* [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>
2024-10-02 16:54:56 -07:00
1227haran
918fa8bb8a
Optimized O(n) to O(1) (#11669) 2024-10-02 11:07:07 -07:00
Hardik Pawar
00e9d86224
Improve comments, add doctests in symmetric_tree.py (#11619) 2024-10-01 19:54:12 -07:00
Hardik Pawar
43a47e01eb
Add word ladder algorithm in backtracking (#11590)
* Add word ladder algorithm in backtracking

* Improve comments and implement ruff checks

* updating DIRECTORY.md

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

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

* Change BFS to Backtracking

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

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

* Incorporate PR Changes

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

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

* Add type hints for backtrack function

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

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

---------

Co-authored-by: Hardvan <Hardvan@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-10-01 19:48:17 -07:00
Christian Clauss
0abeeab39f
Drop six from our GitHub Actions (#11621)
Drop https://six.readthedocs.io
2024-10-01 17:32:31 +02:00
Christian Clauss
0177ae1cd5
Upgrade to Python 3.13 (#11588) 2024-09-30 23:01:15 +02:00
pre-commit-ci[bot]
a7bfa22455
[pre-commit.ci] pre-commit autoupdate (#11594)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.6.7 → v0.6.8](https://github.com/astral-sh/ruff-pre-commit/compare/v0.6.7...v0.6.8)
- [github.com/abravalheri/validate-pyproject: v0.19 → v0.20.2](https://github.com/abravalheri/validate-pyproject/compare/v0.19...v0.20.2)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-09-30 22:16:17 +02:00
Christian Clauss
a9ca110d6b
Scripts for closing pull requests for Hacktoberfest (#11587)
* Scripts for closing pull requests for Hacktoberfest

* --limit=500

* Lose 2024
2024-09-30 12:49:31 +02:00
Ramy
976e385c1d
Implemented Suffix Tree Data Structure (#11554)
* Implemented KD-Tree Data Structure

* Implemented KD-Tree Data Structure. updated DIRECTORY.md.

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

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

* Create __init__.py

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

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

* Replaced legacy `np.random.rand` call with `np.random.Generator` in kd_tree/example_usage.py

* Replaced legacy `np.random.rand` call with `np.random.Generator` in kd_tree/hypercube_points.py

* added typehints and docstrings

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

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

* docstring for search()

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

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

* Added tests. Updated docstrings/typehints

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

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

* updated tests and used | for type annotations

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

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

* E501 for build_kdtree.py, hypercube_points.py, nearest_neighbour_search.py

* I001 for example_usage.py and test_kdtree.py

* I001 for example_usage.py and test_kdtree.py

* Update data_structures/kd_tree/build_kdtree.py

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

* Update data_structures/kd_tree/example/hypercube_points.py

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

* Update data_structures/kd_tree/example/hypercube_points.py

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

* Added new test cases requested in Review. Refactored the test_build_kdtree() to include various checks.

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

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

* Considered ruff errors

* Considered ruff errors

* Apply suggestions from code review

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

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

* Update kd_node.py

* imported annotations from __future__

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

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

* Implementation of the suffix tree data structure

* Adding data to DIRECTORY.md

* Minor file renaming

* minor correction

* renaming in DIRECTORY.md

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

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

* Considering ruff part-1

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

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

* Considering ruff part-2

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

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

* Considering ruff part-3

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

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

* Considering ruff part-4

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

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

* Considering ruff part-5

* Implemented Suffix Tree Data Structure.
Added some comments to my files in #11532, #11554.

* updating DIRECTORY.md

* Implemented Suffix Tree Data Structure.
Added some comments to my files in #11532, #11554.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: Ramy-Badr-Ahmed <Ramy-Badr-Ahmed@users.noreply.github.com>
2024-09-28 15:37:00 +02:00
apples53
9b5641d2d3
balance parenthesis (add closing bracket) (#11563)
* balance parenthesis (add closing bracket)

* Apply suggestions from code review

---------

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
2024-09-24 00:30:36 -07:00
pre-commit-ci[bot]
50cc00bb2d
[pre-commit.ci] pre-commit autoupdate (#11579)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.6.5 → v0.6.7](https://github.com/astral-sh/ruff-pre-commit/compare/v0.6.5...v0.6.7)
- [github.com/tox-dev/pyproject-fmt: 2.2.3 → 2.2.4](https://github.com/tox-dev/pyproject-fmt/compare/2.2.3...2.2.4)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-09-23 21:45:14 +02:00
pre-commit-ci[bot]
77bbe58421
[pre-commit.ci] pre-commit autoupdate (#11568)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.6.4 → v0.6.5](https://github.com/astral-sh/ruff-pre-commit/compare/v0.6.4...v0.6.5)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-09-17 00:14:55 +02:00
pre-commit-ci[bot]
729c1f923b
[pre-commit.ci] pre-commit autoupdate (#11557)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.6.3 → v0.6.4](https://github.com/astral-sh/ruff-pre-commit/compare/v0.6.3...v0.6.4)
- [github.com/tox-dev/pyproject-fmt: 2.2.1 → 2.2.3](https://github.com/tox-dev/pyproject-fmt/compare/2.2.1...2.2.3)

* updating DIRECTORY.md

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <pre-commit-ci[bot]@users.noreply.github.com>
2024-09-09 22:15:17 +02:00
Ramy
f16d38f26f
kd tree data structure implementation (#11532)
* Implemented KD-Tree Data Structure

* Implemented KD-Tree Data Structure. updated DIRECTORY.md.

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

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

* Create __init__.py

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

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

* Replaced legacy `np.random.rand` call with `np.random.Generator` in kd_tree/example_usage.py

* Replaced legacy `np.random.rand` call with `np.random.Generator` in kd_tree/hypercube_points.py

* added typehints and docstrings

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

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

* docstring for search()

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

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

* Added tests. Updated docstrings/typehints

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

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

* updated tests and used | for type annotations

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

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

* E501 for build_kdtree.py, hypercube_points.py, nearest_neighbour_search.py

* I001 for example_usage.py and test_kdtree.py

* I001 for example_usage.py and test_kdtree.py

* Update data_structures/kd_tree/build_kdtree.py

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

* Update data_structures/kd_tree/example/hypercube_points.py

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

* Update data_structures/kd_tree/example/hypercube_points.py

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

* Added new test cases requested in Review. Refactored the test_build_kdtree() to include various checks.

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

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

* Considered ruff errors

* Considered ruff errors

* Apply suggestions from code review

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

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

* Update kd_node.py

* imported annotations from __future__

* [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>
2024-09-03 14:39:09 +02:00
pre-commit-ci[bot]
bd8085cfc1
[pre-commit.ci] pre-commit autoupdate (#11535)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.6.2 → v0.6.3](https://github.com/astral-sh/ruff-pre-commit/compare/v0.6.2...v0.6.3)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-09-02 21:41:55 +02:00
pre-commit-ci[bot]
c8e131b86c
[pre-commit.ci] pre-commit autoupdate (#11522)
updates:
- [github.com/abravalheri/validate-pyproject: v0.18 → v0.19](https://github.com/abravalheri/validate-pyproject/compare/v0.18...v0.19)
- [github.com/pre-commit/mirrors-mypy: v1.11.1 → v1.11.2](https://github.com/pre-commit/mirrors-mypy/compare/v1.11.1...v1.11.2)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-08-26 21:49:42 +02:00
Maxim Smolskiy
e3fa014a5a
Fix ruff (#11527)
* updating DIRECTORY.md

* Fix ruff

* Fix

* Fix

* Fix

* Revert "Fix"

This reverts commit 5bc3bf3422.

* find_max.py: noqa: PLR1730

---------

Co-authored-by: MaximSmolskiy <MaximSmolskiy@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2024-08-25 17:33:11 +02:00
Tianyi Zheng
48418280b1
Remove separate directory for gaussian_elimination_pivoting.py (#11445)
* updating DIRECTORY.md

* Remove separate directory for gaussian_elimination_pivoting.py

Delete the directory linear_algebra/src/gaussian_elimination_pivoting/
and move its algorithm file, gaussian_elimination_pivoting.py, into the
parent src/ directory. The gaussian_elimination_pivoting/ directory only
exists because gaussian_elimination_pivoting.py reads an example numpy
array from matrix.txt, but this input file and IO operation is entirely
unnecessary because gaussian_elimination_pivoting.py already has the
exact same array hard-coded into a variable.

* updating DIRECTORY.md

---------

Co-authored-by: tianyizheng02 <tianyizheng02@users.noreply.github.com>
2024-08-22 18:42:40 +02:00
pre-commit-ci[bot]
31c424fc86
[pre-commit.ci] pre-commit autoupdate (#11515)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.5.6 → v0.5.7](https://github.com/astral-sh/ruff-pre-commit/compare/v0.5.6...v0.5.7)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-08-12 22:55:46 +02:00
CarlosZamG
ed1900f1b3
Fix typo in integration_by_simpson_approx.py (#11501) 2024-08-06 01:44:58 -07:00
pre-commit-ci[bot]
dfe67954f7
[pre-commit.ci] pre-commit autoupdate (#11507)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.5.5 → v0.5.6](https://github.com/astral-sh/ruff-pre-commit/compare/v0.5.5...v0.5.6)
- [github.com/tox-dev/pyproject-fmt: 2.1.4 → 2.2.1](https://github.com/tox-dev/pyproject-fmt/compare/2.1.4...2.2.1)
- [github.com/pre-commit/mirrors-mypy: v1.11.0 → v1.11.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.11.0...v1.11.1)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-08-06 00:11:14 +02:00
pre-commit-ci[bot]
240d1b7cd4
[pre-commit.ci] pre-commit autoupdate (#11500)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.5.4 → v0.5.5](https://github.com/astral-sh/ruff-pre-commit/compare/v0.5.4...v0.5.5)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-07-29 21:41:09 +02:00
Ihor Pryyma
146800307c
Add doctests to interpolation_search.py (#11492)
* Add doctests to interpolation_search.py

* update docs

* update tests

* update tests 2

* clean code
2024-07-25 17:56:31 +02:00
pre-commit-ci[bot]
d9ded0727a
[pre-commit.ci] pre-commit autoupdate (#11495)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.5.2 → v0.5.4](https://github.com/astral-sh/ruff-pre-commit/compare/v0.5.2...v0.5.4)
- [github.com/pre-commit/mirrors-mypy: v1.10.1 → v1.11.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.10.1...v1.11.0)

* ruff rule PLR1714 Consider merging multiple comparisons

* ruff rule RUF005 Consider `[*self.urls, "", "#"]` instead of concatenation

* Update emails_from_url.py

* Update emails_from_url.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>
2024-07-23 10:40:10 +02:00