From 93ab77ce47e3ba317a1a53fe0f991404430af954 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 25 Oct 2023 12:28:30 +0000 Subject: [PATCH 1/2] CI: (deps): Bump ruff from 0.1.1 to 0.1.2 in /ci Bumps [ruff](https://github.com/astral-sh/ruff) from 0.1.1 to 0.1.2. - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/ruff/compare/v0.1.1...v0.1.2) --- updated-dependencies: - dependency-name: ruff dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- ci/linting_requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/linting_requirements.txt b/ci/linting_requirements.txt index ac4930b6a8a..5c61fe1b689 100644 --- a/ci/linting_requirements.txt +++ b/ci/linting_requirements.txt @@ -1,4 +1,4 @@ -ruff==0.1.1 +ruff==0.1.2 flake8==6.1.0 pycodestyle==2.11.1 From 3e7bc90db2d776c8720262a120996012af1fd744 Mon Sep 17 00:00:00 2001 From: Ryan May Date: Wed, 25 Oct 2023 13:06:29 -0600 Subject: [PATCH 2/2] DOC: Make use of pint formatting for text in example This started to fix up some format issues found by Ruff 0.1.2, but this embraces Pint's formatting support rather than doing things manually. --- .../Advanced_Sounding_With_Complex_Layout.py | 33 +++++++++---------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/examples/Advanced_Sounding_With_Complex_Layout.py b/examples/Advanced_Sounding_With_Complex_Layout.py index 87f894a1899..f007b2b8148 100644 --- a/examples/Advanced_Sounding_With_Complex_Layout.py +++ b/examples/Advanced_Sounding_With_Complex_Layout.py @@ -256,70 +256,69 @@ # First lets plot some thermodynamic parameters plt.figtext(0.58, 0.37, 'SBCAPE: ', weight='bold', fontsize=15, color='black', ha='left') -plt.figtext(0.71, 0.37, f'{int(sbcape.m)} J/kg', weight='bold', +plt.figtext(0.71, 0.37, f'{sbcape:.0f~P}', weight='bold', fontsize=15, color='orangered', ha='right') plt.figtext(0.58, 0.34, 'SBCIN: ', weight='bold', fontsize=15, color='black', ha='left') -plt.figtext(0.71, 0.34, f'{int(sbcin.m)} J/kg', weight='bold', +plt.figtext(0.71, 0.34, f'{sbcin:.0f~P}', weight='bold', fontsize=15, color='lightblue', ha='right') plt.figtext(0.58, 0.29, 'MLCAPE: ', weight='bold', fontsize=15, color='black', ha='left') -plt.figtext(0.71, 0.29, f'{int(mlcape.m)} J/kg', weight='bold', +plt.figtext(0.71, 0.29, f'{mlcape:.0f~P}', weight='bold', fontsize=15, color='orangered', ha='right') plt.figtext(0.58, 0.26, 'MLCIN: ', weight='bold', fontsize=15, color='black', ha='left') -plt.figtext(0.71, 0.26, f'{int(mlcin.m)} J/kg', weight='bold', +plt.figtext(0.71, 0.26, f'{mlcin:.0f~P}', weight='bold', fontsize=15, color='lightblue', ha='right') plt.figtext(0.58, 0.21, 'MUCAPE: ', weight='bold', fontsize=15, color='black', ha='left') -plt.figtext(0.71, 0.21, f'{int(mucape.m)} J/kg', weight='bold', +plt.figtext(0.71, 0.21, f'{mucape:.0f~P}', weight='bold', fontsize=15, color='orangered', ha='right') plt.figtext(0.58, 0.18, 'MUCIN: ', weight='bold', fontsize=15, color='black', ha='left') -plt.figtext(0.71, 0.18, f'{int(mucin.m)} J/kg', weight='bold', +plt.figtext(0.71, 0.18, f'{mucin:.0f~P}', weight='bold', fontsize=15, color='lightblue', ha='right') plt.figtext(0.58, 0.13, 'TT-INDEX: ', weight='bold', fontsize=15, color='black', ha='left') -plt.figtext(0.71, 0.13, f'{int(total_totals.m)} Δ°C', weight='bold', +plt.figtext(0.71, 0.13, f'{total_totals:.0f~P}', weight='bold', fontsize=15, color='orangered', ha='right') plt.figtext(0.58, 0.10, 'K-INDEX: ', weight='bold', fontsize=15, color='black', ha='left') -plt.figtext(0.71, 0.10, f'{int(kindex.m)} °C', weight='bold', +plt.figtext(0.71, 0.10, f'{kindex:.0f~P}', weight='bold', fontsize=15, color='orangered', ha='right') # now some kinematic parameters -met_per_sec = (units.m * units.m) / (units.sec * units.sec) plt.figtext(0.73, 0.37, '0-1km SRH: ', weight='bold', fontsize=15, color='black', ha='left') -plt.figtext(0.88, 0.37, f'{int(total_helicity1.m)* met_per_sec:~P}', +plt.figtext(0.88, 0.37, f'{total_helicity1:.0f~P}', weight='bold', fontsize=15, color='navy', ha='right') plt.figtext(0.73, 0.34, '0-1km SHEAR: ', weight='bold', fontsize=15, color='black', ha='left') -plt.figtext(0.88, 0.34, f'{int(bshear1.m)} kts', weight='bold', +plt.figtext(0.88, 0.34, f'{bshear1:.0f~P}', weight='bold', fontsize=15, color='blue', ha='right') plt.figtext(0.73, 0.29, '0-3km SRH: ', weight='bold', fontsize=15, color='black', ha='left') -plt.figtext(0.88, 0.29, f'{int(total_helicity3.m)* met_per_sec:~P}', +plt.figtext(0.88, 0.29, f'{total_helicity3:.0f~P}', weight='bold', fontsize=15, color='navy', ha='right') plt.figtext(0.73, 0.26, '0-3km SHEAR: ', weight='bold', fontsize=15, color='black', ha='left') -plt.figtext(0.88, 0.26, f'{int(bshear3.m)} kts', weight='bold', +plt.figtext(0.88, 0.26, f'{bshear3:.0f~P}', weight='bold', fontsize=15, color='blue', ha='right') plt.figtext(0.73, 0.21, '0-6km SRH: ', weight='bold', fontsize=15, color='black', ha='left') -plt.figtext(0.88, 0.21, f'{int(total_helicity6.m)* met_per_sec:~P}', +plt.figtext(0.88, 0.21, f'{total_helicity6:.0f~P}', weight='bold', fontsize=15, color='navy', ha='right') plt.figtext(0.73, 0.18, '0-6km SHEAR: ', weight='bold', fontsize=15, color='black', ha='left') -plt.figtext(0.88, 0.18, f'{int(bshear6.m)} kts', weight='bold', +plt.figtext(0.88, 0.18, f'{bshear6:.0f~P}', weight='bold', fontsize=15, color='blue', ha='right') plt.figtext(0.73, 0.13, 'SIG TORNADO: ', weight='bold', fontsize=15, color='black', ha='left') -plt.figtext(0.88, 0.13, f'{int(sig_tor[0].m)}', weight='bold', fontsize=15, +plt.figtext(0.88, 0.13, f'{sig_tor[0]:.0f~P}', weight='bold', fontsize=15, color='orangered', ha='right') plt.figtext(0.73, 0.10, 'SUPERCELL COMP: ', weight='bold', fontsize=15, color='black', ha='left') -plt.figtext(0.88, 0.10, f'{int(super_comp[0].m)}', weight='bold', fontsize=15, +plt.figtext(0.88, 0.10, f'{super_comp[0]:.0f~P}', weight='bold', fontsize=15, color='orangered', ha='right') # Add legends to the skew and hodo