Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/SSC_fsky' into SSC_…
Browse files Browse the repository at this point in the history
…fsky
  • Loading branch information
paulrogozenski committed Nov 26, 2024
2 parents 4f0ec83 + ffe8f8b commit 72a39e3
Show file tree
Hide file tree
Showing 14 changed files with 48 additions and 436 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
145 changes: 0 additions & 145 deletions Untitled.ipynb

This file was deleted.

Binary file removed disk_fsky_04.fits
Binary file not shown.
5 changes: 3 additions & 2 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
- 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
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
16 changes: 9 additions & 7 deletions tests/test_covariance_fourier_gaussian_nmt.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,16 +389,18 @@ def test_get_cl_for_cov(cov_fg_nmt):

with pytest.raises(ValueError):
cov_fg_nmt.get_cl_for_cov(
cl_fid_Sh, cl["nl_cp"], m, m, w, nl_is_cp=True
cl_fid_Sh["cl"], cl["nl_cp"], m, m, w, nl_is_cp=True
)

with pytest.raises(ValueError):
# Uncoupled binned noise
cov_fg_nmt.get_cl_for_cov(cl_fid, cl["nl"], m, m, w, nl_is_cp=True)
cov_fg_nmt.get_cl_for_cov(
cl_fid["cl"], cl["nl"], m, m, w, nl_is_cp=True
)

with pytest.raises(ValueError):
cov_fg_nmt.get_cl_for_cov(
cl_fid, cl["nl_cp"], m, m, wSh, nl_is_cp=True
cl_fid["cl"], cl["nl_cp"], m, m, wSh, nl_is_cp=True
)


Expand Down Expand Up @@ -662,7 +664,7 @@ def test_get_covariance_block_cache(cov_fg_nmt, tracer_comb1, tracer_comb2):

@pytest.mark.parametrize(
"kwargs",
[{}, {"l_toeplitz": 10, "l_exact": 10, "dl_band": 10, "n_iter": 0}],
[{}, {"l_toeplitz": 10, "l_exact": 10, "dl_band": 10}],
)
def test_get_covariance_workspace(cov_fg_nmt, kwargs):
m1 = get_mask_from_dtype("galaxy_clustering")
Expand Down Expand Up @@ -715,7 +717,7 @@ def test_get_covariance_workspace(cov_fg_nmt, kwargs):
# Check only the first is written/computed created & that cw is correct

for fields, masks_names in zip(combinations, combinations_names):
spins = [fi.fl.spin for fi in fields]
spins = [fi.spin for fi in fields]
cw_code = cov_fg_nmt.get_covariance_workspace(
*fields, *masks_names, **kwargs
)
Expand Down Expand Up @@ -967,7 +969,7 @@ def get_data_types(self):

@pytest.mark.parametrize(
"kwargs",
[{}, {"l_toeplitz": 10, "l_exact": 10, "dl_band": 10, "n_iter": 0}],
[{}, {"l_toeplitz": 10, "l_exact": 10, "dl_band": 10}],
)
def test_get_workspace(cov_fg_nmt, kwargs):
# Compute NmtBins
Expand Down Expand Up @@ -1030,7 +1032,7 @@ def test_get_workspace(cov_fg_nmt, kwargs):

@pytest.mark.parametrize(
"kwargs",
[{}, {"l_toeplitz": 10, "l_exact": 10, "dl_band": 10, "n_iter": 0}],
[{}, {"l_toeplitz": 10, "l_exact": 10, "dl_band": 10}],
)
def test_get_workspace_dict(cov_fg_nmt, kwargs):
tracers = get_tracers_dict_for_cov()
Expand Down
Loading

0 comments on commit 72a39e3

Please sign in to comment.