Skip to content

Commit

Permalink
typing fix
Browse files Browse the repository at this point in the history
  • Loading branch information
GardevoirX committed Feb 15, 2024
1 parent 8532644 commit 5ddb20c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/skmatter/utils/_sparsekde.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class NearestGridAssigner:
def __init__(
self,
metric,
cell: Optional[np.ndarray] = None,
cell: Union[np.ndarray, None] = None,
) -> None:

self.labels_ = None
Expand All @@ -49,7 +49,7 @@ def __init__(
self.grid_weight = None
self.grid_neighbour = None

def fit(self, X: np.ndarray, y: Optional[np.ndarray] = None) -> None:
def fit(self, X: np.ndarray, y: Union[np.ndarray, None] = None) -> None:
"""Fit the data.
Parameters
Expand All @@ -69,8 +69,8 @@ def fit(self, X: np.ndarray, y: Optional[np.ndarray] = None) -> None:
def predict(
self,
X: np.ndarray,
y: Optional[np.ndarray] = None,
sample_weight: Optional[np.ndarray] = None,
y: Union[np.ndarray, None] = None,
sample_weight: Union[np.ndarray, None] = None,
) -> np.ndarray:
"""
Predicts labels for input data and returns an array of labels.
Expand Down Expand Up @@ -472,7 +472,7 @@ def get_gabriel_graph(dist_matrix2: np.ndarray):
return gabriel


def rij(period: Optional[np.ndarray], xi: np.ndarray, xj: np.ndarray) -> np.ndarray:
def rij(period: Union[np.ndarray, None], xi: np.ndarray, xj: np.ndarray) -> np.ndarray:
"""
Calculate the position vector considering the periodic boundary conditions.
Expand Down

0 comments on commit 5ddb20c

Please sign in to comment.