Skip to content

Commit 1743316

Browse files
committed
Update type hints for numpy ndarray.
1 parent 3470047 commit 1743316

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

pygenalgo/utils/utilities.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from functools import wraps, partial
33

44
import numpy as np
5+
from numpy.typing import NDArray
56

67
# Public interface.
78
__all__ = ["pareto_front", "cost_function", "np_cdist",
@@ -117,7 +118,7 @@ def pareto_front(points: list) -> list:
117118
return list(pareto_points)
118119
# _end_def_
119120

120-
def np_pareto_front(points: np.ndarray) -> np.ndarray:
121+
def np_pareto_front(points: NDArray) -> NDArray:
121122
"""
122123
Simple function that calculates the Pareto (optimal)
123124
front points from a given input points numpy array.
@@ -205,7 +206,7 @@ def function_wrapper(*args, **kwargs) -> dict:
205206
return function_wrapper
206207
# _end_def_
207208

208-
def np_cdist(x_pos: np.ndarray, scaled: bool = False) -> np.ndarray:
209+
def np_cdist(x_pos: NDArray, scaled: bool = False) -> NDArray:
209210
"""
210211
This is equivalent to the scipy.spatial.distance.cdist method with Euclidean
211212
distance metric. It is a tailored version for the purposes of the multimodal

0 commit comments

Comments
 (0)