@@ -518,8 +518,8 @@ def _pick_second(*x):
518
518
519
519
first = Aggregation ("first" , chunk = None , combine = None , fill_value = 0 )
520
520
last = Aggregation ("last" , chunk = None , combine = None , fill_value = 0 )
521
- nanfirst = Aggregation ("nanfirst" , chunk = "nanfirst" , combine = " nanfirst" , fill_value = np .nan )
522
- nanlast = Aggregation ("nanlast" , chunk = "nanlast" , combine = " nanlast" , fill_value = np .nan )
521
+ nanfirst = Aggregation ("nanfirst" , chunk = "nanfirst" , combine = xrutils . nanfirst , fill_value = np .nan )
522
+ nanlast = Aggregation ("nanlast" , chunk = "nanlast" , combine = xrutils . nanlast , fill_value = np .nan )
523
523
524
524
all_ = Aggregation (
525
525
"all" ,
@@ -577,8 +577,8 @@ def topk_new_dims_func(k) -> tuple[Dim]:
577
577
topk = Aggregation (
578
578
name = "topk" ,
579
579
fill_value = dtypes .NINF ,
580
- chunk = None ,
581
- combine = None ,
580
+ chunk = "topk" ,
581
+ combine = xrutils . topk ,
582
582
final_dtype = None ,
583
583
new_dims_func = topk_new_dims_func ,
584
584
)
@@ -881,10 +881,7 @@ def _initialize_aggregation(
881
881
simple_combine : list [Callable | None ] = []
882
882
for combine in agg .combine :
883
883
if isinstance (combine , str ):
884
- if combine in ["nanfirst" , "nanlast" ]:
885
- simple_combine .append (getattr (xrutils , combine ))
886
- else :
887
- simple_combine .append (getattr (np , combine ))
884
+ simple_combine .append (getattr (np , combine ))
888
885
else :
889
886
simple_combine .append (combine )
890
887
0 commit comments