Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert test_rearrange.py's commented out test case #135

Closed
ghost opened this issue Oct 2, 2018 · 2 comments
Closed

Revert test_rearrange.py's commented out test case #135

ghost opened this issue Oct 2, 2018 · 2 comments
Labels
tests Create and/or modify tests
Milestone

Comments

@ghost
Copy link

ghost commented Oct 2, 2018

In #133 , we discuss clpy/manipulation/rearrange.py::flip()'s error type.
Current clpy v2.1.0x behave same as CuPy v2.1.0, and raise ValueError.

def flip(a, axis):
"""Reverse the order of elements in an array along the given axis.
Note that ``flip`` function has been introduced since NumPy v1.12.
The contents of this document is the same as the original one.
Args:
a (~clpy.ndarray): Input array.
axis (int): Axis in array, which entries are reversed.
Returns:
~clpy.ndarray: Output array.
.. seealso:: :func:`numpy.flip`
"""
a_ndim = a.ndim
if a_ndim < 1:
raise ValueError('Input must be >= 1-d')
axis = int(axis)
if not -a_ndim <= axis < a_ndim:
raise ValueError(
'axis must be >= %d and < %d' % (-a_ndim, a_ndim))
return _flip(a, axis)

But it is different from numpy, and test_rearrange.py has some error.
So, we commented out 3 test cases.

# TODO(tomoharu.kitawaki): revert these test cases
# when flip raise core.core._AxisError instead ValueError
'''
@testing.for_all_dtypes()
@testing.numpy_clpy_raises()
def test_flip_insufficient_ndim(self, xp, dtype):
x = testing.shaped_arange((), xp, dtype)
return xp.flip(x, 0)
@testing.for_all_dtypes()
@testing.numpy_clpy_raises()
def test_flip_invalid_axis(self, xp, dtype):
x = testing.shaped_arange((3, 4), xp, dtype)
return xp.flip(x, 2)
@testing.for_all_dtypes()
@testing.numpy_clpy_raises()
def test_flip_invalid_negative_axis(self, xp, dtype):
x = testing.shaped_arange((3, 4), xp, dtype)
return xp.flip(x, -3)
'''

These test case must be reverted when clpy get base version update (#33) and merge cupy/cupy@0d28378 in .

@LWisteria LWisteria added the tests Create and/or modify tests label Nov 9, 2018
@ghost
Copy link
Author

ghost commented Feb 19, 2019

In #156 and #173 , we restrict numpy version.
So, this comment out may be unnecessary.

@ghost ghost self-assigned this Feb 19, 2019
@ghost
Copy link
Author

ghost commented Feb 19, 2019

Resolved in #190

@ghost ghost closed this as completed Feb 19, 2019
@LWisteria LWisteria added this to the v2.1.0beta2 milestone Feb 19, 2019
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Create and/or modify tests
Projects
None yet
Development

No branches or pull requests

1 participant