@@ -2086,6 +2086,7 @@ def _unravel_argminmax(
2086
2086
axis : Union [int , None ],
2087
2087
keep_attrs : Optional [bool ],
2088
2088
skipna : Optional [bool ],
2089
+ out ,
2089
2090
) -> Union ["Variable" , Dict [Hashable , "Variable" ]]:
2090
2091
"""Apply argmin or argmax over one or more dimensions, returning the result as a
2091
2092
dict of DataArray that can be passed directly to isel.
@@ -2110,7 +2111,7 @@ def _unravel_argminmax(
2110
2111
# Return int index if single dimension is passed, and is not part of a
2111
2112
# sequence
2112
2113
return getattr (self , "_injected_" + str (argminmax ))(
2113
- dim = dim , axis = axis , keep_attrs = keep_attrs , skipna = skipna
2114
+ dim = dim , axis = axis , keep_attrs = keep_attrs , skipna = skipna , out = out
2114
2115
)
2115
2116
2116
2117
# Get a name for the new dimension that does not conflict with any existing
@@ -2127,7 +2128,7 @@ def _unravel_argminmax(
2127
2128
reduce_shape = tuple (self .sizes [d ] for d in dim )
2128
2129
2129
2130
result_flat_indices = getattr (stacked , "_injected_" + str (argminmax ))(
2130
- axis = - 1 , skipna = skipna
2131
+ axis = - 1 , skipna = skipna , out = out
2131
2132
)
2132
2133
2133
2134
result_unravelled_indices = np .unravel_index (result_flat_indices , reduce_shape )
@@ -2151,6 +2152,7 @@ def argmin(
2151
2152
axis : Union [int , None ] = None ,
2152
2153
keep_attrs : bool = None ,
2153
2154
skipna : bool = None ,
2155
+ out = None ,
2154
2156
) -> Union ["Variable" , Dict [Hashable , "Variable" ]]:
2155
2157
"""Indices of the minimum of the DataArray over one or more dimensions. Result
2156
2158
returned as dict of DataArrays, which can be passed directly to isel().
@@ -2175,6 +2177,9 @@ def argmin(
2175
2177
skips missing values for float dtypes; other dtypes either do not
2176
2178
have a sentinel missing value (int) or skipna=True has not been
2177
2179
implemented (object, datetime64 or timedelta64).
2180
+ out : None
2181
+ 'out' should not be passed - provided for compatibility with numpy function
2182
+ signature
2178
2183
2179
2184
Returns
2180
2185
-------
@@ -2184,14 +2189,15 @@ def argmin(
2184
2189
--------
2185
2190
DataArray.argmin, DataArray.idxmin
2186
2191
"""
2187
- return self ._unravel_argminmax ("argmin" , dim , axis , keep_attrs , skipna )
2192
+ return self ._unravel_argminmax ("argmin" , dim , axis , keep_attrs , skipna , out )
2188
2193
2189
2194
def argmax (
2190
2195
self ,
2191
2196
dim : Union [Hashable , Sequence [Hashable ]] = None ,
2192
2197
axis : Union [int , None ] = None ,
2193
2198
keep_attrs : bool = None ,
2194
2199
skipna : bool = None ,
2200
+ out = None ,
2195
2201
) -> Union ["Variable" , Dict [Hashable , "Variable" ]]:
2196
2202
"""Indices of the maximum of the DataArray over one or more dimensions. Result
2197
2203
returned as dict of DataArrays, which can be passed directly to isel().
@@ -2216,6 +2222,9 @@ def argmax(
2216
2222
skips missing values for float dtypes; other dtypes either do not
2217
2223
have a sentinel missing value (int) or skipna=True has not been
2218
2224
implemented (object, datetime64 or timedelta64).
2225
+ out : None
2226
+ 'out' should not be passed - provided for compatibility with numpy function
2227
+ signature
2219
2228
2220
2229
Returns
2221
2230
-------
@@ -2225,7 +2234,7 @@ def argmax(
2225
2234
--------
2226
2235
DataArray.argmax, DataArray.idxmax
2227
2236
"""
2228
- return self ._unravel_argminmax ("argmax" , dim , axis , keep_attrs , skipna )
2237
+ return self ._unravel_argminmax ("argmax" , dim , axis , keep_attrs , skipna , out )
2229
2238
2230
2239
2231
2240
ops .inject_all_ops_and_reduce_methods (Variable )
0 commit comments