Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
1fb3909
feat: Issue #48 feature 1
DanielaBreitman Sep 10, 2025
1ad06be
feat: Issue #48 feature 1
DanielaBreitman Sep 10, 2025
872bb40
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 10, 2025
6317d88
feat: Issue #48 feature 2
DanielaBreitman Sep 11, 2025
7e847d7
feat: Issue #48 feature 2
DanielaBreitman Sep 11, 2025
446ad62
feat: Issue #48 feature 2
DanielaBreitman Sep 11, 2025
fb1c5c1
feat: Issue #48 feature 2
DanielaBreitman Sep 11, 2025
05055b9
feat: Issue #48 feature 2
DanielaBreitman Sep 11, 2025
71c791a
feat: Issue #48 feature 2
DanielaBreitman Sep 11, 2025
3dde869
feat: Issue #48 feature 2
DanielaBreitman Sep 11, 2025
81becd3
feat: Issue #48 feature 2
DanielaBreitman Sep 11, 2025
ae21b85
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 11, 2025
65e9816
feat: Issue #48 feature 2
DanielaBreitman Sep 11, 2025
1131f98
maint: fix tests
DanielaBreitman Sep 11, 2025
149c253
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 11, 2025
6b4fec4
feat: Issue #48 finish fnc 1
DanielaBreitman Sep 12, 2025
76d1a4e
feat: Issue #48 finish fnc 2
DanielaBreitman Sep 12, 2025
2766259
maint: fix tests
DanielaBreitman Sep 12, 2025
028bf5d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 12, 2025
6a9046e
maint: fix tests
DanielaBreitman Sep 12, 2025
19e6565
maint: fix Steven's comments
DanielaBreitman Sep 12, 2025
26e479f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 12, 2025
e7e1c84
fix: wedge removal done properly
DanielaBreitman Sep 12, 2025
ad98158
doc: can provide either beam area or Aeff
DanielaBreitman Sep 12, 2025
8fcc95f
doc: can provide either beam area or Aeff
DanielaBreitman Sep 12, 2025
1fb7b8e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 12, 2025
66643bc
fix: wedge removal done properly
DanielaBreitman Sep 12, 2025
f737e0b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 12, 2025
9193db0
fix: wedge removal NOT done properly
DanielaBreitman Sep 12, 2025
9fcd546
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 12, 2025
12bb69d
refactor: change some function names and make lightcone obs more clear
steven-murray Sep 14, 2025
fddae9a
maint: ignore ipynb checkpoints
steven-murray Sep 14, 2025
d845955
feat: add ability to apply spatial taper again
steven-murray Sep 16, 2025
3ccaaf9
remove checkpoint files
steven-murray Sep 16, 2025
46c146e
fix: scaling of uv grid and conjugate halving
steven-murray Oct 17, 2025
df6ea78
Fix 2 wedge removal bugs: Unnecessaru Fourier shifting and only remov…
Oct 24, 2025
ee0fcd7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 24, 2025
57ba8ff
feat: add ability to do inv variance weighting in map-making
steven-murray Nov 27, 2025
b6ae16f
fix: correct uv gridding
steven-murray Nov 28, 2025
b0cf2a9
style: run ruff
steven-murray Nov 28, 2025
17249f0
Merge pull request #57 from nikos-triantafyllou/better_lc_noise
steven-murray Mar 22, 2026
d1cdec6
fix: lightcone noise now matches 21cmSense
Mar 27, 2026
f304f7f
style: apply pre-commit
Mar 27, 2026
81877ab
docs: get all tutorials working
Mar 28, 2026
c544825
docs: remove bad notebook
Mar 28, 2026
71fefa8
docs: formatting fixes
Mar 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ docs/_build/
_version.py
_autosummary/
coverage.xml
.ipynb_checkpoints
.pytest_cache/
__pycache__/
10 changes: 3 additions & 7 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
"""Configuration for docs."""

import os
from datetime import datetime, timezone

from tuesday import __version__

from datetime import UTC, datetime
from unittest.mock import MagicMock

sys.path.insert(0, str(Path(__file__).absolute().parent.parent / "src"))
from tuesday import __version__


class Mock(MagicMock):
Expand All @@ -27,7 +24,6 @@ def __getattr__(cls, name):
"h5py",
"cached_property",
]
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)

