-
-
Notifications
You must be signed in to change notification settings - Fork 11.1k
MAINT: Use AxisError in more places #8843
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
Changes from 1 commit
7bf9115
4feb97e
09d4d35
cd01f01
efa1bd2
b6850e9
539d4f7
e3ed705
17466ad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
This also means that its axis argument invokes operator.index like others do. _validate_axis currently accepts lists of axes, which is a bug.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -902,9 +902,9 @@ def test_specific_axes(self): | |
# test maximal number of varargs | ||
assert_raises(TypeError, gradient, x, 1, 2, axis=1) | ||
|
||
assert_raises(ValueError, gradient, x, axis=3) | ||
assert_raises(ValueError, gradient, x, axis=-3) | ||
assert_raises(TypeError, gradient, x, axis=[1,]) | ||
assert_raises(np.AxisError, gradient, x, axis=3) | ||
assert_raises(np.AxisError, gradient, x, axis=-3) | ||
# assert_raises(TypeError, gradient, x, axis=[1,]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This used to error, and ideally it would still error for consistency with Perhaps we should add a deprecation warning (in a future commit) about passing lists of axes? |
||
|
||
def test_timedelta64(self): | ||
# Make sure gradient() can handle special types like timedelta64 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These exceptions were found by temporarily removing the base classes from
AxisError
, so that tests forValueError
andIndexError
would not catch them.