-
Rate limit · GitHub Access has been restricted
You have triggered a rate limit.
Please wait a few minutes before you try again;
in some cases this may take up to an hour. -
Notifications
You must be signed in to change notification settings - Fork 46.5k
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
[mypy] Add/fix type annotations for similarity search in machine learning #4088
Access has been restricted
You have triggered a rate limit.
Please wait a few minutes before you try again;
in some cases this may take up to an hour.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your pull request!🤩
def similarity_search(dataset: np.ndarray, value_array: np.ndarray) -> list: | ||
def similarity_search( | ||
dataset: np.ndarray, value_array: np.ndarray | ||
) -> List[List[float]]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The return type hint does not seem to be correct as per the given examples:
[[[0], 0.0]]
[[[0, 0, 0], 1.0]]
[[[0, 0, 0], 0.0], [[0, 0, 0], 1.0]]
Maybe:
List[List[Union[List[float], float]]]
I would suggest changing the return data type but that is out of scope for this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the wait, I've been a bit busy. Thank you for your contribution! LGTM! 🎉
…ning (TheAlgorithms#4088) * [mypy] Add/fix type annotations for similarity search in machine learning * fix annotation * fix annotation (Union) * isort
…ning (TheAlgorithms#4088) * [mypy] Add/fix type annotations for similarity search in machine learning * fix annotation * fix annotation (Union) * isort
…ning (TheAlgorithms#4088) * [mypy] Add/fix type annotations for similarity search in machine learning * fix annotation * fix annotation (Union) * isort
$ mypy --strict machine_learning/similarity_search.py --ignore-missing-imports
Success: no issues found in 1 source file
Describe your change:
Related Issue: #4052
Checklist:
Fixes: #{$ISSUE_NO}
.