[mypy] Type annotations for searches directory (#5799) · zinating/algorithms-python@745f9e2 · GitHub
Skip to content

Commit 745f9e2

Browse files
[mypy] Type annotations for searches directory (TheAlgorithms#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
1 parent c3d1ff0 commit 745f9e2

3 files changed

Lines changed: 11 additions & 6 deletions

File tree

mypy.ini

Lines changed: 1 addition & 1 deletion

searches/simulated_annealing.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# https://en.wikipedia.org/wiki/Simulated_annealing
22
import math
33
import random
4+
from typing import Any
45

56
from .hill_climbing import SearchProblem
67

@@ -16,7 +17,7 @@ def simulated_annealing(
1617
start_temperate: float = 100,
1718
rate_of_decrease: float = 0.01,
1819
threshold_temp: float = 1,
19-
) -> SearchProblem:
20+
) -> Any:
2021
"""
2122
Implementation of the simulated annealing algorithm. We start with a given state,
2223
find all its neighbors. Pick a random neighbor, if that neighbor improves the

searches/ternary_search.py

Lines changed: 8 additions & 4 deletions

0 commit comments

Comments
 (0)