Skip to content

Commit

Permalink
Closes #3864 max and min of bool to return bool like numpy
Browse files Browse the repository at this point in the history
  • Loading branch information
ajpotts committed Nov 15, 2024
1 parent 0f5f0a3 commit 1e28c6f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/ReductionMsg.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,18 @@ module ReductionMsg
}

@arkouda.registerCommand
proc maxAll(const ref x:[?d] ?t, skipNan: bool): reductionReturnType(t) throws
proc maxAll(const ref x:[?d] ?t, skipNan: bool): t throws
where t==int || t==real || t==uint(64) || t==bool
{
use SliceReductionOps;
return getMaxSlice(x, x.domain, skipNan);
}

@arkouda.registerCommand
proc max(const ref x:[?d] ?t, axis: list(int), skipNan: bool): [] reductionReturnType(t) throws
proc max(const ref x:[?d] ?t, axis: list(int), skipNan: bool): [] t throws
where t==int || t==real || t==uint(64) || t==bool {
use SliceReductionOps;
type opType = reductionReturnType(t);
type opType = t;
const (valid, axes) = validateNegativeAxes(axis, x.rank);
if !valid {
throw new Error("Invalid axis value(s) '%?' in slicing reduction".format(axis));
Expand All @@ -117,18 +117,18 @@ module ReductionMsg
}

@arkouda.registerCommand
proc minAll(const ref x:[?d] ?t, skipNan: bool): reductionReturnType(t) throws
proc minAll(const ref x:[?d] ?t, skipNan: bool): t throws
where t==int || t==real || t==uint(64) || t==bool
{
use SliceReductionOps;
return getMinSlice(x, x.domain, skipNan);
}

@arkouda.registerCommand
proc min(const ref x:[?d] ?t, axis: list(int), skipNan: bool): [] reductionReturnType(t) throws
proc min(const ref x:[?d] ?t, axis: list(int), skipNan: bool): [] t throws
where t==int || t==real || t==uint(64) || t==bool {
use SliceReductionOps;
type opType = reductionReturnType(t);
type opType = t;
const (valid, axes) = validateNegativeAxes(axis, x.rank);
if !valid {
throw new Error("Invalid axis value(s) '%?' in slicing reduction".format(axis));
Expand Down

0 comments on commit 1e28c6f

Please sign in to comment.