Skip to content

Commit a0dd7b7

Browse files
committed
Improved docs
1 parent a31cb31 commit a0dd7b7

1 file changed

Lines changed: 26 additions & 10 deletions

File tree

src/tdamapper/core.py

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,7 @@
3131
from __future__ import annotations
3232

3333
import logging
34-
from typing import (
35-
Any,
36-
Callable,
37-
Dict,
38-
Generator,
39-
List,
40-
Optional,
41-
Protocol,
42-
Union,
43-
)
34+
from typing import Any, Callable, Dict, Generator, List, Optional, Protocol, Union
4435

4536
import networkx as nx
4637
import numpy as np
@@ -367,12 +358,37 @@ class TrivialCover(ParamsMixin):
367358
"""
368359

369360
def fit(self, X: ArrayLike) -> TrivialCover:
361+
"""
362+
Fit the cover algorithm to the data.
363+
364+
:param X: A dataset of n points.
365+
:return: self
366+
"""
370367
return self
371368

372369
def transform(self, X: ArrayLike) -> Generator[List[int], None, None]:
370+
"""
371+
Transform the data into overlapping open sets.
372+
373+
This method yields a generator that produces a single list containing
374+
the indices of all points in the dataset.
375+
376+
:param X: A dataset of n points.
377+
:yield: A generator yielding a single list of indices.
378+
"""
373379
yield list(range(len(X)))
374380

375381
def fit_transform(self, X: ArrayLike) -> Generator[List[int], None, None]:
382+
"""
383+
Fit the cover algorithm to the data and transform it.
384+
385+
This method fits the cover algorithm to the data and then yields a
386+
generator that produces a single list containing the indices of all
387+
points in the dataset.
388+
389+
:param X: A dataset of n points.
390+
:return: A generator yielding a single list of indices.
391+
"""
376392
self.fit(X)
377393
return self.transform(X)
378394

0 commit comments

Comments
 (0)