From 764cab12b41951fcd64086b6e8109e350131ee77 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 27 Jul 2026 16:46:06 +0000 Subject: [PATCH 1/2] chore: update pre-commit hooks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.11.13 → v0.16.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.11.13...v0.16.0) - [github.com/pre-commit/pre-commit-hooks: v5.0.0 → v6.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v5.0.0...v6.0.0) - [github.com/kynan/nbstripout: 0.8.1 → 0.9.1](https://github.com/kynan/nbstripout/compare/0.8.1...0.9.1) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d2075a6..25b05a7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,7 +8,7 @@ ci: repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.11.13" + rev: "v0.16.0" hooks: - id: ruff types_or: [python, pyi, jupyter] @@ -17,7 +17,7 @@ repos: types_or: [python, pyi, jupyter] - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: trailing-whitespace exclude: '.*\.fits$' @@ -31,7 +31,7 @@ repos: args: ["--maxkb=10000"] - repo: https://github.com/kynan/nbstripout - rev: 0.8.1 + rev: 0.9.1 hooks: - id: nbstripout args: ["--extra-keys=metadata.kernelspec metadata.language_info.version metadata.toc"] From 574ac41df29836ec5cc81d95bc112223674d332f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 27 Jul 2026 16:47:27 +0000 Subject: [PATCH 2/2] style: pre-commit fixes --- AUTHORS.md | 2 +- redshift-plot.ipynb | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index acad72f..1305bb1 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -1 +1 @@ -Neil Crighton, Stephanie T. Douglas \ No newline at end of file +Neil Crighton, Stephanie T. Douglas diff --git a/redshift-plot.ipynb b/redshift-plot.ipynb index 9f5fa50..2102056 100755 --- a/redshift-plot.ipynb +++ b/redshift-plot.ipynb @@ -58,8 +58,8 @@ "metadata": {}, "outputs": [], "source": [ - "from astropy.cosmology import FlatLambdaCDM\n", "import astropy.units as u\n", + "from astropy.cosmology import FlatLambdaCDM\n", "\n", "# In this case we just need to define the matter density\n", "# and hubble parameter at z=0.\n", @@ -197,7 +197,7 @@ "ax.plot(zvals, dist)\n", "ax2 = ax.twiny()\n", "ax2.set_xticks(ageticks)\n", - "ax2.set_xticklabels([\"{:g}\".format(age) for age in ages.value])" + "ax2.set_xticklabels([f\"{age:g}\" for age in ages.value])" ] }, { @@ -218,7 +218,7 @@ "ax.plot(zvals, dist)\n", "ax2 = ax.twiny()\n", "ax2.set_xticks(ageticks)\n", - "ax2.set_xticklabels([\"{:g}\".format(age) for age in ages.value])\n", + "ax2.set_xticklabels([f\"{age:g}\" for age in ages.value])\n", "zmin, zmax = 0.0, 5.9\n", "ax.set_xlim(zmin, zmax)\n", "ax2.set_xlim(zmin, zmax)" @@ -242,7 +242,7 @@ "ax.plot(zvals, dist)\n", "ax2 = ax.twiny()\n", "ax2.set_xticks(ageticks)\n", - "ax2.set_xticklabels([\"{:g}\".format(age) for age in ages.value])\n", + "ax2.set_xticklabels([f\"{age:g}\" for age in ages.value])\n", "zmin, zmax = 0, 5.9\n", "ax.set_xlim(zmin, zmax)\n", "ax2.set_xlim(zmin, zmax)\n", @@ -273,11 +273,11 @@ "fig = plt.figure(figsize=(6, 4))\n", "ax = fig.add_subplot(111)\n", "ax.plot(zvals, dist2, label=\"Planck 2013\")\n", - "ax.plot(zvals, dist, label=\"$h=0.7,\\ \\Omega_M=0.3,\\ \\Omega_\\Lambda=0.7$\")\n", + "ax.plot(zvals, dist, label=r\"$h=0.7,\\ \\Omega_M=0.3,\\ \\Omega_\\Lambda=0.7$\")\n", "ax.legend(frameon=0, loc=\"lower right\")\n", "ax2 = ax.twiny()\n", "ax2.set_xticks(ageticks)\n", - "ax2.set_xticklabels([\"{:g}\".format(age) for age in ages.value])\n", + "ax2.set_xticklabels([f\"{age:g}\" for age in ages.value])\n", "zmin, zmax = 0.0, 5.9\n", "ax.set_xlim(zmin, zmax)\n", "ax2.set_xlim(zmin, zmax)\n",