Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#4)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/pre-commit/pre-commit-hooks: v4.0.1 → v4.4.0](pre-commit/pre-commit-hooks@v4.0.1...v4.4.0)
- [github.com/asottile/setup-cfg-fmt: v1.17.0 → v2.4.0](asottile/setup-cfg-fmt@v1.17.0...v2.4.0)
- [github.com/PyCQA/flake8: 3.9.2 → 6.1.0](PyCQA/flake8@3.9.2...6.1.0)
- https://github.com/myint/autoflakehttps://github.com/PyCQA/autoflake
- [github.com/PyCQA/autoflake: v1.4 → v2.2.1](PyCQA/autoflake@v1.4...v2.2.1)
- [github.com/PyCQA/isort: 5.8.0 → 5.12.0](PyCQA/isort@5.8.0...5.12.0)
- [github.com/psf/black: 21.5b2 → 23.9.1](psf/black@21.5b2...23.9.1)
- [github.com/asottile/pyupgrade: v2.19.0 → v3.13.0](asottile/pyupgrade@v2.19.0...v3.13.0)
- [github.com/pre-commit/mirrors-mypy: v0.812 → v1.5.1](pre-commit/mirrors-mypy@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>
  • Loading branch information
pre-commit-ci[bot] authored Oct 3, 2023
1 parent 9181c25 commit 823829e
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 17 deletions.
18 changes: 9 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,41 @@ 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
- id: trailing-whitespace
- 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
1 change: 0 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
release = "unknown"



# -- Project information -----------------------------------------------------

project = "mpl_pan_zoom"
Expand Down
10 changes: 8 additions & 2 deletions mpl_pan_zoom/_pan.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
__all__ = [
"PanManager",
]


class PanManager:
"""
Enable panning a plot with any mouse button.
Expand Down Expand Up @@ -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):
"""
Expand Down Expand Up @@ -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()
Expand Down
2 changes: 2 additions & 0 deletions mpl_pan_zoom/_zoom.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
__all__ = [
"zoom_factory",
]


# based on https://gist.github.com/tacaswell/3144287
def zoom_factory(ax, base_scale=1.1):
"""
Expand Down
7 changes: 2 additions & 5 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -26,7 +23,7 @@ packages = find:
install_requires =
matplotlib
numpy
python_requires = >=3.7
python_requires = >=3.8
zip_safe = False

[options.extras_require]
Expand Down

0 comments on commit 823829e

Please sign in to comment.