File tree 2 files changed +7
-2
lines changed 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -645,6 +645,11 @@ def _int_to_real(array: np.ndarray) -> np.ndarray:
645
645
def _check_array_key (array : np .ndarray , key : Any ) -> Any :
646
646
"""Check a getitem key."""
647
647
key = check_array_indexer (array , key )
648
+ if isinstance (key , tuple ):
649
+ non_ellipsis = [i for i in key if i is not Ellipsis ]
650
+ if len (non_ellipsis ) > 1 :
651
+ raise KeyError (key )
652
+ key = non_ellipsis [0 ]
648
653
649
654
if isinstance (key , numbers .Integral ): # To accept also numpy ints
650
655
key = int (key )
Original file line number Diff line number Diff line change 5
5
6
6
import numpy as np
7
7
8
- from ...misc .metrics import l2_distance , l2_norm
8
+ from ...misc .metrics import Metric , l2_distance , l2_norm
9
9
from ...representation import FData , FDataGrid
10
10
from ..depth import Depth , ModifiedBandDepth
11
11
@@ -121,7 +121,7 @@ def geometric_median(
121
121
X : T ,
122
122
* ,
123
123
tol : float = 1.e-8 ,
124
- metric : Callable [[ T , T ], np . ndarray ] = l2_distance ,
124
+ metric : Metric [ T ] = l2_distance ,
125
125
) -> T :
126
126
r"""Compute the geometric median.
127
127
You can’t perform that action at this time.
0 commit comments