diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7d6d0ed..79a415b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,36 +7,36 @@ default_install_hook_types: [pre-commit, commit-msg] repos: - repo: https://github.com/compilerla/conventional-pre-commit - rev: v2.3.0 + rev: v4.2.0 hooks: - id: conventional-pre-commit stages: [commit-msg] - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v5.0.0 hooks: - id: check-docstring-first - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.0.282 + rev: v0.12.7 hooks: - id: ruff args: [--fix] - repo: https://github.com/psf/black - rev: 23.7.0 + rev: 25.1.0 hooks: - id: black - repo: https://github.com/abravalheri/validate-pyproject - rev: v0.13 + rev: v0.24.1 hooks: - id: validate-pyproject - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.4.1 + rev: v1.17.1 hooks: - id: mypy files: "^src/" diff --git a/docs/conf.py b/docs/conf.py index 0acec01..d302d52 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -196,4 +196,4 @@ def linkcode_resolve(domain, info): fn = os.path.relpath(fn, start=os.path.dirname("../mpl_image_segmenter")) - return f"https://github.com/ianhi/mpl-image-segmenter/blob/main/mpl_image_segmenter/{fn}{linespec}" # noqa + return f"https://github.com/ianhi/mpl-image-segmenter/blob/main/mpl_image_segmenter/{fn}{linespec}" diff --git a/docs/examples/ipywidgets.ipynb b/docs/examples/ipywidgets.ipynb index dbd68e8..60bd470 100644 --- a/docs/examples/ipywidgets.ipynb +++ b/docs/examples/ipywidgets.ipynb @@ -32,10 +32,10 @@ "outputs": [], "source": [ "import ipywidgets as widgets\n", + "\n", "from mpl_image_segmenter import ImageSegmenter\n", "from mpl_image_segmenter.example_images import gray_image_stack\n", "\n", - "\n", "image_stack = gray_image_stack()\n", "\n", "N_classes = 3\n", diff --git a/docs/examples/usage-guide.ipynb b/docs/examples/usage-guide.ipynb index 2baa4e5..dd79e1e 100644 --- a/docs/examples/usage-guide.ipynb +++ b/docs/examples/usage-guide.ipynb @@ -19,7 +19,7 @@ "%matplotlib ipympl\n", "\n", "import matplotlib.pyplot as plt\n", - "import numpy as np\n", + "\n", "from mpl_image_segmenter import ImageSegmenter\n", "from mpl_image_segmenter.example_images import color_image_stack, gray_image_stack" ] @@ -240,6 +240,7 @@ "outputs": [], "source": [ "from mpl_image_segmenter.example_images import example_mask_stack\n", + "\n", "mask = example_mask_stack()\n", "preloaded = ImageSegmenter(gray_image_stack, classes=3, mask=mask)\n", "display(preloaded)" diff --git a/src/mpl_image_segmenter/__init__.py b/src/mpl_image_segmenter/__init__.py index 00e5049..12155ee 100644 --- a/src/mpl_image_segmenter/__init__.py +++ b/src/mpl_image_segmenter/__init__.py @@ -1,4 +1,5 @@ """Manually segment images with matplotlib.""" + from importlib.metadata import PackageNotFoundError, version try: diff --git a/src/mpl_image_segmenter/example_images/__init__.py b/src/mpl_image_segmenter/example_images/__init__.py index 05b2e44..4cfb59f 100644 --- a/src/mpl_image_segmenter/example_images/__init__.py +++ b/src/mpl_image_segmenter/example_images/__init__.py @@ -5,9 +5,9 @@ import numpy as np __all__ = [ - "gray_image_stack", "color_image_stack", "example_mask_stack", + "gray_image_stack", ] diff --git a/tests/test_mpl_image_segmenter.py b/tests/test_mpl_image_segmenter.py index 292b4c3..332d667 100644 --- a/tests/test_mpl_image_segmenter.py +++ b/tests/test_mpl_image_segmenter.py @@ -2,6 +2,7 @@ import numpy as np import pytest + from mpl_image_segmenter import ImageSegmenter