From 86d2a87cf97b99bcff13bbbd5c4211fdfc5ff2af Mon Sep 17 00:00:00 2001 From: Sebastian Berg Date: Tue, 28 Jun 2022 09:58:12 -0700 Subject: ENH,MAINT: Improve and simplify scalar floating point warnings This makes the scalar operations warnings read e.g.: overflow encountered in scalar multiply rather than: overflow encountered in float_scalars It also fixes one case where "assignment" rather than "cast" was used when I added the FPEs for casts. Otherwise, uses the helper that I intrudced for for the floating point casts in all places to simplify the code, the only "complicated" thing is that I try to give "scalar divide" rather than "scalar true_divide" as warnings, since "true_divide" should not really be something that end-users need be aware of. --- numpy/lib/tests/test_arraypad.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'numpy/lib/tests') diff --git a/numpy/lib/tests/test_arraypad.py b/numpy/lib/tests/test_arraypad.py index ca3c35335..64b6a2e18 100644 --- a/numpy/lib/tests/test_arraypad.py +++ b/numpy/lib/tests/test_arraypad.py @@ -474,8 +474,7 @@ class TestStatistic: @pytest.mark.filterwarnings("ignore:Mean of empty slice:RuntimeWarning") @pytest.mark.filterwarnings( - "ignore:invalid value encountered in (divide|double_scalars):" - "RuntimeWarning" + "ignore:invalid value encountered in( scalar)? divide:RuntimeWarning" ) @pytest.mark.parametrize("mode", ["mean", "median"]) def test_zero_stat_length_valid(self, mode): -- cgit v1.2.1