From ab2f1026ac6b5057f1656058c7aad532be94501f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 23 Sep 2024 21:21:12 +0000 Subject: [PATCH] style: pre-commit fixes --- docs/notebooks.ipynb | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/docs/notebooks.ipynb b/docs/notebooks.ipynb index fdb7176..ab3d3f0 100644 --- a/docs/notebooks.ipynb +++ b/docs/notebooks.ipynb @@ -50,9 +50,12 @@ "metadata": {}, "outputs": [], "source": [ - "from matplotlib import rcParams, cycler\n", + "from __future__ import annotations\n", + "\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", + "from matplotlib import cycler, rcParams\n", + "\n", "plt.ion()" ] }, @@ -69,17 +72,20 @@ "data = [np.logspace(0, 1, 100) + np.random.randn(100) + ii for ii in range(N)]\n", "data = np.array(data).T\n", "cmap = plt.cm.coolwarm\n", - "rcParams['axes.prop_cycle'] = cycler(color=cmap(np.linspace(0, 1, N)))\n", + "rcParams[\"axes.prop_cycle\"] = cycler(color=cmap(np.linspace(0, 1, N)))\n", "\n", "\n", "from matplotlib.lines import Line2D\n", - "custom_lines = [Line2D([0], [0], color=cmap(0.), lw=4),\n", - " Line2D([0], [0], color=cmap(.5), lw=4),\n", - " Line2D([0], [0], color=cmap(1.), lw=4)]\n", + "\n", + "custom_lines = [\n", + " Line2D([0], [0], color=cmap(0.0), lw=4),\n", + " Line2D([0], [0], color=cmap(0.5), lw=4),\n", + " Line2D([0], [0], color=cmap(1.0), lw=4),\n", + "]\n", "\n", "fig, ax = plt.subplots(figsize=(10, 5))\n", "lines = ax.plot(data)\n", - "ax.legend(custom_lines, ['Cold', 'Medium', 'Hot']);" + "ax.legend(custom_lines, [\"Cold\", \"Medium\", \"Hot\"]);" ] }, {