From c1c1b23c033c2c222ccd87151d4bafbb1bfadcf7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Jul 2020 10:30:52 +0000 Subject: [PATCH 1/2] MNT:(deps): Bump pycodestyle from 2.5.0 to 2.6.0 in /ci Bumps [pycodestyle](https://github.com/PyCQA/pycodestyle) from 2.5.0 to 2.6.0. - [Release notes](https://github.com/PyCQA/pycodestyle/releases) - [Changelog](https://github.com/PyCQA/pycodestyle/blob/master/CHANGES.txt) - [Commits](https://github.com/PyCQA/pycodestyle/compare/2.5.0...2.6.0) 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 1b8690c4f73..5b11d51cd8a 100644 --- a/ci/linting_requirements.txt +++ b/ci/linting_requirements.txt @@ -1,5 +1,5 @@ flake8==3.7.9 -pycodestyle==2.5.0 +pycodestyle==2.6.0 pyflakes==2.2.0 flake8-bugbear==20.1.4 From 3e2500e42fc8e8023b2d1acef3c03c7cf5c80ac4 Mon Sep 17 00:00:00 2001 From: Ryan May Date: Mon, 27 Jul 2020 19:25:18 -0600 Subject: [PATCH 2/2] MNT: Fix new lint found by pycodestyle It doesn't like the use of the variable 'l', which is easily confused with 1 (and i) depending on the font. --- examples/meteogram_metpy.py | 12 ++++++------ src/metpy/plots/wx_symbols.py | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/meteogram_metpy.py b/examples/meteogram_metpy.py index 844209136f7..5fdddfb5840 100644 --- a/examples/meteogram_metpy.py +++ b/examples/meteogram_metpy.py @@ -80,10 +80,10 @@ def plot_winds(self, ws, wd, wsmax, plot_range=None): ax7.set_ylabel('Wind\nDirection\n(degrees)', multialignment='center') ax7.set_ylim(0, 360) ax7.set_yticks(np.arange(45, 405, 90), ['NE', 'SE', 'SW', 'NW']) - lns = ln1 + ln2 + ln3 - labs = [l.get_label() for l in lns] + lines = ln1 + ln2 + ln3 + labs = [line.get_label() for line in lines] ax7.xaxis.set_major_formatter(mpl.dates.DateFormatter('%d/%H UTC')) - ax7.legend(lns, labs, loc='upper center', + ax7.legend(lines, labs, loc='upper center', bbox_to_anchor=(0.5, 1.2), ncol=3, prop={'size': 12}) def plot_thermo(self, t, td, plot_range=None): @@ -111,11 +111,11 @@ def plot_thermo(self, t, td, plot_range=None): ax_twin = self.ax2.twinx() ax_twin.set_ylim(plot_range[0], plot_range[1], plot_range[2]) - lns = ln4 + ln5 - labs = [l.get_label() for l in lns] + lines = ln4 + ln5 + labs = [line.get_label() for line in lines] ax_twin.xaxis.set_major_formatter(mpl.dates.DateFormatter('%d/%H UTC')) - self.ax2.legend(lns, labs, loc='upper center', + self.ax2.legend(lines, labs, loc='upper center', bbox_to_anchor=(0.5, 1.2), ncol=2, prop={'size': 12}) def plot_rh(self, rh, plot_range=None): diff --git a/src/metpy/plots/wx_symbols.py b/src/metpy/plots/wx_symbols.py index 8808c6182ff..39134409be0 100644 --- a/src/metpy/plots/wx_symbols.py +++ b/src/metpy/plots/wx_symbols.py @@ -106,13 +106,13 @@ def __init__(self, num, font_start, font_jumps=None, char_jumps=None): font_point += 1 @staticmethod - def _safe_pop(l): + def _safe_pop(lst): """Safely pop from a list. Returns None if list empty. """ - return l.pop(0) if l else None + return lst.pop(0) if lst else None def __call__(self, code): """Return the Unicode code point corresponding to `code`."""