Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angular lightcone #313

Merged
merged 61 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
ea578ba
feat: allow angular lightcones
steven-murray Nov 18, 2022
e85ec36
fix: some test failures
steven-murray Nov 20, 2022
93bb706
fix: simple typing fix
steven-murray Nov 22, 2022
b745e75
feat: allow arbitrary start index for rect lightcones
steven-murray Nov 22, 2022
fc8e4fe
fix: add clobber to .save()
steven-murray Nov 22, 2022
9a11b4f
feat: add from_astropy method to CosmoParams
steven-murray Nov 23, 2022
7bb3187
ux: reduce excessive warnings
steven-murray Nov 24, 2022
c31e1d7
fix: restore API compatibility
steven-murray Nov 24, 2022
5db151f
docs: update lightcone notebook
steven-murray Dec 13, 2022
43c5af3
fix: don't import healpix
steven-murray Dec 13, 2022
639d955
Merge branch 'master' into angular-lightcone
steven-murray Dec 13, 2022
2a63c50
ci: add cosmotile to docs reqs
steven-murray Dec 13, 2022
d56da46
docs: don't mock scipy
steven-murray Dec 13, 2022
74acb01
feat: add rsds to angular lightcone
steven-murray Mar 15, 2023
44784b5
feat: add rsds to angular lightcone
steven-murray Mar 16, 2023
9145acb
fix: los_velocity is in Mpc/s
steven-murray Mar 16, 2023
518a125
fix: add linear approx rsds to angular lightcone
steven-murray Mar 17, 2023
215e0fd
docs: add rsds to lightcones in tutorial
steven-murray Mar 17, 2023
9e367b2
Merge branch 'angular-lightcone' of github.com:21cmFAST/21cmFAST into…
steven-murray Mar 17, 2023
f753088
fix: dvdx was wrong way around
steven-murray Mar 18, 2023
d72680e
fix: array shape for cosmotile
steven-murray Mar 18, 2023
edfc87e
Merge branch 'angular-lightcone' of github.com:21cmFAST/21cmFAST into…
steven-murray Mar 18, 2023
c046322
fix: los_displacement was pointing the wrong way
steven-murray Mar 18, 2023
8a27e13
Merge branch 'angular-lightcone' of github.com:21cmFAST/21cmFAST into…
steven-murray Mar 18, 2023
2dccca3
docs: updates to the lightcone tutorial for RSDs
steven-murray Mar 18, 2023
6140f56
test: fix ang_lightcone correlation test
steven-murray Mar 18, 2023
1333ff8
test: get ang_lightcone test working
steven-murray Mar 18, 2023
f7abc3f
Merge branch 'master' into angular-lightcone
steven-murray Mar 18, 2023
32cf864
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 18, 2023
9238af5
docs: lightcone tutorial hires
steven-murray Mar 18, 2023
e0b9b55
Merge branch 'angular-lightcone' of github.com:21cmFAST/21cmFAST into…
steven-murray Mar 22, 2023
12e3ef7
merge master
steven-murray May 15, 2023
0dbde22
Better plots from the lightcones tutorial
steven-murray Jun 23, 2023
c6dd18c
merge master
steven-murray Jun 23, 2023
f3acded
Merge branch 'master' into angular-lightcone
steven-murray Dec 19, 2023
4580080
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 19, 2023
a9b3b72
fix: NCF updates
steven-murray Dec 19, 2023
1d16d8a
fix: NCF updates
steven-murray Dec 19, 2023
bc6681a
fix: subcell_rsd and perturb_field
steven-murray Dec 20, 2023
6dfcbd3
maint: require cosmotile>=0.2
steven-murray Dec 21, 2023
a8be3f2
maint: use py39+
steven-murray Dec 21, 2023
68b5757
test: more reasonable checks on the power spectrum
steven-murray Dec 21, 2023
cd81e83
test: more reasonable checks on the power spectrum
steven-murray Dec 21, 2023
c656fbe
test: more reasonable checks on the power spectrum
steven-murray Dec 21, 2023
848bf04
ci: try to get MacOS builds working
steven-murray Dec 21, 2023
2993d67
ci: try using gcc setup action
steven-murray Dec 21, 2023
bc6a958
maint: require attrs
steven-murray Dec 21, 2023
184d592
test: many more tests of lightconing
steven-murray Dec 22, 2023
aec560e
test: fix lightconer tests
steven-murray Dec 22, 2023
7a5d80e
fix: require +res, not sure why
steven-murray Dec 27, 2023
9c2d61f
test: increase coverage of wrapper
steven-murray Dec 28, 2023
5fe2b34
ci: run docs tutorials
steven-murray Dec 28, 2023
a976f54
docs: fix tutorial notebooks
steven-murray Dec 28, 2023
0934446
docs: fix lightcone tutorial unit error
steven-murray Dec 28, 2023
73eb187
feat: don't read full boxes until necessary
steven-murray Dec 28, 2023
1635a5b
Merge branch 'master' into angular-lightcone
steven-murray Dec 28, 2023
995c6a4
fix: segfaults due to not loading arrays
steven-murray Dec 28, 2023
e4c57a8
Merge branch 'master' into angular-lightcone
steven-murray Jan 16, 2024
6429bef
docs: pare down lightcone demo
steven-murray Feb 16, 2024
04f121c
test: explicitly test no warning is raised in interp table
steven-murray Feb 16, 2024
346e23e
docs: ensure cffi is installed
steven-murray Feb 19, 2024
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
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ignore =
# Docstring in imperative mood. This should *not* be the case for @property's, but can't ignore them atm.
D401
max-line-length = 88
max-complexity = 40
max-complexity = 55
docstring-convention=numpy
inline-quotes="
ignore-decorators=click.option
Expand Down
111 changes: 111 additions & 0 deletions .github/workflows/run-tutorials.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: Tests

