Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/clustercount_cov_validation' int…
Browse files Browse the repository at this point in the history
…o clustercount_cov_validation
  • Loading branch information
AlessandraFumagalli committed Feb 7, 2025
2 parents 52365f7 + 6c8a7a8 commit 7a70295
Show file tree
Hide file tree
Showing 25 changed files with 1,599 additions and 81 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,21 @@ jobs:
use-mamba: true
activate-environment: tjpcov
miniforge-version: latest
miniforge-variant: Mambaforge

- name: Cache Date
id: get-date
run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT

- name: Check for cached environment
uses: actions/cache@v3
id: cache
env:
# Increase this value to reset cache if etc/example-environment.yml has not changed
CACHE_NUMBER: 0
with:
path: ${{env.CONDA}}/envs
key:
${{runner.os}}.${{runner.arch}}.mamba-py.${{matrix.python-version}}.${{hashFiles('pyproject.toml')}}.${{hashFiles('environment.yml')}}.${{steps.get-date.outputs.today}}.${{env.CACHE_NUMBER}}
# - name: Cache Date
# id: get-date
# run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
#
# - name: Check for cached environment
# uses: actions/cache@v3
# id: cache
# env:
# # Increase this value to reset cache if etc/example-environment.yml has not changed
# CACHE_NUMBER: 0
# with:
# path: ${{env.CONDA}}/envs
# key:
# ${{runner.os}}.${{runner.arch}}.mamba-py.${{matrix.python-version}}.${{hashFiles('pyproject.toml')}}.${{hashFiles('environment.yml')}}.${{steps.get-date.outputs.today}}.${{env.CACHE_NUMBER}}

- name: Install environment packages
if: steps.cache.outputs.cache-hit != 'true'
Expand All @@ -97,7 +96,7 @@ jobs:
pip install -U mpi4py --no-cache-dir --no-deps
- name: Run Tests
run: coverage run --source=tjpcov -m pytest -vv tests/
run: coverage run --source=tjpcov -m pytest -vv tests && coverage lcov

- name: Run MPI Tests (OpenMPI)
run: |
Expand All @@ -122,6 +121,7 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: run-${{ join(matrix.*, '-') }}
parallel: true
path-to-lcov: coverage.lcov

