TST: Update doctests to match CuPy
The CuPy version of trim_mean differs with whitspace and also that all results are array instead of one result being a scalar. This is because there are no scalars in device memory.
@@ -59,7 +59,7 @@ def trim_mean(a, proportiontocut, axis=0):
>>> from cupyx.scipy import stats
>>> x = np.arange(20)
>>> stats.trim_mean(x, 0.1)
- 9.5
+ array(9.5)
>>> x2 = x.reshape(5, 4)
>>> x2
array([[ 0, 1, 2, 3],
@@ -92,3 +92,8 @@ def trim_mean(a, proportiontocut, axis=0):
sl = [slice(None)] * atmp.ndim
sl[axis] = slice(lowercut, uppercut)
return np.mean(atmp[tuple(sl)], axis=axis)
+
+
+if __name__ == "__main__":
+ import doctest
+ doctest.testmod()
