8000 documentation updates for 1.9 by juliantaylor · Pull Request #4906 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

documentation updates for 1.9 #4906

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

Merged
merged 15 commits into from
Jul 27, 2014
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
DOC: numpy.testing documentation clarification of "Raise an assertion"
"Raise an assertion" was changed to "Raises an AssertionError" to clarify that
an exception named AssertionError will be raised.
Closes gh-4884

[ci skip]
  • Loading branch information
godber authored and juliantaylor committed Jul 27, 2014
commit 638e627c813590a91514b255aeb13a34dc2ac51e
19 changes: 12 additions & 7 deletions numpy/testing/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def build_err_msg(arrays, err_msg, header='Items are not equal:',

def assert_equal(actual,desired,err_msg='',verbose=True):
"""
Raise an assertion if two objects are not equal.
Raises an AssertionError if two objects are not equal.

Given two objects (scalars, lists, tuples, dictionaries or numpy arrays),
check that all elements of these objects are equal. An exception is raised
Expand Down Expand Up @@ -371,7 +371,8 @@ def print_assert_equal(test_string, actual, desired):

def assert_almost_equal(actual,desired,decimal=7,err_msg='',verbose=True):
"""
Raise an assertion if two items are not equal up to desired precision.
Raises an AssertionError if two items are not equal up to desired
precision.

.. note:: It is recommended to use one of `assert_allclose`,
`assert_array_almost_equal_nulp` or `assert_array_max_ulp`
Expand Down Expand Up @@ -488,7 +489,8 @@ def _build_err_msg():

def assert_approx_equal(actual,desired,significant=7,err_msg='',verbose=True):
"""
Raise an assertion if two items are not equal up to significant digits.
Raises an AssertionError if two items are not equal up to significant
digits.

.. note:: It is recommended to use one of `assert_allclose`,
`assert_array_almost_equal_nulp` or `assert_array_max_ulp`
Expand Down Expand Up @@ -669,7 +671,7 @@ def chk_same_position(x_id, y_id, hasval='nan'):

def assert_array_equal(x, y, err_msg='', verbose=True):
"""
Raise an assertion if two array_like objects are not equal.
Raises an AssertionError if two array_like objects are not equal.

Given two array_like objects, check that the shape is equal and all
elements of these objects are equal. An exception is raised at
Expand Down Expand Up @@ -735,7 +737,8 @@ def assert_array_equal(x, y, err_msg='', verbose=True):

def assert_array_almost_equal(x, y, decimal=6, err_msg='', verbose=True):
"""
Raise an assertion if two objects are not equal up to desired precision.
Raises an AssertionError if two objects are not equal up to desired
precision.

.. note:: It is recommended to use one of `assert_allclose`,
`assert_array_almost_equal_nulp` or `assert_array_max_ulp`
Expand Down Expand Up @@ -838,7 +841,8 @@ def compare(x, y):

def assert_array_less(x, y, err_msg='', verbose=True):
"""
Raise an assertion if two array_like objects are not ordered by less than.
Raises an AssertionError if two array_like objects are not ordered by less
than.

Given two array_like objects, check that the shape is equal and all
elements of the first object are strictly smaller than those of the
Expand Down Expand Up @@ -1240,7 +1244,8 @@ def _assert_valid_refcount(op):
def assert_allclose(actual, desired, rtol=1e-7, atol=0,
err_msg='', verbose=True):
"""
Raise an assertion if two objects are not equal up to desired tolerance.
Raises an AssertionError if two objects are not equal up to desired
tolerance.

The test is equivalent to ``allclose(actual, desired, rtol, atol)``.
It compares the difference between `actual` and `desired` to
Expand Down
0