Skip to content

Commit

Permalink
Merge pull request #313 from 21cmfast/angular-lightcone
Browse files Browse the repository at this point in the history
Angular lightcone
  • Loading branch information
steven-murray authored Feb 19, 2024
2 parents f2306e1 + 346e23e commit 2cf3c88
Show file tree
Hide file tree
Showing 41 changed files with 4,678 additions and 1,267 deletions.
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

0 comments on commit 2cf3c88

Please sign in to comment.