From 76a5da32bff38390c27ed03e851404495b68020e Mon Sep 17 00:00:00 2001 From: Sam Gardner Date: Mon, 30 Oct 2023 00:34:40 -0500 Subject: [PATCH] fix climate --- src/metpy/calc/indices.py | 2 +- tests/calc/test_indices.py | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/metpy/calc/indices.py b/src/metpy/calc/indices.py index f033b1c15a7..3c8fa2bf95a 100644 --- a/src/metpy/calc/indices.py +++ b/src/metpy/calc/indices.py @@ -417,7 +417,7 @@ def corfidi_storm_motion(pressure, u, v, *, u_llj=None, v_llj=None): # If LLJ specified, use that if u_llj is not None and v_llj is not None: # find inverse of low-level jet - llj_inverse = units.Quantity.from_list((-1*u_llj, -1*v_llj)) + llj_inverse = units.Quantity.from_list((-1 * u_llj, -1 * v_llj)) # If pressure values contain values below 850 hPa, find low-level jet elif np.max(pressure) >= units.Quantity(850, 'hectopascal'): # convert u/v wind to wind speed and direction diff --git a/tests/calc/test_indices.py b/tests/calc/test_indices.py index dd21afe191e..bcc36b67311 100644 --- a/tests/calc/test_indices.py +++ b/tests/calc/test_indices.py @@ -186,22 +186,22 @@ def test_corfidi_motion(): assert_almost_equal(motion_full.flatten(), truth_full, 8) motion_override = concatenate(corfidi_storm_motion(data['pressure'], - data['u_wind'], data['v_wind'], - u_llj=0*units('kt'), - v_llj=0*units('kt'))) + data['u_wind'], data['v_wind'], + u_llj=0 * units('kt'), + v_llj=0 * units('kt'))) truth_override = [17.72560506, 10.48701063, 35.45121012, 20.97402126] * units('kt') assert_almost_equal(motion_override.flatten(), truth_override, 8) - + with pytest.raises(ValueError): corfidi_storm_motion(data['pressure'][6:], data['u_wind'][6:], data['v_wind'][6:]) - + motion_no_top = concatenate(corfidi_storm_motion(data['pressure'][:37], data['u_wind'][:37], data['v_wind'][:37])) truth_no_top = [20.40419260, -21.43467629, 37.93224569, -9.99492754] * units('kt') assert_almost_equal(motion_no_top.flatten(), truth_no_top, 8) - + u_with_nans = data['u_wind'] u_with_nans[6:10] = np.nan v_with_nans = data['v_wind'] @@ -211,11 +211,11 @@ def test_corfidi_motion(): truth_with_nans = [20.01078763, -22.65208606, 37.14543575, -12.42974709] * units('kt') assert_almost_equal(motion_with_nans.flatten(), truth_with_nans, 8) - + with pytest.raises(ValueError): corfidi_storm_motion(data['pressure'], data['u_wind'], data['v_wind'], u_llj=10 * units('kt')) - + with pytest.raises(ValueError): corfidi_storm_motion(data['pressure'], data['u_wind'], data['v_wind'], v_llj=10 * units('kt'))