finish:
needs: tests
Expand Down
7 changes: 4 additions & 3 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ dependencies:
- pytest-rerunfailures
- coveralls
- numpy
- scipy
# - scipy
- scipy<1.12 # <1.12 to avoid bug in CCL<3.1 (not in pypy) with simpson integration
- pyyaml
- pyccl>=3.0.0
- pyccl>=3.2
- sacc>=0.12
- namaster
- namaster>2
- camb
- Jinja2
- healpy
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ classifiers = [
"Topic :: Scientific/Engineering :: Physics"
]
dependencies = [
"scipy",
"scipy<1.12", # <1.12 to avoid bug in CCL<3.1 (not in pypy) with simpson integration
"numpy",
"Jinja2",
"pyyaml",
Expand All @@ -47,13 +47,13 @@ doc = [
"sphinx-book-theme",
]
nmt = [
"pymaster>=1.4.0"
"pymaster>=2"
]
mpi = [
"mpi4py"
]
full = [
"pymaster>=1.4.0",
"pymaster>=2",
"mpi4py",
"sphinx",
"sphinx-autoapi",
Expand Down
65 changes: 65 additions & 0 deletions tests/data/conf_covariance_cNG.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
tjpcov:
# sacc input file
sacc_file: ./tests/benchmarks/32_DES_tjpcov_bm/cls_cov.fits

# 'set' from parameters OR pass CCL cosmology object OR yaml file
cosmo: 'set'

# Setting mask OR fsky approximation
mask_file:
DESgc__0: ./tests/benchmarks/32_DES_tjpcov_bm/catalogs/mask_DESgc__0.fits.gz
DESwl__0: ./tests/benchmarks/32_DES_tjpcov_bm/catalogs/DESwlMETACAL_mask_zbin0_ns32.fits.gz
DESwl__1: ./tests/benchmarks/32_DES_tjpcov_bm/catalogs/DESwlMETACAL_mask_zbin1_ns32.fits.gz

mask_names:
DESgc__0: mask_DESgc0
DESwl__0: mask_DESwl0
DESwl__1: mask_DESwl1

outdir: ./tests/tmp/

# Survey params:
# 5 lens bins
Ngal_DESgc__0: 26

Ngal_DESwl__0: 26
Ngal_DESwl__1: 26
# # constant bin sigma_e
sigma_e_DESwl__0: 0.26
sigma_e_DESwl__1: 0.26

# linear bias for lenses constant for redshift bin (example notebook)
bias_DESgc__0: 1.48

# IA: 0.5

parameters:
# Not used for while (read by ccl.cosmo):
Omega_c: 0.2640
Omega_b: 0.0493
h: 0.6736
n_s: 0.9649
sigma8: 0.8111
w0: -1
wa: 0
transfer_function: 'boltzmann_camb'
HOD:
# automatically creates massdef and concentration objects
log10Mmin_0: 12.0
log10Mmin_p: 0.0
siglnM_0: 0.4
siglnM_p: 0.0
log10M0_0: 7.0
log10M0_p: 0.0
log10M1_0: 13.3
log10M1_p: 0.0
alpha_0: 1.0
alpha_p: 0.0
fc_0: 1.0
fc_p: 0.0
bg_0: 1.0
bg_p: 0.0
bmax_0: 1.0
bmax_p: 0.0
a_pivot: 1.0
ns_independent: False
55 changes: 55 additions & 0 deletions tests/data/conf_covariance_cNG_fsky.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
tjpcov:
# sacc input file
sacc_file: ./tests/benchmarks/32_DES_tjpcov_bm/cls_cov.fits

# 'set' from parameters OR pass CCL cosmology object OR yaml file
cosmo: 'set'

outdir: ./tests/tmp/

# Survey params:
# 5 lens bins
Ngal_DESgc__0: 26

Ngal_DESwl__0: 26
Ngal_DESwl__1: 26
# # constant bin sigma_e
sigma_e_DESwl__0: 0.26
sigma_e_DESwl__1: 0.26

# linear bias for lenses constant for redshift bin (example notebook)
bias_DESgc__0: 1.48

# IA: 0.5
fsky: 0.05

parameters:
# Not used for while (read by ccl.cosmo):
Omega_c: 0.2640
Omega_b: 0.0493
h: 0.6736
n_s: 0.9649
sigma8: 0.8111
w0: -1
wa: 0
transfer_function: 'boltzmann_camb'
HOD:
# automatically creates massdef and concentration objects
log10Mmin_0: 12.0
log10Mmin_p: 0.0
siglnM_0: 0.4
siglnM_p: 0.0
log10M0_0: 7.0
log10M0_p: 0.0
log10M1_0: 13.3
log10M1_p: 0.0
alpha_0: 1.0
alpha_p: 0.0
fc_0: 1.0
fc_p: 0.0
bg_0: 1.0
bg_p: 0.0
bmax_0: 1.0
bmax_p: 0.0
a_pivot: 1.0
ns_independent: False
6 changes: 2 additions & 4 deletions tests/data/conf_covariance_calculator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,17 @@ NaMaster:
module: pymaster
f:
n_iter: 0
lmax_sht: -1
lmax: null
lmax_mask: null
w:
lmax_mask: -1
l_toeplitz: -1
l_exact: -1
dl_band: -1
n_iter: 3
recompute: True
cw:
l_toeplitz: -1
l_exact: -1
dl_band: -1
n_iter: 3
recompute: True

cache:
Expand Down
6 changes: 2 additions & 4 deletions tests/data/conf_covariance_calculator_mpi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,17 @@ NaMaster:
module: pymaster
f:
n_iter: 0
lmax_sht: -1
lmax: null
lmax_mask: null
w:
lmax_mask: -1
l_toeplitz: -1
l_exact: -1
dl_band: -1
n_iter: 3
recompute: True
cw:
l_toeplitz: -1
l_exact: -1
dl_band: -1
n_iter: 3
recompute: True

cache:
Expand Down
6 changes: 2 additions & 4 deletions tests/data/conf_covariance_gaussian_fourier_nmt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,17 @@ NaMaster:
module: pymaster
f:
n_iter: 0
lmax_sht: -1
lmax: null
lmax_mask: null
w:
lmax_mask: -1
l_toeplitz: -1
l_exact: -1
dl_band: -1
n_iter: 3
recompute: True
cw:
l_toeplitz: -1
l_exact: -1
dl_band: -1
n_iter: 3
recompute: True

parameters:
Expand Down
6 changes: 2 additions & 4 deletions tests/data/conf_covariance_gaussian_fourier_nmt_txpipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,17 @@ NaMaster:
module: pymaster
f:
n_iter: 0
lmax_sht: -1
lmax: null
lmax_mask: null
w:
lmax_mask: -1
l_toeplitz: -1
l_exact: -1
dl_band: -1
n_iter: 3
recompute: True
cw:
l_toeplitz: -1
l_exact: -1
dl_band: -1
n_iter: 3
recompute: True

parameters:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,17 @@ NaMaster:
module: pymaster
f:
n_iter: 0
lmax_sht: -1
lmax: null
lmax_mask: null
w:
lmax_mask: -1
l_toeplitz: -1
l_exact: -1
dl_band: -1
n_iter: 3
recompute: True
cw:
l_toeplitz: -1
l_exact: -1
dl_band: -1
n_iter: 3
recompute: True

parameters:
Expand Down
2 changes: 0 additions & 2 deletions tests/data/conf_covariance_gaussian_fsky_fourier.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,4 @@ tjpcov:
{% endfor %}

IA: 0.5

GaussianFsky:
fsky: 0.3
2 changes: 0 additions & 2 deletions tests/data/conf_covariance_gaussian_fsky_real.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ tjpcov:
{% endfor %}

IA: 0.5

GaussianFsky:
fsky: 0.3

ProjectedReal:
Expand Down
35 changes: 35 additions & 0 deletions tests/data/conf_covariance_ssc_fsky.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
tjpcov:
# sacc input file
sacc_file: ./tests/benchmarks/32_DES_tjpcov_bm/cls_cov.fits

# 'set' from parameters OR pass CCL cosmology object OR yaml file
cosmo: 'set'

outdir: ./tests/tmp/

# Survey params:
# 5 lens bins
Ngal_DESgc__0: 26

Ngal_DESwl__0: 26
Ngal_DESwl__1: 26
# # constant bin sigma_e
sigma_e_DESwl__0: 0.26
sigma_e_DESwl__1: 0.26

# linear bias for lenses constant for redshift bin (example notebook)
bias_DESgc__0: 1.48

# IA: 0.5
fsky: 0.05

parameters:
# Not used for while (read by ccl.cosmo):
Omega_c: 0.2640
Omega_b: 0.0493
h: 0.6736
n_s: 0.9649
sigma8: 0.8111
w0: -1
wa: 0
transfer_function: 'boltzmann_camb'
Loading

0 comments on commit 7a70295

Please sign in to comment.