Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] Type hints for primitives and string arguments:Part1 #1472

Merged
merged 6 commits into from
Apr 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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:
MatthewMiddlehurst marked this conversation as resolved.
Show resolved Hide resolved
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