Skip to content

Commit

Permalink
Closes #3855: refactor boolReductionMsg
Browse files Browse the repository at this point in the history
  • Loading branch information
ajpotts committed Oct 31, 2024
1 parent eccf553 commit 421ea95
Show file tree
Hide file tree
Showing 10 changed files with 505 additions and 393 deletions.
1 change: 1 addition & 0 deletions ServerModules.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ OperatorMsg
ParquetMsg
RandMsg
ReductionMsg
ReductionMsgFunctions
RegistrationMsg
SegmentedMsg
SequenceMsg
Expand Down
24 changes: 4 additions & 20 deletions arkouda/array_api/statistical_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,7 @@ def max(

from arkouda import max as ak_max

arr = Array._new(ak_max(x._array, axis=axis))
if keepdims or axis is None or x.ndim == 1:
return arr
else:
return squeeze(arr, axis)
return Array._new(ak_max(x._array, axis=axis, keepdims=keepdims))


# this is a temporary fix to get mean working with XArray
Expand Down Expand Up @@ -138,11 +134,7 @@ def min(

from arkouda import min as ak_min

arr = Array._new(ak_min(x._array, axis=axis))
if keepdims or axis is None or x.ndim == 1:
return arr
else:
return squeeze(arr, axis)
return Array._new(ak_min(x._array, axis=axis, keepdims=keepdims))


def prod(
Expand Down Expand Up @@ -180,11 +172,7 @@ def prod(

from arkouda import prod as ak_prod

arr = Array._new(ak_prod(x_op, axis=axis))
if keepdims or axis is None or x.ndim == 1:
return arr
else:
return squeeze(arr, axis)
return Array._new(ak_prod(x_op, axis=axis, keepdims=keepdims))


# Not working with XArray yet, pending a fix for:
Expand Down Expand Up @@ -277,11 +265,7 @@ def sum(

from arkouda import sum as ak_sum

arr = Array._new(ak_sum(x_op, axis=axis))
if keepdims or axis is None or x.ndim == 1:
return arr
else:
return squeeze(arr, axis)
return Array._new(ak_sum(x_op, axis=axis, keepdims=keepdims))


# Not working with XArray yet, pending a fix for:
Expand Down
Loading

0 comments on commit 421ea95

Please sign in to comment.