Commit Graph

37 Commits

Author SHA1 Message Date
Tianyi Zheng
a64c9f1e7c
Deduplicate euclidean_length method in Vector (#5658)
* Rewrite parts of Vector and Matrix methods

* Refactor determinant method and add unit tests

Refactor determinant method to create separate minor and cofactor
methods.
Add respective unit tests for new methods.
Rename methods using snake case to follow Python naming conventions.

* Reorganize Vector and Matrix methods

* Update linear_algebra/README.md

Co-authored-by: John Law <johnlaw.po@gmail.com>

* Fix punctuation and wording

* Apply suggestions from code review

Co-authored-by: John Law <johnlaw.po@gmail.com>

* Deduplicate euclidean length method for Vector

* Add more unit tests for Euclidean length method

* Fix bug in unit test for euclidean_length

* Remove old comments for magnitude method

Co-authored-by: John Law <johnlaw.po@gmail.com>
2021-10-31 22:16:02 +08:00
Tianyi Zheng
fe5c711ce6
Rewrite parts of Vector and Matrix (#5362)
* Rewrite parts of Vector and Matrix methods

* Refactor determinant method and add unit tests

Refactor determinant method to create separate minor and cofactor
methods.
Add respective unit tests for new methods.
Rename methods using snake case to follow Python naming conventions.

* Reorganize Vector and Matrix methods

* Update linear_algebra/README.md

Co-authored-by: John Law <johnlaw.po@gmail.com>

* Fix punctuation and wording

* Apply suggestions from code review

Co-authored-by: John Law <johnlaw.po@gmail.com>

Co-authored-by: John Law <johnlaw.po@gmail.com>
2021-10-27 11:48:43 +08:00
iradonov
4af5215042
added Schur complement to linear algebra (#4793)
* added schur complement and tests to linear algebra

* updated according to checklist

* updated variable names and typing

* added two testcases for input validation

* fixed import order

Co-authored-by: Ivan Radonov <ivan.radonov@ad.mentormate.bg>
2021-10-18 18:46:47 +02:00
Aman kanojiya
1b0ac73da2
Magnitude and Angle of Vector (#5225)
* Magnitude and Angle 

Core function to find Magnitude and Angle of two Given Vector

* Magnitude and Angle with Doctest

added Doctest to the functions

* Update linear_algebra/src/lib.py

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

* Update linear_algebra/src/lib.py

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

* Changes done 

and Magnitude and Angle Issues

* black

Co-authored-by: Christian Clauss <cclauss@me.com>
2021-10-12 11:51:27 +02:00
Christian Clauss
cecf43d648
Pyupgrade to Python 3.9 (#4718)
* Pyupgrade to Python 3.9

* updating DIRECTORY.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2021-09-07 13:37:03 +02:00
Dhruv Manilawala
8c2986026b
fix(mypy): type annotations for linear algebra algorithms (#4317)
* fix(mypy): type annotations for linear algebra algorithms

* refactor: remove linear algebra directory from mypy exclude
2021-04-05 15:37:38 +02:00
zakademic
533e36d32b
Add conjugate gradient method algorithm (#2486)
* Initial commit of the conjugate gradient method
* Update linear_algebra/src/conjugate_gradient.py
* Added documentation links, changed variable names to lower case and more descriptive naming, added check for symmetry in _is_matrix_spd
* Made changes to some variable naming to be more clear
* Update conjugate_gradient.py

Co-authored-by: Zeyad Zaky <zeyadzaky@Zeyads-MacBook-Pro.local>
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com>
2020-12-12 10:10:23 +05:30
Dhruv
0a42ae9095
Fix all errors mentioned in pre-commit run (#2512)
* Fix all errors mentioned in pre-commit run:

- Fix end of file
- Remove trailing whitespace
- Fix files with black
- Fix imports with isort

* Fix errors
2020-09-30 10:38:00 +02:00
Dhruv
9016fe192f
Fix imports for all namespace packages (#2506)
* Fix imports as they're namespace packages

* Fix import for scripts/validate_filenames.py

* Fix path in doctest
2020-09-28 23:41:04 +02:00
Dhruv
48357cea5b
Add __init__.py files in all the directories (#2503) 2020-09-28 19:42:36 +02:00
Christian Clauss
9200a2e543
from __future__ import annotations (#2464)
* from __future__ import annotations

* fixup! from __future__ import annotations

* fixup! from __future__ import annotations

* fixup! Format Python code with psf/black push

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2020-09-23 13:30:13 +02:00
Christian Clauss
363858ef3b
hyphen_files = [file for file in filepaths if "-" in file] (#2447)
* hyphen_files = [file for file in filepaths if "-" in file]

* updating DIRECTORY.md

* Rename recursive-quick-sort.py to recursive_quick_sort.py

* updating DIRECTORY.md

* Rename aho-corasick.py to aho_corasick.py

* updating DIRECTORY.md

* Rename polynom-for-points.py to polynom_for_points.py

* updating DIRECTORY.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2020-09-19 07:13:10 +02:00
avych
0dea049f44
Added static type checking to polynom-for-points.py towards issue #2128 (#2335)
* Added static type checking to linear_algebra/src/polynom-for-points.py

* Fixed TravisCI errors

* Update polynom-for-points.py

Co-authored-by: Christian Clauss <cclauss@me.com>
2020-09-18 08:37:49 +02:00
Du Yuanchao
4d0a8f2355
Optimized recursive_bubble_sort (#2410)
* optimized recursive_bubble_sort

* Fixed doctest error due whitespace

* reduce loop times for optimization

* fixup! Format Python code with psf/black push

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2020-09-10 10:31:26 +02:00
Yukti Khosla
14199e0590
Create Transformations2D.py (#2310)
* Create Transformations2D.py

* Update Transformations2D.py

* Drop numpy and add type hints and doctests

* Rename Transformations2D.py to transformations_2d.py

Co-authored-by: Christian Clauss <cclauss@me.com>
2020-08-15 18:19:33 +02:00
Christian Clauss
4535283554
Re-blacken (#2246)
* Avoid double spaces

* fixup! Format Python code with psf/black push

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2020-08-01 09:23:23 +05:30
zakademic
977dfaa46c
Linear algebra/power iteration (#2190)
* Initial commit of power iteration.

* Added more documentation for power iteration and rayleigh quotient

* Type hinting for rayleigh quotient

* Changes after running black and flake8.

* Added doctests, added unit tests. Removed Rayleigh quotient as it is not needed.

* Update linear_algebra/src/power_iteration.py

Changed convergence check line.

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

* Update linear_algebra/src/power_iteration.py

Named tests more clearly.

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

* Changed naming in test function to be more clear. Changed naming in doctests to match function call.

* Self running tests

Co-authored-by: Zeyad Zaky <zeyadzaky@Zeyads-MacBook-Pro.local>
Co-authored-by: Christian Clauss <cclauss@me.com>
2020-07-26 10:51:10 +02:00
Christian Clauss
5f4da5d616
isort --profile black . (#2181)
* updating DIRECTORY.md

* isort --profile black .

* Black after

* updating DIRECTORY.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2020-07-06 09:44:19 +02:00
Christian Clauss
1f8a21d727
Tighten up psf/black and flake8 (#2024)
* Tighten up psf/black and flake8

* Fix some tests

* Fix some E741

* Fix some E741

* updating DIRECTORY.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2020-05-22 08:10:11 +02:00
QuantumNovice
bcaa88b26c
Changed the deprecated np.matrix to np.ndarray (#1923) 2020-05-01 17:42:41 +02:00
Christian Clauss
59bf115aa1
uses: actions/checkout@v2 (#1779)
* uses: actions/checkout@v2

* fixup! Format Python code with psf/black push
2020-02-21 15:32:35 +05:30
QuantumNovice
53042f0f45
Create RayleighQuotient.py (#1749)
* Create RayleighQuotient.py

https://en.wikipedia.org/wiki/Rayleigh_quotient

* Update RayleighQuotient.py

* Update and rename RayleighQuotient.py to rayleigh_quotient.py

* Update rayleigh_quotient.py

* Update rayleigh_quotient.py

python/black

* Update rayleigh_quotient.py
2020-02-14 12:56:56 +01:00
onlinejudge95
7b7c1a0135
Fixes unused variable errors in LGTM (#1746)
* Fixes unsed variable errors in LGTM

* Fixes integer check

* Fixes failing tests
2020-02-11 13:59:09 +05:30
Christian Clauss
670f952aa6
Travis CI: Don’t allow bare exceptions (#1734)
* Travis CI: Don’t allow bare exceptions

* fixup! Format Python code with psf/black push

* except IOError:

* except IOError:

* Update hamming_code.py

* IndexError

* Get rid of the nonsense logic

Co-authored-by: John Law <johnlaw.po@gmail.com>
2020-02-07 22:02:08 +02:00
Christian Clauss
bfcb95b297
Create codespell.yml (#1698)
* fixup! Format Python code with psf/black push

* Create codespell.yml

* fixup! Format Python code with psf/black push
2020-01-18 13:24:33 +01:00
Christian Clauss
28419cf839 pyupgrade --py37-plus **/*.py (#1654)
* pyupgrade --py37-plus **/*.py

* fixup! Format Python code with psf/black push
2020-01-03 22:25:36 +08:00
BryanChan777
e09bf69648 Update README.md (#1588)
* Update README.md

* python -m unittest -v
2019-11-23 04:06:52 +01:00
Alex Veltman
ec85cc8191 Fixes in methods and tests in Linear Algebra (#1432)
* Fixes in methods and tests

* Renamed tests.py to test_linear_algebra.py

* removed force_test()

* Delete test_linear_algebra.py

* Format code with psf/black

* Rename tests.py to test_linear_algebra.py
2019-10-24 12:39:51 +02:00
Alex Veltman
07483139d1 Added determinate function (#1429)
* Added determinate function

* Changed determinate function name

* Changed instance of .det() to .determinate()

* Added force_test() function

* Update tests.py
2019-10-24 11:08:45 +02:00
Iqrar Agalosi Nureyza
86a2d5fd03 fixed some typos (#1392)
missing 'c' in eulidianLength and eulidian. Should be euclidianLength and euclidian.
2019-10-18 23:49:30 +02:00
Milad Sadeghi DM
63d8cadc3e Fixing Some Minor Issues (#1386)
* Replacing mutable default argument in __init__

* Fixing typo mistakes in lib.py

* Simplifying chained comparisons

* Update lib.py
2019-10-17 20:13:28 +02:00
Craigory V Coppola
3a06aba66a Update Linear Algebra Readme (#1298)
Update formatting to better indicate matrix and vector sections
2019-10-07 23:32:16 +05:00
William Zhang
9eac17a408 psf/black code formatting (#1277) 2019-10-05 10:14:13 +05:00
PatOnTheBack
6fa3c0b170 Add Flake8 F4 Tests to .travis.yml (#974)
* Add Flake8 F4 Tests to .travis.yml

F4 tests check for import errors. Implements issue #973

* Remove wildcard imports
2019-09-13 14:07:24 +02:00
Christian Clauss
3e69733e44
Remove 'python' from the filename (#1130) 2019-08-15 13:19:38 +02:00
Niclas Dern
158b319d22 New linear algebra algorithm (#1122)
* Added new algorithm which takes points as an input and outputs a polynom connecting them

* Rename Python-Polynom-for-points.py to python-polynom-for-points.py

* Update python-polynom-for-points.py

* Update python-polynom-for-points.py

* Update python-polynom-for-points.py

* Update python-polynom-for-points.py

* Update python-polynom-for-points.py

* Update python-polynom-for-points.py

* Update python-polynom-for-points.py

* Add doctests and run thru psf/black
2019-08-12 09:13:57 +02:00
Christian Clauss
91c3c98d2b
Rename file_transfer and linear_algebra (#1118)
* Rename file_transfer and linear_algebra

* Rename file_transfer and linear_algebra
2019-08-09 21:37:16 +02:00