From 3f3d205cd3f607caeada0dddf41e996e288a3c50 Mon Sep 17 00:00:00 2001 From: Marten van Kerkwijk Date: Fri, 18 Nov 2016 13:55:45 -0500 Subject: MAINT: let average preserve subclass information. This behaviour matches that for most other numpy functions (such as np.mean). It was initially slated for 1.12, but replaced by a FutureWarning. Hence, this is for 1.13. --- numpy/lib/tests/test_function_base.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'numpy/lib/tests/test_function_base.py') diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py index 5bba088a8..5c2446e50 100644 --- a/numpy/lib/tests/test_function_base.py +++ b/numpy/lib/tests/test_function_base.py @@ -321,11 +321,8 @@ class TestAverage(TestCase): a = np.array([[1,2],[3,4]]).view(subclass) w = np.array([[1,2],[3,4]]).view(subclass) - with suppress_warnings() as sup: - # Note that the warning is spurious, because the test checks - # for weights while a is ignored. - sup.filter(FutureWarning, "np.average currently does not preserve") - assert_equal(type(np.average(a, weights=w)), subclass) + assert_equal(type(np.average(a)), subclass) + assert_equal(type(np.average(a, weights=w)), subclass) # also test matrices a = np.matrix([[1,2],[3,4]]) -- cgit v1.2.1