# Test on all pushes, except when the push is literally just a tag (because we
# tag automatically via CI, and therefore there's no extra code in that push).
# Also, only test on pull requests into master/production.
on:
push:
tags-ignore:
- 'v*'
pull_request:
branches:
- 'master'
- 'production'


jobs:
tests:
if: "!contains(github.event.pull_request.labels.*.name, 'auto-pr')"
env:
ENV_NAME: tests
PYTHON: ${{ matrix.python-version }}
OS: ${{ matrix.os }}
CC: gcc
name: Testing
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.11"]
tutorial: ["coeval_cubes", "gather_data", "lightcones"]
defaults:
run:
# Adding -l {0} ensures conda can be found properly in each step
shell: bash -l {0}
steps:
- uses: actions/checkout@master
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0

- name: Print head git commit message
id: get_head_commit_message
run: echo "commit_message=$(git show -s --format=%s)" >> "$GITHUB_ENV"

- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
# auto-update-conda: true
mamba-version: "*"
channels: conda-forge,defaults
python-version: ${{ matrix.python-version }}
environment-file: ci/${{ matrix.os }}-env.yml
activate-environment: tests
channel-priority: true

- name: Conda Info
run: |
conda info -a
conda list
conda config --show-sources
conda config --show
printenv | sort

- name: Make it a Debug Run
if: "contains(env.commit_message, 'ci debug')"
run: |
echo "log_level=ULTRA_DEBUG" >> $GITHUB_ENV

- name: Make it a Normal Run
if: "!contains(env.commit_message, 'ci debug')"
run: |
echo "log_level=INFO" >> $GITHUB_ENV

- name: Get C Libraries Linux
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get install libfftw3-dev
sudo apt-get install libgsl0-dev

- name: Setup GCC
uses: Dup4/actions-setup-gcc@v1
with:
version: latest

- name: Install 21cmFAST Linux
if: matrix.os == 'ubuntu-latest'
run: |
LOG_LEVEL=${{ env.log_level }} pip install .

- name: Install 21cmFAST MacOS
if: matrix.os == 'macos-latest'
run: |
LOG_LEVEL=${{ env.log_level }} CFLAGS="-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk" pip install .

