From 846bb812583adf5a6edc331ee913a51cdff23775 Mon Sep 17 00:00:00 2001 From: Haoyu Zhuang Date: Fri, 11 Aug 2023 14:40:23 +0800 Subject: [PATCH] Fix linting issues --- src/metpy/calc/thermo.py | 5 +++-- tests/calc/test_thermo.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/metpy/calc/thermo.py b/src/metpy/calc/thermo.py index 50e5ce670cf..fba7e043073 100644 --- a/src/metpy/calc/thermo.py +++ b/src/metpy/calc/thermo.py @@ -3477,8 +3477,9 @@ def thickness_hydrostatic(pressure, temperature, mixing_ratio=None, # Take the integral diff_logp = np.diff(np.log(layer_p)) - thickness = (-mpconsts.nounit.Rd / mpconsts.nounit.g * - diff_logp * (layer_virttemp[1:] + layer_virttemp[:-1]) / 2.) + thickness = (-mpconsts.nounit.Rd / mpconsts.nounit.g * diff_logp * ( + layer_virttemp[1:] + layer_virttemp[:-1]) / 2.) + return thickness if full_profile else np.sum(thickness) diff --git a/tests/calc/test_thermo.py b/tests/calc/test_thermo.py index 0165e4fccc7..65983cba9cb 100644 --- a/tests/calc/test_thermo.py +++ b/tests/calc/test_thermo.py @@ -1612,7 +1612,7 @@ def test_thickness_hydrostatic_full_profile(): pressure = np.array([959., 779.2, 751.3, 724.3, 700., 269.]) * units.hPa temperature = np.array([22.2, 14.6, 12., 9.4, 7., -38.]) * units.degC mixing = np.array([0.01458, 0.00209, 0.00224, 0.00240, 0.00256, 0.00010]) - thickness = thickness_hydrostatic(pressure, temperature, mixing_ratio=mixing, + thickness = thickness_hydrostatic(pressure, temperature, mixing_ratio=mixing, full_profile=True) result = [1780.778, 306.126, 304.513, 281.455, 7218.833] * units.m assert_almost_equal(thickness, result, 2)