extensions = [
"sphinx.ext.autodoc",
Expand Down Expand Up @@ -60,7 +56,7 @@ def __getattr__(cls, name):
source_suffix = ".rst"
master_doc = "index"
project = "tuesday"
year = str(datetime.now(tz=timezone.utc).year)
year = str(datetime.now(tz=UTC).year)
author = "21cmFAST Team"
copyright = f"{year}, {author}"
version = release = __version__
Expand Down
50 changes: 26 additions & 24 deletions docs/tutorials/computing_and_plotting_power_spectra.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,13 @@
}
],
"source": [
"\n",
"ax = plot_coeval_slice(\n",
" delta_x,\n",
" box_len,\n",
" transform2slice=coeval2slice_x(idx=15),\n",
" title=\"Slice in x-direction\",\n",
" v_x=delta_x[15,...]*un.m / un.s,\n",
" v_y=delta_x[15,...]*un.m / un.s,\n",
" v_x=delta_x[15, ...] * un.m / un.s,\n",
" v_y=delta_x[15, ...] * un.m / un.s,\n",
" quiver_decimate_factor=3,\n",
")"
]
Expand Down Expand Up @@ -232,7 +231,10 @@
],
"source": [
"plot_coeval_slice(\n",
" delta_x.value*un.mK, box_len, transform2slice=coeval2slice_y(), title=\"Slice in y-direction\"\n",
" delta_x.value * un.mK,\n",
" box_len,\n",
" transform2slice=coeval2slice_y(),\n",
" title=\"Slice in y-direction\",\n",
")"
]
},
Expand Down Expand Up @@ -793,16 +795,16 @@
"fig, ax = plt.subplots(1, 1, figsize=(18, 7))\n",
"\n",
"ax = tuesday.core.plot_power_spectrum(\n",
" ps1d,\n",
" at_k=0.05,\n",
" fontsize=20,\n",
" ax=ax,\n",
" color=f\"r\",\n",
" legend=f\"k ~ 0.05\",\n",
" legend_kwargs={\"frameon\": False},\n",
" logx=False,\n",
" logy=False,\n",
" )\n",
" ps1d,\n",
" at_k=0.05,\n",
" fontsize=20,\n",
" ax=ax,\n",
" color=\"r\",\n",
" legend=\"k ~ 0.05\",\n",
" legend_kwargs={\"frameon\": False},\n",
" logx=False,\n",
" logy=False,\n",
")\n",
"\n",
"ax = tuesday.core.plot_power_spectrum(\n",
" all_analytic,\n",
Expand Down Expand Up @@ -840,16 +842,16 @@
"fig, ax = plt.subplots(1, 1, figsize=(18, 7))\n",
"\n",
"ax = tuesday.core.plot_power_spectrum(\n",
" ps1d,\n",
" fontsize=20,\n",
" ax=ax,\n",
" color=f\"r\",\n",
" at_k=at_k,\n",
" legend=f\"k ~ \"+str(at_k),\n",
" legend_kwargs={\"frameon\": False},\n",
" logx=False,\n",
" logy=False,\n",
" )\n",
" ps1d,\n",
" fontsize=20,\n",
" ax=ax,\n",
" color=\"r\",\n",
" at_k=at_k,\n",
" legend=\"k ~ \" + str(at_k),\n",
" legend_kwargs={\"frameon\": False},\n",
" logx=False,\n",
" logy=False,\n",
")\n",
"\n",
"ax = tuesday.core.plot_power_spectrum(\n",
" all_analytic,\n",
Expand Down
770 changes: 487 additions & 283 deletions docs/tutorials/lc_noise_compare_tools21cm.ipynb

Large diffs are not rendered by default.

1,088 changes: 1,088 additions & 0 deletions docs/tutorials/lc_noise_example.ipynb

Large diffs are not rendered by default.

2,322 changes: 2,322 additions & 0 deletions docs/tutorials/match_lc_noise_power_to_sense.ipynb

Large diffs are not rendered by default.