- name: Setup papermill
run: |
pip install papermill
pip install ipykernel
python -m ipykernel install --user --name=tests

- name: Run
run: |
TEST_RUN=True papermill -k tests --request-save-on-cell-execute docs/tutorials/${{ matrix.tutorial }}.ipynb ${{ matrix.tutorial }}.ipynb

- name: Archive Notebooks
uses: actions/upload-artifact@v3
with:
name: tutorials-${{ matrix.tutorial }}
path: |
${{ matrix.tutorial }}.ipynb
15 changes: 10 additions & 5 deletions .github/workflows/test_suite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: [3.7, 3.8, 3.9, "3.10"]
python-version: [3.9, "3.10", "3.11"]
defaults:
run:
# Adding -l {0} ensures conda can be found properly in each step
Expand All @@ -43,15 +43,15 @@ jobs:
run: echo "commit_message=$(git show -s --format=%s)" >> "$GITHUB_ENV"

- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2.1.1
uses: conda-incubator/setup-miniconda@v3
with:
# auto-update-conda: true
miniconda-version: "latest"
mamba-version: "*"
channels: conda-forge,defaults
python-version: ${{ matrix.python-version }}
environment-file: ci/${{ matrix.os }}-env.yml
activate-environment: tests
channel-priority: strict
use-only-tar-bz2: true
channel-priority: true

- name: Conda Info
run: |
Expand Down Expand Up @@ -79,6 +79,11 @@ jobs:
sudo apt-get install libfftw3-dev
sudo apt-get install libgsl0-dev

- name: Setup GCC
uses: Dup4/actions-setup-gcc@v1
with:
version: latest

- name: Install 21cmFAST Linux
if: matrix.os == 'ubuntu-latest'
run: |
Expand Down
36 changes: 0 additions & 36 deletions .travis.yml

This file was deleted.

36 changes: 36 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,42 @@ Changelog
dev-version
-----------

Deprecations
~~~~~~~~~~~~

* Python <3.9 is no longer supported.

Fixed
~~~~~

* Fixed small issue in ``Lightcone.lightcone_coords``.

Added
~~~~~

* New ``Lightconer`` base class with user-facing classes ``RectilinearLightconer`` and
``AngularLightconer``. These are now the recommended way to define how lightcones
should be created. Note that these are *not* the final lightcone object, but simply a
"definition" for how to create the lightcone.
* The ``Lightcone`` class still exists, but is now joined by an ``AngularLightcone``
class that is the output lightcone when using the ``AngularLightconer`` definition.
* New ``KEEP_3D_VELOCITIES`` user-param. This is *required* to be True if you want to
apply RSDs to an ``AngularLightcone``.
* Ability to check-point lightcone creation, so that it can be resumed later. Simply
pass the ``lightcone_fname`` argument to ``run_lightcone``.
* New ``cache_tools.get_boxes_at_redshift`` function to get all boxes at a given
redshift, regardless of the parameters used to create them.
* New ``CosmoParams.from_astropy()`` classmethod for constructing a cosmo params object
directly from an astropy cosmology.


Internals
~~~~~~~~~

* Refactored RSDs to the ``subcell_rsds.c`` C-module.
* Added CI testing of the docs tutorials.
* More precise debugging summaries of boxes in the C code.

Fixed
~~~~~

Expand Down
2 changes: 1 addition & 1 deletion ci/macos-latest-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dependencies:
- pip
- gsl
- fftw
- conda-forge/label/cf201901::gcc
#- gcc
- pip:
- powerbox
- cached_property
Expand Down
4 changes: 0 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ def __getattr__(cls, name):
"click",
"tqdm",
"pyyaml",
"scipy",
"scipy.interpolate",
"scipy.integrate",
"scipy.special",
"h5py",
"cached_property",
]
Expand Down
2 changes: 2 additions & 0 deletions docs/environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@ dependencies:
- sphinx-rtd-theme
- setuptools_scm
- bidict
- cosmotile
- nbsphinx
- nbconvert>=6.4.5
- cffi
Loading
Loading