Skip to content

Commit d33956a

Browse files
committed
Fix sphinx/build_docs warnings for searches
1 parent 804a8b7 commit d33956a

File tree

5 files changed

+6
-0
lines changed

5 files changed

+6
-0
lines changed

searches/double_linear_search.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ def double_linear_search(array: list[int], search_item: int) -> int:
77
88
:param array: the array to be searched
99
:param search_item: the item to be searched
10+
1011
:return the index of search_item, if search_item is in array, else -1
1112
1213
Examples:

searches/hill_climbing.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,14 @@ def hill_climbing(
9999
move towards the neighbor which provides the maximum (or minimum) change.
100100
We keep doing this until we are at a state where we do not have any
101101
neighbors which can improve the solution.
102+
102103
Args:
103104
search_prob: The search state at the start.
104105
find_max: If True, the algorithm should find the maximum else the minimum.
105106
max_x, min_x, max_y, min_y: the maximum and minimum bounds of x and y.
106107
visualization: If True, a matplotlib graph is displayed.
107108
max_iter: number of times to run the iteration.
109+
108110
Returns a search state having the maximum (or minimum) score.
109111
"""
110112
current_state = search_prob

searches/interpolation_search.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ def interpolation_search(sorted_collection: list[int], item: int) -> int | None:
1313
1414
Returns:
1515
int: The index of the found item, or None if the item is not found.
16+
1617
Examples:
1718
>>> interpolation_search([1, 2, 3, 4, 5], 2)
1819
1

searches/simulated_annealing.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def simulated_annealing(
3434
start_temperate: the initial temperate of the system when the program starts.
3535
rate_of_decrease: the rate at which the temperate decreases in each iteration.
3636
threshold_temp: the threshold temperature below which we end the search
37+
3738
Returns a search state having the maximum (or minimum) score.
3839
"""
3940
search_end = False

searches/tabu_search.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ def find_neighborhood(solution, dict_of_neighbours):
139139
from the solution that the method took as an input
140140
141141
Example:
142+
142143
>>> find_neighborhood(['a', 'c', 'b', 'd', 'e', 'a'],
143144
... {'a': [['b', '20'], ['c', '18'], ['d', '22'], ['e', '26']],
144145
... 'c': [['a', '18'], ['b', '10'], ['d', '23'], ['e', '24']],

0 commit comments

Comments
 (0)