54 changes: 27 additions & 27 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ authors = [
{ name = "James Davies", email = "james.davies@sns.it" },
{ name = "Steven Murray", email = "murray.steveng@gmail.com" },
]
requires-python = ">=3.10"
requires-python = ">=3.11"
license = {text="MIT"}
classifiers = [
"Development Status :: 4 - Beta",
Expand All @@ -31,7 +31,7 @@ classifiers = [
]

dependencies = [
"21cmfast",
"21cmfast>=4.1.0",
"21cmsense>=2.0.0",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to be updated for new 21cmsense version

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, will need to merge that PR and make a release before merging this!

"astropy>=7.0.1",
"attrs>=25.3.0",
Expand All @@ -41,19 +41,25 @@ dependencies = [
]
dynamic = ['version']

[project.optional-dependencies]
21cmfast = ['21cmFAST>=4.0.0b']
[dependency-groups]
tests = [
"coverage",
"pytest-cov",
"pre-commit",
"pytest",
"sphinx",
"coverage>=7.8.2",
"pytest>=8.3.5",
"pytest-cov>=6.1.1",
]
dev = [
"tuesday-eor[tests,21cmfast]"

docs = [
"sphinx>=8.2.3",
"tools21cm>=2.3.10",
]

dev = [
"ipykernel>=7.2.0",
"pip>=26.0.1",
"pre-commit>=4.2.0",
{include-group = "tests"},
{include-group = "docs"},
]

[project.urls]
Repository = "https://github.com/21cmfast/tuesday"
Expand Down Expand Up @@ -111,19 +117,24 @@ ignore = [
]

[tool.ruff.lint.per-file-ignores]
"docs/tutorials/lc_noise_compare_tools21cm.ipynb" = [
"T201", # print statements
"N",
"F", # TODO: remove all these once this notebook is fixed.
]
"tests/*.py" = [
"D", # ignore missing docstring in tests
"DTZ", # ignore datetime in tests
"T", # print statements
]
"*.ipynb" = [
"T201", # print statements
]
"docs/conf.py" = [
"A", # conf.py can shadow builtins
"ERA",
"DTZ",
]
"docs/tutorials/*.ipynb" = [
"T201", # print statements
]

[tool.ruff.lint.pydocstyle]
convention = 'numpy'
Expand All @@ -136,16 +147,5 @@ property-decorators = [
max-complexity = 21

[tool.uv.sources]
21cmfast = { git = "https://github.com/21cmFAST/21cmFAST" }

[dependency-groups]
21cmfast = [
"21cmfast",
]
dev = [
"coverage>=7.8.2",
"pre-commit>=4.2.0",
"pytest>=8.3.5",
"pytest-cov>=6.1.1",
"sphinx>=8.2.3",
]
powerbox = { git = "https://github.com/steven-murray/powerbox", rev = "better-interp" }
21cmsense = { git = "https://github.com/rasg-affiliates/21cmSense", rev = "fast-hist" }
30 changes: 21 additions & 9 deletions src/tuesday/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,49 @@
__all__ = [
"CylindricalPS",
"SphericalPS",
"apply_beam",
"bin_kpar",
"blackmanharris",
"calculate_ps",
"calculate_ps_coeval",
"calculate_ps_lc",
"coeval2slice_x",
"coeval2slice_y",
"coeval2slice_z",
"compute_beam",
"compute_thermal_rms_per_snapshot_vis",
"compute_thermal_rms_uvgrid",
"compute_uv_sampling",
"convert_half_to_full_uv_plane",
"cylindrical_to_spherical",
"grid_baselines_uv",
"horizon_limit",
"instrument_models",
"lc2slice_x",
"lc2slice_y",
"observe_lightcone",
"plot_1d_power_spectrum_k",
"plot_1d_power_spectrum_z",
"plot_2d_power_spectrum",
"plot_coeval_slice",
"plot_pdf",
"plot_power_spectrum",
"plot_redshift_slice",
"sample_from_rms_noise",
"sample_lc_noise",
"plotting",
"sample_from_rms_uvgrid",
"summaries",
"taper2d",
"thermal_noise_per_voxel",
"validate",
]
from . import instrument_models, plotting, summaries
from .instrument_models.noise import (
grid_baselines_uv,
sample_from_rms_noise,
sample_lc_noise,
apply_beam,
compute_beam,
compute_thermal_rms_per_snapshot_vis,
compute_thermal_rms_uvgrid,
compute_uv_sampling,
convert_half_to_full_uv_plane,
observe_lightcone,
sample_from_rms_uvgrid,
taper2d,
thermal_noise_per_voxel,
)
from .plotting.powerspectra import (
plot_1d_power_spectrum_k,
Expand Down
Loading
Loading