Skip to content

Commit 34522fd

Browse files
Merge pull request #61 from 21cmfast/fix-lc-sliceplot-docs
refactor: use nicer function name for lightcone sliceplots
2 parents 9368f3b + a266001 commit 34522fd

13 files changed

Lines changed: 248 additions & 159 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ docs/_build/
1616
_version.py
1717
_autosummary/
1818
coverage.xml
19+
.ipynb_checkpoints/

docs/conf.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
"""Configuration for docs."""
22

33
import os
4-
from datetime import datetime, timezone
54
import sys
5+
from datetime import UTC, datetime
66
from pathlib import Path
7+
78
sys.path.insert(0, str(Path(__file__).absolute().parent.parent / "src"))
89

910
import tuesday
@@ -45,7 +46,7 @@
4546
source_suffix = ".rst"
4647
master_doc = "index"
4748
project = "tuesday"
48-
year = str(datetime.now(tz=timezone.utc).year)
49+
year = str(datetime.now(tz=UTC).year)
4950
author = "Daniela Breitman and Steven Murray"
5051
copyright = f"{year}, {author}"
5152
version = release = tuesday.__version__
@@ -86,4 +87,4 @@
8687
".DS_Store",
8788
"templates",
8889
"**.ipynb_checkpoints",
89-
]
90+
]

docs/tutorials/computing_and_plotting_power_spectra.ipynb

Lines changed: 36 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -185,14 +185,13 @@
185185
}
186186
],
187187
"source": [
188-
"\n",
189188
"ax = plot_coeval_slice(\n",
190189
" delta_x,\n",
191190
" box_len,\n",
192191
" transform2slice=coeval2slice_x(idx=15),\n",
193192
" title=\"Slice in x-direction\",\n",
194-
" v_x=delta_x[15,...]*un.m / un.s,\n",
195-
" v_y=delta_x[15,...]*un.m / un.s,\n",
193+
" v_x=delta_x[15, ...] * un.m / un.s,\n",
194+
" v_y=delta_x[15, ...] * un.m / un.s,\n",
196195
" quiver_decimate_factor=3,\n",
197196
")"
198197
]
@@ -232,7 +231,10 @@
232231
],
233232
"source": [
234233
"plot_coeval_slice(\n",
235-
" delta_x.value*un.mK, box_len, transform2slice=coeval2slice_y(), title=\"Slice in y-direction\"\n",
234+
" delta_x.value * un.mK,\n",
235+
" box_len,\n",
236+
" transform2slice=coeval2slice_y(),\n",
237+
" title=\"Slice in y-direction\",\n",
236238
")"
237239
]
238240
},
@@ -530,16 +532,16 @@
530532
},
531533
{
532534
"cell_type": "code",
533-
"execution_count": 17,
535+
"execution_count": null,
534536
"metadata": {},
535537
"outputs": [],
536538
"source": [
537-
"from tuesday.core import lc2slice_x, lc2slice_y, plot_redshift_slice"
539+
"from tuesday.core import lc2slice_x, lc2slice_y, plot_lightcone_slice"
538540
]
539541
},
540542
{
541543
"cell_type": "code",
542-
"execution_count": 18,
544+
"execution_count": null,
543545
"metadata": {},
544546
"outputs": [
545547
{
@@ -564,7 +566,7 @@
564566
}
565567
],
566568
"source": [
567-
"plot_redshift_slice(\n",
569+
"plot_lightcone_slice(\n",
568570
" lc,\n",
569571
" box_len,\n",
570572
" lc_redshifts,\n",
@@ -583,7 +585,7 @@
583585
},
584586
{
585587
"cell_type": "code",
586-
"execution_count": 19,
588+
"execution_count": null,
587589
"metadata": {},
588590
"outputs": [
589591
{
@@ -608,7 +610,7 @@
608610
}
609611
],
610612
"source": [
611-
"plot_redshift_slice(\n",
613+
"plot_lightcone_slice(\n",
612614
" lc,\n",
613615
" box_len,\n",
614616
" lc_redshifts,\n",
@@ -628,7 +630,7 @@
628630
},
629631
{
630632
"cell_type": "code",
631-
"execution_count": 20,
633+
"execution_count": null,
632634
"metadata": {},
633635
"outputs": [
634636
{
@@ -653,7 +655,7 @@
653655
}
654656
],
655657
"source": [
656-
"plot_redshift_slice(\n",
658+
"plot_lightcone_slice(\n",
657659
" lc,\n",
658660
" box_len,\n",
659661
" lc_redshifts,\n",
@@ -793,16 +795,16 @@
793795
"fig, ax = plt.subplots(1, 1, figsize=(18, 7))\n",
794796
"\n",
795797
"ax = tuesday.core.plot_power_spectrum(\n",
796-
" ps1d,\n",
797-
" at_k=0.05,\n",
798-
" fontsize=20,\n",
799-
" ax=ax,\n",
800-
" color=f\"r\",\n",
801-
" legend=f\"k ~ 0.05\",\n",
802-
" legend_kwargs={\"frameon\": False},\n",
803-
" logx=False,\n",
804-
" logy=False,\n",
805-
" )\n",
798+
" ps1d,\n",
799+
" at_k=0.05,\n",
800+
" fontsize=20,\n",
801+
" ax=ax,\n",
802+
" color=\"r\",\n",
803+
" legend=\"k ~ 0.05\",\n",
804+
" legend_kwargs={\"frameon\": False},\n",
805+
" logx=False,\n",
806+
" logy=False,\n",
807+
")\n",
806808
"\n",
807809
"ax = tuesday.core.plot_power_spectrum(\n",
808810
" all_analytic,\n",
@@ -840,16 +842,16 @@
840842
"fig, ax = plt.subplots(1, 1, figsize=(18, 7))\n",
841843
"\n",
842844
"ax = tuesday.core.plot_power_spectrum(\n",
843-
" ps1d,\n",
844-
" fontsize=20,\n",
845-
" ax=ax,\n",
846-
" color=f\"r\",\n",
847-
" at_k=at_k,\n",
848-
" legend=f\"k ~ \"+str(at_k),\n",
849-
" legend_kwargs={\"frameon\": False},\n",
850-
" logx=False,\n",
851-
" logy=False,\n",
852-
" )\n",
845+
" ps1d,\n",
846+
" fontsize=20,\n",
847+
" ax=ax,\n",
848+
" color=\"r\",\n",
849+
" at_k=at_k,\n",
850+
" legend=\"k ~ \" + str(at_k),\n",
851+
" legend_kwargs={\"frameon\": False},\n",
852+
" logx=False,\n",
853+
" logy=False,\n",
854+
")\n",
853855
"\n",
854856
"ax = tuesday.core.plot_power_spectrum(\n",
855857
" all_analytic,\n",
@@ -1064,7 +1066,7 @@
10641066
],
10651067
"metadata": {
10661068
"kernelspec": {
1067-
"display_name": "21cmFAST",
1069+
"display_name": "tuesday",
10681070
"language": "python",
10691071
"name": "python3"
10701072
},
@@ -1078,7 +1080,7 @@
10781080
"name": "python",
10791081
"nbconvert_exporter": "python",
10801082
"pygments_lexer": "ipython3",
1081-
"version": "3.11.12"
1083+
"version": "3.12.6"
10821084
},
10831085
"latex_envs": {
10841086
"LaTeX_envs_menu_present": true,

0 commit comments

Comments
 (0)