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"] 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",