Skip to content

Commit f84c594

Browse files
Added doc strings #207
1 parent a6791b1 commit f84c594

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

instance_selection/_LocalSets.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,19 @@ def _find_enemy_distance(
8888
label,
8989
labels,
9090
):
91+
"""
92+
It finds the closest enemy sample to the current sample
93+
94+
:param closest_enemy_distance: the distance to the closest enemy sample
95+
:param closest_enemy_sample: the index of the closest enemy sample
96+
:param distances: the distance matrix
97+
:param index: the index of the current sample
98+
:param instances: the data
99+
:param label: the label of the current sample
100+
:param labels: the labels of the samples
101+
:return: The closest enemy distance and the index of the closest enemy
102+
sample.
103+
"""
91104
for index2, (_, label2) in enumerate(zip(instances, labels)):
92105
if index == index2 or label == label2:
93106
continue

semisupervised/DensityPeaks.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ def __step_a(self):
260260
return samples_labeled
261261

262262
def __discover_structure(self):
263+
"""Discovers the under laying structure."""
263264
self._fit_without()
264265

265266
def __nan_search(self):

tests/test_InstanceSelection.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ def to_dataframe(y):
2323
"""
2424
if not isinstance(y, pd.DataFrame):
2525
return pd.DataFrame(y)
26+
return y
2627

2728

2829
@pytest.fixture

utils/dir.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88

99

1010
def check_dir(path):
11+
"""
12+
If the path doesn't exist, create it
13+
14+
:param path: the path to the folder where the ranks solutions will be saved
15+
"""
1116
if not os.path.isdir(path):
1217
os.mkdir(path)
1318
if os.path.isdir(path):

0 commit comments

Comments
 (0)