Andrew Grangaard
f36ee034f1
[mypy] Annotate other/lru_cache and other/lfu_cache ( #5755 )
...
* Adds repr and doctest of current behavior linkedlist in other/lru_cache
* Blocks removal of head or tail of double linked list
* clarifies add() logic for double linked list in other/lru_cache
* expands doctests to compare cache and lru cache
* [mypy] annotates vars for other/lru_cache
* [mypy] Annotates lru_cache decorator for other/lru_cache
* Higher order functions require a verbose Callable annotation
* [mypy] Makes LRU_Cache generic over key and value types for other/lru_cache
+ no reason to force int -> int
* [mypy] makes decorator a classmethod for access to class generic types
* breaks two long lines in doctest for other/lru_cache
* simplifies boundary test remove() for other/lru_cache
* [mypy] Annotates, adds doctests, and makes Generic other/lfu_cache
See also commits to other/lru_cache which guided these
* [mypy] annotates cls var in other/lfu_cache
* cleans up items from code review for lfu_cache and lru_cache
* [mypy] runs mypy on lfu_cache and lru_cache
2021-11-10 23:21:16 +01:00
Rohan R Bharadwaj
e9882e41ba
[mypy] Fix matrix_operation.py
( #5808 )
...
* Update matrix_operation.py
* Update mypy.ini
* Update DIRECTORY.md
* formatting
* Update matrix_operation.py
* doctest for exception
* A bit more...
2021-11-10 16:22:52 +01:00
Rohan R Bharadwaj
745f9e2bc3
[mypy] Type annotations for searches directory ( #5799 )
...
* Update ternary_search.py
* Update mypy.ini
* Update simulated_annealing.py
* Update ternary_search.py
* formatting
* formatting
* Update matrix_operation.py
* Update matrix_operation.py
* Update matrix_operation.py
2021-11-09 16:48:30 +01:00
Rohan R Bharadwaj
ed4c92d98a
[mypy] Type annotations for graphs directory ( #5798 )
...
* Type annotations for `breadth_first_search.py`
* Type annotations for `breadth_first_search_2.py`
* Remove from excluded in mypy.ini
* Add doctest.testmod()
* Type annotations for `graphs/check_cycle.py`
* Type annotations for `graphs/greedy_min_vertex_cover.py`
* Remove from excluded in mypy.ini
2021-11-08 19:18:30 +01:00
Rohan R Bharadwaj
a8aeabdf18
[mypy] Type annotations for graphs/finding_bridges.py
and graphs/random_graph_generator.py
( #5795 )
...
* [mypy] Annotate `graphs/finding_bridges.py`
* Remove from excluded in `mypy.ini`
* Add doctest.testmod()
* psf/black formatting
* Annotations for `graphs/random_graph_generator.py`
* Remove from excluded in `mypy.ini`
* Resolve merge conflict
* Resolve merge conflict
* Update mypy.ini
* Update mypy.ini
* Remove from excluded
2021-11-08 18:18:33 +01:00
Dylan Buchi
ac4bdfd66d
[mypy] Fix type annotations in graphs/boruvka.py
( #5794 )
...
* Fix type annotations in boruvka.py
* Remove graphs/boruvka.py|
* updating DIRECTORY.md
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2021-11-08 21:47:09 +08:00
Rohan R Bharadwaj
a98465230f
[mypy] Fix type annotations for maths directory ( #5782 )
...
* [mypy] Fix annotations in `maths/series/p_series.py`
* Update p_series.py
* Update p_series.py
* Remove from excluded in mypy.ini
* Type annotation for series
* Annotate maths/proth_number.py (properly)
* Remove from excluded in mypy.ini
* Annotate average_mode.py
* Update average_mode.py
* Update average_mode.py
* Update average_mode.py
* Update average_mode.py
* Remove from excluded in mypy.ini
* Fix annotations in gamma_recursive.py
* Remove from excluded in mypy.ini
* Annotations for geometric_series.py
* Update geometric_series.py
* Update mypy.ini
* Update average_mode.py
* Update average_mode.py
* Update average_mode.py
* Update mypy.ini
* Update mypy.ini
* Update mypy.ini
* Update average_mode.py
* Update proth_number.py
* Update average_mode.py
* Update gamma_recursive.py
* Update proth_number.py
* Update mypy.ini
* Update geometric_series.py
* Update average_mode.py
* Update proth_number.py
* Update geometric_series.py
* Update geometric_series.py
* Update geometric_series.py
* Update p_series.py
* Update geometric_series.py
* Update p_series.py
* Update p_series.py
* Update geometric_series.py
* Update p_series.py
* Update p_series.py
* Remove data_structures/stacks/next_greater_element.py|
Co-authored-by: Christian Clauss <cclauss@me.com>
2021-11-07 16:13:58 +01:00
Rohan R Bharadwaj
accee50cde
[mypy] Fix other/fischer_yates_shuffle.py
( #5789 )
...
* [mypy] Fix `other/fischer_yates_shuffle.py`
* Update mypy.ini
2021-11-07 11:14:42 +01:00
Christian Clauss
8ac86f2ce5
mypy: Exclude only 20 files that are still failing ( #5608 )
...
* DRAFT: Run a mypy reality check
Let's see what is required to finish #4052
* mypy --ignore-missing-imports --install-types --non-interactive
* Check our progress...
* Update build.yml
* Update build.yml
* Update build.yml
* Update build.yml
* mypy --exclude 20 files
* --exclude with no `=`
* Update build.yml
* 558 character regex!!!
* With quotes
* mypy.ini: mega exclude
* Update mypy.ini
* Update build.yml
* Update mypy.ini
* Update build.yml
* Update mypy.ini
* .py --> .p*
* Escape the dots!: `.` --> `\.`
* Remove the comment
* Leading slash
* Update mypy.ini
Co-authored-by: Dylan Buchi <devybuchi@gmail.com>
Co-authored-by: Dylan Buchi <devybuchi@gmail.com>
2021-11-06 13:58:15 +01:00
Murilo Gonçalves
4cf1aaeb96
Updated mypy.ini, removed ok folders that were excluded ( #5331 )
2021-10-15 23:57:41 +02:00
Christian Clauss
252df0a149
fix(mypy): Fix files in scripts/ ( #4320 )
2021-04-07 08:12:56 +05:30
algobytewise
531d2d6d7e
Mypy fix rotation.py ( #4319 )
...
* fix type-hints arguments
* fix matrices & image-path
* Update build.yml
* Revert "Update build.yml"
This reverts commit c2d04aef65
.
* use pathlib
* feat: Add mypy configuration file (#4315 )
* feat: Add mypy config file
* refactor: Remove mypy options from build workflow
* Remove linear_algebra
Co-authored-by: Christian Clauss <cclauss@me.com>
* rebase & update mypy.ini
* fix pre-commit errors
Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2021-04-06 15:34:18 +02:00
Dhruv Manilawala
c49fa088a0
feat: Add mypy configuration file ( #4315 )
...
* feat: Add mypy config file
* refactor: Remove mypy options from build workflow
* Remove linear_algebra
Co-authored-by: Christian Clauss <cclauss@me.com>
2021-04-06 12:54:26 +02:00