From 823829ea774655701ffa6bbded1a97b4a9bf6f23 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 2 Oct 2023 22:01:54 -0400 Subject: [PATCH] [pre-commit.ci] pre-commit autoupdate (#4) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/pre-commit/pre-commit-hooks: v4.0.1 → v4.4.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.0.1...v4.4.0) - [github.com/asottile/setup-cfg-fmt: v1.17.0 → v2.4.0](https://github.com/asottile/setup-cfg-fmt/compare/v1.17.0...v2.4.0) - [github.com/PyCQA/flake8: 3.9.2 → 6.1.0](https://github.com/PyCQA/flake8/compare/3.9.2...6.1.0) - https://github.com/myint/autoflake → https://github.com/PyCQA/autoflake - [github.com/PyCQA/autoflake: v1.4 → v2.2.1](https://github.com/PyCQA/autoflake/compare/v1.4...v2.2.1) - [github.com/PyCQA/isort: 5.8.0 → 5.12.0](https://github.com/PyCQA/isort/compare/5.8.0...5.12.0) - [github.com/psf/black: 21.5b2 → 23.9.1](https://github.com/psf/black/compare/21.5b2...23.9.1) - [github.com/asottile/pyupgrade: v2.19.0 → v3.13.0](https://github.com/asottile/pyupgrade/compare/v2.19.0...v3.13.0) - [github.com/pre-commit/mirrors-mypy: v0.812 → v1.5.1](https://github.com/pre-commit/mirrors-mypy/compare/v0.812...v1.5.1) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 18 +++++++++--------- docs/conf.py | 1 - mpl_pan_zoom/_pan.py | 10 ++++++++-- mpl_pan_zoom/_zoom.py | 2 ++ setup.cfg | 7 ++----- 5 files changed, 21 insertions(+), 17 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7875c87..ccf2272 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ ci: autoupdate_schedule: 'quarterly' repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.0.1 + rev: v4.4.0 hooks: - id: check-docstring-first - id: end-of-file-fixer @@ -10,33 +10,33 @@ repos: - id: mixed-line-ending - id: check-merge-conflict - repo: https://github.com/asottile/setup-cfg-fmt - rev: v1.17.0 + rev: v2.4.0 hooks: - id: setup-cfg-fmt - repo: https://github.com/PyCQA/flake8 - rev: 3.9.2 + rev: 6.1.0 hooks: - id: flake8 additional_dependencies: [flake8-typing-imports==1.7.0] - - repo: https://github.com/myint/autoflake - rev: v1.4 + - repo: https://github.com/PyCQA/autoflake + rev: v2.2.1 hooks: - id: autoflake args: ["--in-place", "--remove-all-unused-imports", "--ignore-init-module-imports", "--remove-unused-variables"] - repo: https://github.com/PyCQA/isort - rev: 5.8.0 + rev: 5.12.0 hooks: - id: isort - repo: https://github.com/psf/black - rev: 21.5b2 + rev: 23.9.1 hooks: - id: black - repo: https://github.com/asottile/pyupgrade - rev: v2.19.0 + rev: v3.13.0 hooks: - id: pyupgrade args: [--py37-plus] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.812 + rev: v1.5.1 hooks: - id: mypy diff --git a/docs/conf.py b/docs/conf.py index d8c2373..67407ed 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -23,7 +23,6 @@ release = "unknown" - # -- Project information ----------------------------------------------------- project = "mpl_pan_zoom" diff --git a/mpl_pan_zoom/_pan.py b/mpl_pan_zoom/_pan.py index ae36b25..83b8f12 100644 --- a/mpl_pan_zoom/_pan.py +++ b/mpl_pan_zoom/_pan.py @@ -1,6 +1,8 @@ __all__ = [ "PanManager", ] + + class PanManager: """ Enable panning a plot with any mouse button. @@ -50,7 +52,9 @@ def enable(self): raise RuntimeError("The PanManager is already enabled") self._id_press = self.fig.canvas.mpl_connect("button_press_event", self.press) - self._id_release = self.fig.canvas.mpl_connect("button_release_event", self.release) + self._id_release = self.fig.canvas.mpl_connect( + "button_release_event", self.release + ) def disable(self): """ @@ -103,7 +107,9 @@ def press(self, event): ): a.start_pan(x, y, event.button) self._xypress.append((a, i)) - self._id_drag = self.fig.canvas.mpl_connect("motion_notify_event", self._mouse_move) + self._id_drag = self.fig.canvas.mpl_connect( + "motion_notify_event", self._mouse_move + ) def release(self, event): self._cancel_action() diff --git a/mpl_pan_zoom/_zoom.py b/mpl_pan_zoom/_zoom.py index eb173eb..5d55356 100644 --- a/mpl_pan_zoom/_zoom.py +++ b/mpl_pan_zoom/_zoom.py @@ -3,6 +3,8 @@ __all__ = [ "zoom_factory", ] + + # based on https://gist.github.com/tacaswell/3144287 def zoom_factory(ax, base_scale=1.1): """ diff --git a/setup.cfg b/setup.cfg index 7f30451..3869470 100644 --- a/setup.cfg +++ b/setup.cfg @@ -7,16 +7,13 @@ url = https://github.com/ianhi/mpl-pan-zoom author = Ian Hunt-Isaak author_email = ianhuntisaak@gmail.com license = BSD-3-Clause -license_file = LICENSE +license_files = LICENSE classifiers = Development Status :: 2 - Pre-Alpha License :: OSI Approved :: BSD License Natural Language :: English Programming Language :: Python :: 3 Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 Programming Language :: Python :: Implementation :: CPython project_urls = Source Code =https://github.com/ianhi/mpl-pan-zoom @@ -26,7 +23,7 @@ packages = find: install_requires = matplotlib numpy -python_requires = >=3.7 +python_requires = >=3.8 zip_safe = False [options.extras_require]