From 7c0b9ee2e04ccdc891d66e6dede3138c7919aa0f Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Mon, 14 Jun 2021 20:51:38 -0400 Subject: [PATCH] Remove dead code from LGTM alerts. These are all overwritten later on without being read. --- lib/matplotlib/axis.py | 2 -- lib/matplotlib/backends/web_backend/js/nbagg_mpl.js | 5 ----- lib/matplotlib/figure.py | 3 --- lib/matplotlib/markers.py | 1 - lib/matplotlib/offsetbox.py | 7 ------- 5 files changed, 18 deletions(-) diff --git a/lib/matplotlib/axis.py b/lib/matplotlib/axis.py index aa0b634b518d..d446d649db02 100644 --- a/lib/matplotlib/axis.py +++ b/lib/matplotlib/axis.py @@ -2251,7 +2251,6 @@ def set_inverted(self, inverted): def set_default_intervals(self): # docstring inherited - xmin, xmax = 0., 1. # only change view if dataLim has not changed and user has # not changed the view: if (not self.axes.dataLim.mutatedx() and @@ -2512,7 +2511,6 @@ def set_inverted(self, inverted): def set_default_intervals(self): # docstring inherited - ymin, ymax = 0., 1. # only change view if dataLim has not changed and user has # not changed the view: if (not self.axes.dataLim.mutatedy() and diff --git a/lib/matplotlib/backends/web_backend/js/nbagg_mpl.js b/lib/matplotlib/backends/web_backend/js/nbagg_mpl.js index 8e7e38157925..26d79ff4e1da 100644 --- a/lib/matplotlib/backends/web_backend/js/nbagg_mpl.js +++ b/lib/matplotlib/backends/web_backend/js/nbagg_mpl.js @@ -228,11 +228,6 @@ mpl.figure.prototype._canvas_extra_style = function (el) { }; mpl.figure.prototype._key_event_extra = function (event, _name) { - var manager = IPython.notebook.keyboard_manager; - if (!manager) { - manager = IPython.keyboard_manager; - } - // Check for shift+enter if (event.shiftKey && event.which === 13) { this.canvas_div.blur(); diff --git a/lib/matplotlib/figure.py b/lib/matplotlib/figure.py index dee6024f528e..f5bbb72c00ef 100644 --- a/lib/matplotlib/figure.py +++ b/lib/matplotlib/figure.py @@ -1447,8 +1447,6 @@ def subfigures(self, nrows=1, ncols=1, squeeze=True, # Returned axis array will be always 2-d, even if nrows=ncols=1. return sfarr - return sfarr - def add_subfigure(self, subplotspec, **kwargs): """ Add a `~.figure.SubFigure` to the figure as part of a subplot @@ -1823,7 +1821,6 @@ def _do_layout(gs, mosaic, unique_ids, nested): dict[label, Axes] A flat dict of all of the Axes created. """ - rows, cols = mosaic.shape output = dict() # we need to merge together the Axes at this level and the axes diff --git a/lib/matplotlib/markers.py b/lib/matplotlib/markers.py index d64117736091..44e2cf675b15 100644 --- a/lib/matplotlib/markers.py +++ b/lib/matplotlib/markers.py @@ -805,7 +805,6 @@ def _set_plus_filled(self): self._transform = Affine2D() self._snap_threshold = 5.0 self._joinstyle = JoinStyle.miter - fs = self.get_fillstyle() if not self._half_fill(): self._path = self._plus_filled_path else: diff --git a/lib/matplotlib/offsetbox.py b/lib/matplotlib/offsetbox.py index 646186891648..143891cb7dce 100644 --- a/lib/matplotlib/offsetbox.py +++ b/lib/matplotlib/offsetbox.py @@ -475,13 +475,6 @@ def get_extent_offsets(self, renderer): if not whd_list: return 2 * pad, 2 * pad, pad, pad, [] - if self.height is None: - height_descent = max(h - yd for w, h, xd, yd in whd_list) - ydescent = max(yd for w, h, xd, yd in whd_list) - height = height_descent + ydescent - else: - height = self.height - 2 * pad # width w/o pad - hd_list = [(h, yd) for w, h, xd, yd in whd_list] height, ydescent, yoffsets = _get_aligned_offsets(hd_list, self.height,