Skip to content

Commit 8408d55

Browse files
committed
Added simple type-hinting
1 parent 936a7dc commit 8408d55

15 files changed

Lines changed: 715 additions & 629 deletions

File tree

src/tdamapper/_common.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import io
99
import pstats
1010
import warnings
11-
from typing import Any, Callable, Protocol
11+
from typing import Any, Callable, Iterator, Protocol
1212

1313
import numpy as np
1414
from numpy.typing import NDArray
@@ -33,6 +33,11 @@ def __setitem__(self, index: int, value: Any) -> None:
3333
Set an item in the array.
3434
"""
3535

36+
def __iter__(self) -> Iterator[Any]:
37+
"""
38+
Iterate over the array.
39+
"""
40+
3641

3742
def deprecated(msg: str) -> Callable[..., Any]:
3843
def deprecated_func(func: Callable[..., Any]) -> Callable[..., Any]:
@@ -119,7 +124,6 @@ def get_params(self, deep: bool = True) -> dict[str, Any]:
119124
Get all public parameters of the object as a dictionary.
120125
121126
:param deep: A flag for returning also nested parameters.
122-
:type deep: bool, optional.
123127
"""
124128
params = {}
125129
for k, v in self.__dict__.items():
@@ -166,10 +170,8 @@ def clone(obj: Any) -> Any:
166170
Clone an estimator, returning a new one, unfitted, having the same public
167171
parameters.
168172
169-
:param estimator: An estimator to be cloned.
170-
:type estimator: A scikit-learn compatible estimator
173+
:param obj: An estimator to be cloned.
171174
:return: A new estimator with the same parameters.
172-
:rtype: A scikit-learn compatible estimator
173175
"""
174176
params = obj.get_params(deep=True)
175177
obj_noargs = type(obj)()

src/tdamapper/_run_app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from tdamapper.app import main
22

33

4-
def run():
4+
def run() -> None:
55
main()
66

77

0 commit comments

Comments
 (0)