Skip to content

Commit c333fb8

Browse files
style: pre-commit fixes
1 parent e4c85e4 commit c333fb8

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

AUTHORS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Neil Crighton, Stephanie T. Douglas
1+
Neil Crighton, Stephanie T. Douglas

redshift-plot.ipynb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@
5858
"metadata": {},
5959
"outputs": [],
6060
"source": [
61-
"from astropy.cosmology import FlatLambdaCDM\n",
6261
"import astropy.units as u\n",
62+
"from astropy.cosmology import FlatLambdaCDM\n",
6363
"\n",
6464
"# In this case we just need to define the matter density\n",
6565
"# and hubble parameter at z=0.\n",
@@ -197,7 +197,7 @@
197197
"ax.plot(zvals, dist)\n",
198198
"ax2 = ax.twiny()\n",
199199
"ax2.set_xticks(ageticks)\n",
200-
"ax2.set_xticklabels([\"{:g}\".format(age) for age in ages.value])"
200+
"ax2.set_xticklabels([f\"{age:g}\" for age in ages.value])"
201201
]
202202
},
203203
{
@@ -218,7 +218,7 @@
218218
"ax.plot(zvals, dist)\n",
219219
"ax2 = ax.twiny()\n",
220220
"ax2.set_xticks(ageticks)\n",
221-
"ax2.set_xticklabels([\"{:g}\".format(age) for age in ages.value])\n",
221+
"ax2.set_xticklabels([f\"{age:g}\" for age in ages.value])\n",
222222
"zmin, zmax = 0.0, 5.9\n",
223223
"ax.set_xlim(zmin, zmax)\n",
224224
"ax2.set_xlim(zmin, zmax)"
@@ -242,7 +242,7 @@
242242
"ax.plot(zvals, dist)\n",
243243
"ax2 = ax.twiny()\n",
244244
"ax2.set_xticks(ageticks)\n",
245-
"ax2.set_xticklabels([\"{:g}\".format(age) for age in ages.value])\n",
245+
"ax2.set_xticklabels([f\"{age:g}\" for age in ages.value])\n",
246246
"zmin, zmax = 0, 5.9\n",
247247
"ax.set_xlim(zmin, zmax)\n",
248248
"ax2.set_xlim(zmin, zmax)\n",
@@ -273,11 +273,11 @@
273273
"fig = plt.figure(figsize=(6, 4))\n",
274274
"ax = fig.add_subplot(111)\n",
275275
"ax.plot(zvals, dist2, label=\"Planck 2013\")\n",
276-
"ax.plot(zvals, dist, label=\"$h=0.7,\\ \\Omega_M=0.3,\\ \\Omega_\\Lambda=0.7$\")\n",
276+
"ax.plot(zvals, dist, label=r\"$h=0.7,\\ \\Omega_M=0.3,\\ \\Omega_\\Lambda=0.7$\")\n",
277277
"ax.legend(frameon=0, loc=\"lower right\")\n",
278278
"ax2 = ax.twiny()\n",
279279
"ax2.set_xticks(ageticks)\n",
280-
"ax2.set_xticklabels([\"{:g}\".format(age) for age in ages.value])\n",
280+
"ax2.set_xticklabels([f\"{age:g}\" for age in ages.value])\n",
281281
"zmin, zmax = 0.0, 5.9\n",
282282
"ax.set_xlim(zmin, zmax)\n",
283283
"ax2.set_xlim(zmin, zmax)\n",

0 commit comments

Comments
 (0)