Skip to content

Commit

Permalink
[ENH] Type hints for primitives and string arguments:Part1 (#1472)
Browse files Browse the repository at this point in the history
* Updated 2 functions in _time_series_neighbors.py for including type hints

* Updated 2 functions in _time_series_neighbors.py for including type hints

* Updated 2 functions in _time_series_neighbors.py for including type hints

* Fixes for failing tests in PR

* Fix for pre-commit isort

---------

Co-authored-by: Prasil Prakash <[email protected]>
  • Loading branch information
nileenagp and Prasil Prakash authored Apr 25, 2024
1 parent 317f2a6 commit 23bd240
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions aeon/classification/distance_based/_time_series_neighbors.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
__maintainer__ = []
__all__ = ["KNeighborsTimeSeriesClassifier"]

from typing import List

import numpy as np

from aeon.classification.base import BaseClassifier
Expand Down Expand Up @@ -69,12 +71,12 @@ class KNeighborsTimeSeriesClassifier(BaseClassifier):

def __init__(
self,
distance="dtw",
distance_params=None,
n_neighbors=1,
weights="uniform",
n_jobs=1,
):
distance: str = "dtw",
distance_params: dict = None,
n_neighbors: int = 1,
weights: str = "uniform",
n_jobs: int = 1,
) -> None:
self.distance = distance
self.distance_params = distance_params
self.n_neighbors = n_neighbors
Expand Down Expand Up @@ -214,7 +216,7 @@ def _kneighbors(self, X):
return closest_idx, ws

@classmethod
def get_test_params(cls, parameter_set="default"):
def get_test_params(cls, parameter_set: str = "default") -> List[dict]:
"""Return testing parameter settings for the estimator.
Parameters
Expand Down

0 comments on commit 23bd240

Please sign in to comment.