From 340d871ab641ca9e6cbb33759d03e275a6e88b45 Mon Sep 17 00:00:00 2001 From: Vinod Kumar L <vinodkumarlogan@gmail.com> Date: Sun, 29 Oct 2017 16:23:44 -0400 Subject: [PATCH] [MRG+1] Remove sklearn.utils.testing._assert_all_close (#10032) --- sklearn/utils/testing.py | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/sklearn/utils/testing.py b/sklearn/utils/testing.py index c5b6209cc5..035a2e3175 100644 --- a/sklearn/utils/testing.py +++ b/sklearn/utils/testing.py @@ -341,22 +341,7 @@ class _IgnoreWarnings(object): assert_less = _dummy.assertLess assert_greater = _dummy.assertGreater - -def _assert_allclose(actual, desired, rtol=1e-7, atol=0, - err_msg='', verbose=True): - actual, desired = np.asanyarray(actual), np.asanyarray(desired) - if np.allclose(actual, desired, rtol=rtol, atol=atol): - return - msg = ('Array not equal to tolerance rtol=%g, atol=%g: ' - 'actual %s, desired %s') % (rtol, atol, actual, desired) - raise AssertionError(msg) - - -if hasattr(np.testing, 'assert_allclose'): - assert_allclose = np.testing.assert_allclose -else: - assert_allclose = _assert_allclose - +assert_allclose = np.testing.assert_allclose def assert_raise_message(exceptions, message, function, *args, **kwargs): """Helper function to test error messages in exceptions. -- GitLab