From a6168531e0bc7cd7976d53e2241eea958eeed44b Mon Sep 17 00:00:00 2001 From: sebastian-belkner Date: Tue, 19 May 2026 13:02:19 +0800 Subject: [PATCH 1/4] update --- .github/workflows/smoke_test.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/smoke_test.yaml b/.github/workflows/smoke_test.yaml index 5a46c900..1462aaaa 100644 --- a/.github/workflows/smoke_test.yaml +++ b/.github/workflows/smoke_test.yaml @@ -32,6 +32,7 @@ jobs: pip install numpy ducc0 pip install git+https://github.com/carronj/plancklens pip install git+https://github.com/carronj/lenspyx + pip install -e ".[dev]" - name: Run smoke test - run: python -m unittest tests/test_integration_mwe.py -v + run: python -m unittest tests/test_integration_mwe.py -v \ No newline at end of file From fe8b7df76ea6d3d08c94d19d01190a0c7163e6b4 Mon Sep 17 00:00:00 2001 From: sebastian-belkner Date: Tue, 19 May 2026 13:07:05 +0800 Subject: [PATCH 2/4] update --- README.md | 139 +++++++++++++++++++++++------------------------------- 1 file changed, 60 insertions(+), 79 deletions(-) diff --git a/README.md b/README.md index 7828c6e7..07c5e9b0 100644 --- a/README.md +++ b/README.md @@ -1,132 +1,113 @@ ![delensalot logo](res/dlensalot2.PNG) -[![Install](https://github.com/NextGenCMB/delensalot/actions/workflows/install.yaml/badge.svg?branch=sims&event=pull_request)](https://github.com/NextGenCMB/delensalot/actions/workflows/install.yaml) +[![Installation](https://github.com/NextGenCMB/delensalot/actions/workflows/install_matrix.yaml/badge.svg)](https://github.com/NextGenCMB/delensalot/actions/workflows/install_matrix.yaml) +[![Smoke test](https://github.com/NextGenCMB/delensalot/actions/workflows/smoke_test.yaml/badge.svg)](https://github.com/NextGenCMB/delensalot/actions/workflows/smoke_test.yaml) [![Documentation Status](https://readthedocs.org/projects/delensalot/badge/?version=latest)](https://delensalot.readthedocs.io/en/latest/?badge=latest) -[![Integration filter](https://github.com/NextGenCMB/delensalot/actions/workflows/integration_filter.yaml/badge.svg?branch=sims&event=pull_request)](https://github.com/NextGenCMB/delensalot/actions/workflows/integration_filter.yaml) -[![Integration reconstruction](https://github.com/NextGenCMB/delensalot/actions/workflows/unit_reconstruction.yaml/badge.svg?branch=sims&event=pull_request)](https://github.com/NextGenCMB/delensalot/actions/workflows/integration_reconstruction.yaml) -[![Integration tutorial](https://github.com/NextGenCMB/delensalot/actions/workflows/integration_tutorial.yaml/badge.svg?branch=sims&event=pull_request)](https://github.com/NextGenCMB/delensalot/actions/workflows/integration_tutorial.yaml) [![arXiv](https://img.shields.io/badge/arXiv-2310.06729-red)](https://arxiv.org/abs/2310.06729) # delensalot Curved-sky optimal CMB lensing reconstruction and bias calculation. -Delensalot, in essence, takes an observed CMB map and returns an optimal estimate of the underlying lensing field. +Delensalot takes an observed CMB map and returns an optimal estimate of the underlying lensing field. If you use delensalot for your work, please consider citing the ApJ publication [CMB-S4: Iterative internal delensing and r constraints](https://iopscience.iop.org/article/10.3847/1538-4357/ad2351). ![noise comparison](res//deflectionnoisecomp.jpg) This figure shows the full sky optimal lensing potential reconstruction for various CMB observations in a 5 times 5 degree patch. The input lensing potential is shown in the leftmost figure. -## Features and supports +## Features * Curved-sky analysis - * anisotropic noise model support - * masked-sky support - * quadratic estimator (QE) implementation via Plancklens - * Mock data generation using e.g. lenspyx + * Anisotropic noise model support + * Masked-sky support + * Quadratic estimator (QE) implementation via Plancklens + * Mock data generation using lenspyx * Supports various estimators (TT, EE, BB, MV, EE+EB, ..) # Installation -Download the project, navigate to the root folder and execute the command, -``` -python setup.py install -``` - -Make sure that you have the latest `plancklens` and `lenpsyx`. - - -## Set up a jupyter-kernel with delensalot -You will need to install `jupyter` for the tutorials found in `first_steps/notebooks/`, and possibly an `ipykernel` to create a jupyter-kernel out of the environment in which you install `delensalot`. -To run the tutorials with a jupyter kernel, you will have to install delensalot in it. Assuming you are using conda for your package management, +Requires Python 3.9–3.12. First install the two dependencies that are not on PyPI: -``` -conda create --name delensalot -conda activate delensalot +```bash +pip install git+https://github.com/carronj/plancklens +pip install git+https://github.com/carronj/lenspyx ``` -Then, install your favourite packages, +> **Note:** building `plancklens` requires a Fortran compiler (`gfortran`). +> On macOS: `brew install gcc`. On Linux: `sudo apt-get install gfortran`. -``` -conda install pip, numpy +Then install delensalot: + +```bash +git clone https://github.com/NextGenCMB/delensalot.git +cd delensalot +pip install -e . ``` -Now, go to the delensalot directory, and install, including its requirements, +To verify your installation: -``` -cd -python3 -m pip install -r requirements . -python3 setup.py develop +```bash +python check_install.py ``` -Eventually, create your kernel using the environment at which you just installed all packages, -``` -python3 -m ipykernel install --user --name=delensalot -``` +## Setting up a conda environment -## Installation troubles +```bash +conda create --name delensalot python=3.11 +conda activate delensalot +conda install pip numpy -Frequent problems are - * `attrs`. If there are errors related to the metamodel, make sure you have `attrs` (not `attr`, which is a different package) installed and updated/upgraded (version 23.1.0 should do) - * `astropy`. If there are errors related to ducc0, chances are it's because of an old `astropy` installation. +pip install git+https://github.com/carronj/plancklens +pip install git+https://github.com/carronj/lenspyx -# Usage - -## parameter file -Check the first_steps/parameter_files/ and run any of them using, -``` -python3 .py +cd +pip install -e . ``` -## Run a configuration file +To use delensalot in Jupyter notebooks, add it as a kernel: -To run a configuration file ``, type in your favorite `bash`, -``` -python3 run.py -r +```bash +pip install ipykernel +python -m ipykernel install --user --name=delensalot ``` -delensalot supports MPI, +## Installation troubleshooting + +* **`attrs` errors** — make sure you have the `attrs` package (not `attr`, which is different): `pip install --upgrade attrs`. Version 23.1.0 or newer is required. +* **`astropy` / `ducc0` errors** — usually caused by an outdated `astropy`. Run `pip install --upgrade astropy`. +* **`plancklens` build fails** — make sure `gfortran` is installed (see above). +* **Still stuck?** — run `python check_install.py` for a full dependency report with fix hints. -``` -srun --nodes -n python3 run.py -r -``` -## interactive mode +# Usage -delensalot supports interactive mode. See `first_steps/notebooks/` for our tutorials. +## Interactive mode +See `first_steps/notebooks/` for tutorials. The minimal working example notebook `interactive_mwe.ipynb` is a good starting point. -## help +## Parameter files -Type `python3 run.py [-h]` for quickhelp, +```bash +python3 .py ``` -usage: run.py [-h] [-p NEW] [-r RESUME] [-s STATUS] [-purgehashs PURGEHASHS] -delensalot entry point. +See `first_steps/parameter_files/` for examples. + +## MPI / HPC -optional arguments: - -h, --help show this help message and exit - -r RESUME Absolute path to config file to run/resume. - -s STATUS Absolute path for the analysis to write a report. +delensalot supports MPI for parallelisation across simulation indices: +```bash +srun -n python3 run.py -r ``` # Dependencies - uses - * [Plancklens](https://github.com/carronj/plancklens) - * [lenspyx](https://github.com/carronj/lenspyx) - * [DUCC](https://github.com/mreineck/ducc) - -## Doc -Documentation may be found [HERE] +* [Plancklens](https://github.com/carronj/plancklens) +* [lenspyx](https://github.com/carronj/lenspyx) +* [DUCC](https://github.com/mreineck/ducc) +* numpy, scipy, healpy, astropy, attrs, psutil, logdecorator -## Use with HPC -`delensalot` can be computationally demanding. -We have parallelized the computations across the simulation index in most cases. Assuming you have MPI set up and `srun` is available, you can simply run MPI-supported `delensalot` via, - -``` -srun -MPI_paramX X -MPI_paramY Y python3 /run.py -r -``` +# Documentation -If you have troubles, your HPC-center can help. +Documentation can be found at [delensalot.readthedocs.io](https://delensalot.readthedocs.io). \ No newline at end of file From e968c950cbfb6433e876e3fdb72400299f97c594 Mon Sep 17 00:00:00 2001 From: sebastian-belkner Date: Tue, 19 May 2026 13:08:24 +0800 Subject: [PATCH 3/4] update --- README.md | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/README.md b/README.md index 07c5e9b0..59fe4853 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ ![delensalot logo](res/dlensalot2.PNG) -[![Installation](https://github.com/NextGenCMB/delensalot/actions/workflows/install_matrix.yaml/badge.svg)](https://github.com/NextGenCMB/delensalot/actions/workflows/install_matrix.yaml) +[![Installation](https://github.com/NextGenCMB/delensalot/actions/workflows/install.yaml/badge.svg)](https://github.com/NextGenCMB/delensalot/actions/workflows/install.yaml) [![Smoke test](https://github.com/NextGenCMB/delensalot/actions/workflows/smoke_test.yaml/badge.svg)](https://github.com/NextGenCMB/delensalot/actions/workflows/smoke_test.yaml) [![Documentation Status](https://readthedocs.org/projects/delensalot/badge/?version=latest)](https://delensalot.readthedocs.io/en/latest/?badge=latest) [![arXiv](https://img.shields.io/badge/arXiv-2310.06729-red)](https://arxiv.org/abs/2310.06729) @@ -42,12 +42,6 @@ cd delensalot pip install -e . ``` -To verify your installation: - -```bash -python check_install.py -``` - ## Setting up a conda environment ```bash From 321ebde6c15c875b1b48fcdcc7a1199f264c8d63 Mon Sep 17 00:00:00 2001 From: sebastian-belkner Date: Tue, 19 May 2026 13:13:53 +0800 Subject: [PATCH 4/4] ru --- .github/workflows/integration_filter.yaml | 29 ------------------ .github/workflows/integration_tutorial.yaml | 34 --------------------- .github/workflows/unit_reconstruction.yaml | 29 ------------------ 3 files changed, 92 deletions(-) delete mode 100644 .github/workflows/integration_filter.yaml delete mode 100644 .github/workflows/integration_tutorial.yaml delete mode 100644 .github/workflows/unit_reconstruction.yaml diff --git a/.github/workflows/integration_filter.yaml b/.github/workflows/integration_filter.yaml deleted file mode 100644 index 23fcab27..00000000 --- a/.github/workflows/integration_filter.yaml +++ /dev/null @@ -1,29 +0,0 @@ -name: Integration filter - -on: [pull_request] -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.9"] - - steps: - - uses: actions/checkout@v3 - - uses: mpi4py/setup-mpi@v1 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install numpy --user - python -m pip install --upgrade pip setuptools wheel --user - if [ -f requirements.txt ]; then pip install -r requirements.txt --user; fi - - name: install - run: | - pip install -e . - - name: test - run: | - python -m unittest tests.test_integration_filter.FS - python -m unittest tests.test_integration_filter.MS \ No newline at end of file diff --git a/.github/workflows/integration_tutorial.yaml b/.github/workflows/integration_tutorial.yaml deleted file mode 100644 index da00de79..00000000 --- a/.github/workflows/integration_tutorial.yaml +++ /dev/null @@ -1,34 +0,0 @@ -name: Integration tutorial - -on: [pull_request] -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.9"] - - steps: - - uses: actions/checkout@v3 - - uses: mpi4py/setup-mpi@v1 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install numpy --user - python -m pip install --upgrade pip setuptools wheel --user - if [ -f requirements.txt ]; then pip install -r requirements.txt --user; fi - - name: install - run: | - pip install -e . - - name: test - run: | - - python3 -m unittest tests.test_integration_tutorial.Tutorial.test_conf_mwe_applynoOBD - python3 -m unittest tests.test_integration_tutorial.Tutorial.test_conf_mwe_applyOBD - python3 -m unittest tests.test_integration_tutorial.Tutorial.test_conf_mwe_buildOBD - python3 -m unittest tests.test_integration_tutorial.Tutorial.test_conf_mwe_fastWF - python3 -m unittest tests.test_integration_tutorial.Tutorial.test_conf_mwe_fullsky - python3 -m unittest tests.test_integration_tutorial.Tutorial.test_conf_mwe_maskedsky \ No newline at end of file diff --git a/.github/workflows/unit_reconstruction.yaml b/.github/workflows/unit_reconstruction.yaml deleted file mode 100644 index cb4257a5..00000000 --- a/.github/workflows/unit_reconstruction.yaml +++ /dev/null @@ -1,29 +0,0 @@ -name: unit reconstruction - -on: [pull_request] - -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.9"] - - steps: - - uses: actions/checkout@v3 - - uses: mpi4py/setup-mpi@v1 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install numpy --user - python -m pip install --upgrade pip setuptools wheel --user - if [ -f requirements.txt ]; then pip install -r requirements.txt --user; fi - - name: install - run: | - pip install -e . - - name: test Full sky reconstruction on polarization. approximate Wiener-filter - run: | - python -m unittest tests.test_unit_reconstruction.FS.test_P_approx \ No newline at end of file