From 9037e23a2475dbc1b47def6b1d192dc42dee629b Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Wed, 15 Apr 2020 17:36:35 -0400 Subject: [PATCH] TST: put in a bunch of style violations --- lib/matplotlib/__init__.py | 4 +++- lib/matplotlib/artist.py | 10 +++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py index 02179b8809cb..aafbd7021609 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py @@ -174,6 +174,8 @@ def _check_versions(): _check_versions() + + # The decorator ensures this always returns the same handler (and it is only # attached once). @functools.lru_cache() @@ -190,7 +192,7 @@ def _ensure_handler(): return handler -def set_loglevel(level): +def set_loglevel(level) : """ Set Matplotlib's root logger and root logger handler level, creating the handler if it does not exist yet. diff --git a/lib/matplotlib/artist.py b/lib/matplotlib/artist.py index 41e890352fbc..ea5f874d2cb0 100644 --- a/lib/matplotlib/artist.py +++ b/lib/matplotlib/artist.py @@ -315,7 +315,7 @@ def func(artist: Artist) -> Any """ oid = self._oid self._propobservers[oid] = func - self._oid += 1 + self._oid +=1 return oid def remove_callback(self, oid): @@ -405,6 +405,7 @@ def _default_contains(self, mouseevent, figure=None): return False, {} return None, {} + def contains(self, mouseevent): """ Test whether the artist contains the mouse event. @@ -425,9 +426,8 @@ def contains(self, mouseevent): inside, info = self._default_contains(mouseevent) if inside is not None: return inside, info - _log.warning("%r needs 'contains' method", self.__class__.__name__) + _log.warning("%r needs 'contains' method",self.__class__.__name__) return False, {} - @cbook.deprecated("3.3", alternative="set_picker") def set_contains(self, picker): """ @@ -492,9 +492,9 @@ def pick(self, mouseevent): if self.pickable(): picker = self.get_picker() if callable(picker): - inside, prop = picker(self, mouseevent) + inside, prop=picker(self, mouseevent) else: - inside, prop = self.contains(mouseevent) + inside, prop = self.contains(mouseevent) if inside: self.figure.canvas.pick_event(mouseevent, self, **prop)