diff --git a/docs/conf.py b/docs/conf.py index 245632f..2cdc532 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -254,4 +254,4 @@ def linkcode_resolve(domain, info): fn = os.path.relpath(fn, start=os.path.dirname(mpl_inter.__file__)) - return f"https://github.com/mpl-extensions/mpl-interactions/blob/main/mpl_interactions/{fn}{linespec}" # noqa: E501 + return f"https://github.com/mpl-extensions/mpl-interactions/blob/main/mpl_interactions/{fn}{linespec}" diff --git a/docs/examples/context.ipynb b/docs/examples/context.ipynb index 70640c3..54fc04b 100644 --- a/docs/examples/context.ipynb +++ b/docs/examples/context.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "9bdc7777-5241-4944-a12b-46f05c894dbe", + "id": "0", "metadata": {}, "source": [ "# Contextmanager for Controls object\n", @@ -14,7 +14,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4c34e1ff-3ef3-4090-a2bd-7dcb3701e58b", + "id": "1", "metadata": { "tags": [] }, @@ -25,7 +25,7 @@ }, { "cell_type": "markdown", - "id": "28ae4a71-a451-4846-be37-161a42d4a18e", + "id": "2", "metadata": {}, "source": [ "## Using all params\n", @@ -63,7 +63,7 @@ { "cell_type": "code", "execution_count": null, - "id": "852d736e-2839-4b22-9bd5-1e7b4e35a1d9", + "id": "3", "metadata": { "tags": [] }, diff --git a/docs/examples/devlop/devlop-base.ipynb b/docs/examples/devlop/devlop-base.ipynb index 35c101b..0825ccf 100644 --- a/docs/examples/devlop/devlop-base.ipynb +++ b/docs/examples/devlop/devlop-base.ipynb @@ -9,7 +9,6 @@ "outputs": [], "source": [ "%matplotlib ipympl\n", - "import ipywidgets as widgets\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "\n", @@ -27,8 +26,6 @@ }, "outputs": [], "source": [ - "import matplotlib.pyplot as plt\n", - "import numpy as np\n", "import xarray as xr\n", "\n", "from mpl_interactions import hyperslicer\n", diff --git a/docs/examples/devlop/devlop-controller.ipynb b/docs/examples/devlop/devlop-controller.ipynb index 379c310..50cf5b6 100644 --- a/docs/examples/devlop/devlop-controller.ipynb +++ b/docs/examples/devlop/devlop-controller.ipynb @@ -138,7 +138,6 @@ " also allows [None] to grab None of the current params\n", " to imply that we only want tau from the existing set of commands\n", " \"\"\"\n", - "\n", " # make sure keys is a list\n", " # bc in gogogo_controls it may get added to another list\n", " if isinstance(key, str):\n", diff --git a/docs/examples/devlop/devlop-imshow.ipynb b/docs/examples/devlop/devlop-imshow.ipynb index c155d3c..1c49005 100644 --- a/docs/examples/devlop/devlop-imshow.ipynb +++ b/docs/examples/devlop/devlop-imshow.ipynb @@ -7,7 +7,6 @@ "outputs": [], "source": [ "%matplotlib ipympl\n", - "import ipywidgets as widgets\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "\n", @@ -22,7 +21,6 @@ "metadata": {}, "outputs": [], "source": [ - "import numpy as np\n", "\n", "parameter1 = np.linspace(-5, 5)\n", "parameter2 = np.linspace(-5, 5, 25)\n", diff --git a/docs/examples/devlop/devlop-scatter.ipynb b/docs/examples/devlop/devlop-scatter.ipynb index e7e0437..1a33be4 100644 --- a/docs/examples/devlop/devlop-scatter.ipynb +++ b/docs/examples/devlop/devlop-scatter.ipynb @@ -137,7 +137,6 @@ "source": [ "import matplotlib.pyplot as plt\n", "import numpy as np\n", - "from IPython.display import display\n", "from ipywidgets import widgets\n", "\n", "x = np.arange(10)\n", diff --git a/docs/examples/gallery/heatmap_slicer.py b/docs/examples/gallery/heatmap_slicer.py index ce0f544..c3f2c79 100644 --- a/docs/examples/gallery/heatmap_slicer.py +++ b/docs/examples/gallery/heatmap_slicer.py @@ -4,6 +4,7 @@ ============= """ + import matplotlib.pyplot as plt import numpy as np diff --git a/docs/examples/gallery/mpl-sliders-same-figure.py b/docs/examples/gallery/mpl-sliders-same-figure.py index 47e0c2f..56def93 100644 --- a/docs/examples/gallery/mpl-sliders-same-figure.py +++ b/docs/examples/gallery/mpl-sliders-same-figure.py @@ -6,6 +6,7 @@ Demonstration of how to provide a matplotlib slider to prevent the creation of a separate controls figure. """ + import matplotlib.pyplot as plt import numpy as np from matplotlib.widgets import Slider diff --git a/docs/examples/heatmap-slicer.ipynb b/docs/examples/heatmap-slicer.ipynb index 486e1f6..735366d 100644 --- a/docs/examples/heatmap-slicer.ipynb +++ b/docs/examples/heatmap-slicer.ipynb @@ -14,7 +14,6 @@ "outputs": [], "source": [ "%matplotlib widget\n", - "import matplotlib.pyplot as plt\n", "import numpy as np\n", "\n", "from mpl_interactions import heatmap_slicer" diff --git a/docs/examples/hist.ipynb b/docs/examples/hist.ipynb index a26ca5f..61426f8 100644 --- a/docs/examples/hist.ipynb +++ b/docs/examples/hist.ipynb @@ -14,7 +14,6 @@ "outputs": [], "source": [ "%matplotlib ipympl\n", - "import ipywidgets as widgets\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "\n", diff --git a/docs/examples/image-segmentation.ipynb b/docs/examples/image-segmentation.ipynb index f9f4ee9..e32ceb4 100644 --- a/docs/examples/image-segmentation.ipynb +++ b/docs/examples/image-segmentation.ipynb @@ -16,7 +16,6 @@ "outputs": [], "source": [ "%matplotlib ipympl\n", - "import matplotlib.cbook as cbook\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "\n", @@ -266,7 +265,6 @@ }, "outputs": [], "source": [ - "from ipywidgets import HBox\n", "\n", "grayscale_image = image.mean(axis=-1)\n", "gray = image_segmenter(grayscale_image, nclasses=3, mask=mask, figsize=(5, 5), cmap=\"gray\")\n", diff --git a/docs/examples/rossler-attractor.ipynb b/docs/examples/rossler-attractor.ipynb index 8aecb48..292efb8 100644 --- a/docs/examples/rossler-attractor.ipynb +++ b/docs/examples/rossler-attractor.ipynb @@ -20,7 +20,6 @@ "outputs": [], "source": [ "%matplotlib ipympl\n", - "from functools import lru_cache\n", "\n", "import ipywidgets as widgets\n", "import matplotlib.pyplot as plt\n", diff --git a/docs/examples/scalar-arguments.ipynb b/docs/examples/scalar-arguments.ipynb index aec8dcc..81d6346 100644 --- a/docs/examples/scalar-arguments.ipynb +++ b/docs/examples/scalar-arguments.ipynb @@ -96,7 +96,6 @@ "metadata": {}, "outputs": [], "source": [ - "from mpl_interactions.controller import Controls\n", "\n", "# create the controls object\n", "ctrls = Controls(size=(10, 1000))\n", diff --git a/docs/examples/scatter-selector.ipynb b/docs/examples/scatter-selector.ipynb index 6b55a9e..ac0d3bd 100644 --- a/docs/examples/scatter-selector.ipynb +++ b/docs/examples/scatter-selector.ipynb @@ -31,7 +31,6 @@ "%matplotlib ipympl\n", "import pickle\n", "\n", - "import ipywidgets as widgets\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "\n", @@ -58,7 +57,6 @@ "metadata": {}, "outputs": [], "source": [ - "import pickle\n", "\n", "with open(\"data/stock-metadata.pickle\", \"rb\") as f:\n", " meta = pickle.load(f)\n", diff --git a/docs/examples/scatter.ipynb b/docs/examples/scatter.ipynb index 561d2b1..869c14e 100644 --- a/docs/examples/scatter.ipynb +++ b/docs/examples/scatter.ipynb @@ -14,11 +14,10 @@ "outputs": [], "source": [ "%matplotlib ipympl\n", - "import ipywidgets as widgets\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "import pandas as pd\n", - "from matplotlib.colors import TABLEAU_COLORS, XKCD_COLORS, to_rgba_array\n", + "from matplotlib.colors import TABLEAU_COLORS\n", "\n", "import mpl_interactions.ipyplot as iplt" ] diff --git a/docs/examples/text-annotations.ipynb b/docs/examples/text-annotations.ipynb index dbfa6ce..12a6d19 100644 --- a/docs/examples/text-annotations.ipynb +++ b/docs/examples/text-annotations.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "ddddb250-faff-496c-8f0e-6935196ec14a", + "id": "0", "metadata": {}, "source": [ "# Text and Annotations\n", @@ -16,7 +16,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ec2f6996-5f39-4009-a94d-e3a3fda108d9", + "id": "1", "metadata": { "tags": [] }, @@ -31,7 +31,7 @@ }, { "cell_type": "markdown", - "id": "692989d9-07f1-4969-81d8-fc330f0aa5d4", + "id": "2", "metadata": {}, "source": [ "## Working with text strings.\n", @@ -50,7 +50,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d97390af-872e-42f5-a939-03b734b1cf4f", + "id": "3", "metadata": { "tags": [] }, @@ -84,7 +84,7 @@ }, { "cell_type": "markdown", - "id": "1e152d5d-6c6f-4e87-b5d6-f6755f4bed17", + "id": "4", "metadata": {}, "source": [ "## Arbitrarily placed text\n", @@ -95,7 +95,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1ccdd8c4-91fa-440a-9a2d-dbea694ee92d", + "id": "5", "metadata": { "tags": [] }, @@ -125,7 +125,7 @@ }, { "cell_type": "markdown", - "id": "e2aafbc0-7958-410e-a3b8-ce0a8a75ef30", + "id": "6", "metadata": { "jp-MarkdownHeadingCollapsed": true, "tags": [] @@ -137,7 +137,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8eb7da4d-3e48-4b28-85a8-080ff85eee0d", + "id": "7", "metadata": { "tags": [] }, diff --git a/mpl_interactions/pyplot.py b/mpl_interactions/pyplot.py index 2a7d888..17a9d23 100644 --- a/mpl_interactions/pyplot.py +++ b/mpl_interactions/pyplot.py @@ -6,7 +6,6 @@ Matplotlib widgets. """ # noqa: D205 - from collections.abc import Callable from numbers import Number