@@ -927,7 +927,7 @@ def test_ceil(x):
927
927
928
928
929
929
@pytest .mark .min_version ("2023.12" )
930
- @given (x = hh .arrays (dtype = hh .real_floating_dtypes , shape = hh .shapes ()), data = st .data ())
930
+ @given (x = hh .arrays (dtype = hh .int_dtypes , shape = hh .shapes ()), data = st .data ())
931
931
def test_clip (x , data ):
932
932
# TODO: test min/max kwargs, adjust values testing accordingly
933
933
@@ -951,7 +951,7 @@ def test_clip(x, data):
951
951
), label = "max" )
952
952
953
953
# min > max is undefined (but allow nans)
954
- assume (min is None or max is None or not xp .any (xp .asarray (min > max )))
954
+ assume (min is None or max is None or not xp .any (xp .asarray (min ) > xp . asarray ( max )))
955
955
956
956
kw = data .draw (
957
957
hh .specified_kwargs (
@@ -1035,13 +1035,14 @@ def refimpl(_x, _min, _max):
1035
1035
max_val = max if dh .is_scalar (max ) else max [max_idx ]
1036
1036
max_val = stype (max_val )
1037
1037
expected = refimpl (x_val , min_val , max_val )
1038
+ out_val = stype (out [o_idx ])
1038
1039
if math .isnan (expected ):
1039
- assert math .isnan (out [ o_idx ] ), (
1040
+ assert math .isnan (out_val ), (
1040
1041
f"out[{ o_idx } ]={ out [o_idx ]} but should be nan [clip()]\n "
1041
1042
f"x[{ x_idx } ]={ x_val } , min[{ min_idx } ]={ min_val } , max[{ max_idx } ]={ max_val } "
1042
1043
)
1043
1044
else :
1044
- assert out [ o_idx ] == expected , (
1045
+ assert out_val == expected , (
1045
1046
f"out[{ o_idx } ]={ out [o_idx ]} but should be { expected } [clip()]\n "
1046
1047
f"x[{ x_idx } ]={ x_val } , min[{ min_idx } ]={ min_val } , max[{ max_idx } ]={ max_val } "
1047
1048
)
0 commit comments