Skip to content

Commit

Permalink
Merge pull request #88 from joezuntz/cosmosis3-changes
Browse files Browse the repository at this point in the history
CosmoSIS 3 changes
  • Loading branch information
joezuntz authored Jul 28, 2023
2 parents 6f9bdfc + 3b739b8 commit a014a83
Show file tree
Hide file tree
Showing 38 changed files with 2,714 additions and 59 deletions.
26 changes: 21 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:

- name: Install dependencies with conda
shell: bash -l {0}
run: mamba install -c conda-forge cosmosis "numpy<1.24" cosmosis-build-standard-library
run: mamba install -c conda-forge "cosmosis>=3.0.1" cosmosis-build-standard-library

- name: Build standard library
shell: bash -l {0}
Expand Down Expand Up @@ -215,7 +215,6 @@ jobs:
apt-get-test:
runs-on: ubuntu-20.04
strategy:
Expand Down Expand Up @@ -258,9 +257,9 @@ jobs:
- name: Install python dependencies
run: |
python -m pip install --upgrade pip wheel setuptools
pip install cosmosis
pip install "cosmosis>=3.0.1"
pip install -v --no-cache-dir --no-binary=mpi4py,camb mpi4py camb
pip install fitsio astropy fast-pt Cython
pip install fitsio astropy fast-pt "Cython<3.0" jupyter
- name: Build
run: |
Expand All @@ -279,6 +278,17 @@ jobs:
source .github/ci-setup.sh
python -c "import camb"
- name: Test campaign commands
shell: bash -l {0}
run: |
source .github/ci-setup.sh
cosmosis-campaign -l examples/des-campaign.yml | tee output/campaign.log
grep -e "mira-titan" campaign.log
grep -e "fiducial" campaign.log
cosmosis-campaign --run fiducial-test-only examples/des-campaign.yml
cosmosis-campaign examples/des-campaign.yml --status fiducial-test-only > output/campaign.log
grep -e "🟢 fiducial-test-only" output/campaign.log
cosmosis-campaign examples/des-campaign.yml --status
- name: Demo 2 Planck 2018 Likelihood
run: |
Expand All @@ -287,10 +297,16 @@ jobs:
cosmosis-postprocess demos/demo2.ini -o output/demo2
test -f output/demo2/comoving_distance.png
- name: Demo 9 Low-Resolution Multinest
run: |
source .github/ci-setup.sh
cosmosis demos/demo9.ini -p multinest.live_points=100
cosmosis-postprocess output/demo9.txt -o output/demo9
test -f output/demo9/2D_supernova_params--deltam_cosmological_parameters--omega_m.png
- name: ExampleNotebook
shell: bash -l {0}
run: |
source cosmosis-configure
rm -f output/pantheon.txt
jupyter nbconvert --to notebook --execute "examples/example.ipynb"
3 changes: 1 addition & 2 deletions demos/chaining.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
; The emcee sampler, which uses the Goodman & Weare algorithm
sampler = emcee
; metropolis
verbosity = quiet


[emcee]
Expand Down Expand Up @@ -30,7 +31,6 @@ nsteps = 50
[output]
filename = demo5.txt
format = text
verbosity= debug

[pipeline]
; We use two likelihoods, the JLA (for high redshift) and
Expand All @@ -40,7 +40,6 @@ modules = consistency camb jla riess11
values = demos/values5.ini
extra_output =
likelihoods = jla riess
quiet=T
debug=F
timing=F

Expand Down
2 changes: 1 addition & 1 deletion demos/demo1.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
; The test sampler just runs a single parameter set
sampler = test
root = ${PWD}
verbosity = standard

[test]
; These are the parameters for this sampler.
Expand All @@ -24,7 +25,6 @@ values = demos/values1.ini
; Not used here, becuase we are not sampling
likelihoods =
extra_output =
quiet=F
debug=T
timing=F

Expand Down
3 changes: 1 addition & 2 deletions demos/demo10.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[runtime]
; changed sampler from test to grid
sampler = grid
verbosity = standard

[grid]
;parameters for grid are here
Expand All @@ -19,8 +20,6 @@ values = demos/values10.ini
likelihoods = cfhtlens
extra_output =

; We can get a little more output during the run by setting some values
quiet=F
timing=F
debug=F

Expand Down
3 changes: 1 addition & 2 deletions demos/demo12.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[runtime]
sampler = test

verbosity = standard

[test]
save_dir=output/demo12
Expand All @@ -13,7 +13,6 @@ values = demos/values12.ini
likelihoods = evs
priors = demos/priors12.ini
extra_output =
quiet=T
debug=T
timing=F

Expand Down
4 changes: 1 addition & 3 deletions demos/demo13.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
;it's still useful

sampler = snake

verbosity = quiet

[snake]
; Snake tries to explore at most 5 log-like points away from the peak
Expand All @@ -25,7 +25,6 @@ nsample_dimension = 20
[output]
filename = output/demo13.txt
format = text
verbosity= debug

[pipeline]
; We use two likelihoods, the JLA (for high redshift) and
Expand All @@ -35,7 +34,6 @@ modules = consistency camb jla riess11
values = demos/values13.ini
extra_output = likelihoods/jla_like
likelihoods = jla riess
quiet=T
debug=F
timing=F

Expand Down
2 changes: 1 addition & 1 deletion demos/demo15.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
; Demonstrate the different angular two-point functions in the standard library
[runtime]
sampler = test
verbosity = standard

[test]
save_dir=output/demo15
Expand All @@ -12,7 +13,6 @@ values = demos/values15.ini
; Not used here, becuase we are not sampling
likelihoods =
extra_output =
quiet=F
debug=T
timing=F

Expand Down
2 changes: 1 addition & 1 deletion demos/demo19.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
; The test sampler just runs a single parameter set
sampler = grid
root = .
verbosity = standard

[grid]
nsample_dimension=50
Expand Down Expand Up @@ -32,7 +33,6 @@ values = demos/values19.ini
; Not used here, becuase we are not sampling
likelihoods = he0435
extra_output =
quiet=T
debug=F
timing=F

Expand Down
2 changes: 1 addition & 1 deletion demos/demo3.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[runtime]
sampler = grid
verbosity = standard

[grid]
; The number of samples to take in each
Expand All @@ -9,7 +10,6 @@ nsample_dimension = 25
[pipeline]
modules = consistency camb bicep2
values = demos/values3.ini
quiet = F


[output]
Expand Down
3 changes: 1 addition & 2 deletions demos/demo5.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
; The emcee sampler, which uses the Goodman & Weare algorithm
sampler = emcee
root = ${PWD}
verbosity = quiet

[emcee]
; The emcee sampler uses the concept of walkers, a collection
Expand All @@ -22,7 +23,6 @@ nsteps = 100
[output]
filename = output/demo5.txt
format = text
verbosity= debug

[pipeline]
; We use two likelihoods, the JLA (for high redshift) and
Expand All @@ -31,7 +31,6 @@ verbosity= debug
modules = consistency camb jla riess11
values = demos/values5.ini
extra_output =
quiet=T
debug=F
timing=F

Expand Down
2 changes: 1 addition & 1 deletion demos/demo6.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[runtime]
; The test sampler just runs a single parameter set
sampler = test
verbosity = standard

[test]
save_dir=output/demo6
Expand All @@ -25,7 +26,6 @@ likelihoods = cfhtlens
extra_output =

; We can get a little more output during the run by setting some values
quiet=F
timing=T
debug=T

Expand Down
4 changes: 1 addition & 3 deletions demos/demo7.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[runtime]
; We use the grid sampler, as in demo 3. But this time we go over 2 dimensions.
sampler = grid

verbosity = quiet

[grid]
; We do a 20 x 20 grid for a total of 400 points
Expand All @@ -14,7 +14,6 @@ nstep = 100
[output]
filename = output/demo7.txt
format = text
verbosity= debug

[pipeline]
; We use one likelihood, the boss likelihood which uses growth parameters
Expand All @@ -23,7 +22,6 @@ modules = growthfunction boss
values = demos/values7.ini
likelihoods = boss
extra_output =
quiet=T
debug=F
timing=F

Expand Down
2 changes: 1 addition & 1 deletion demos/demo8.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[runtime]
; The test sampler just runs a single parameter set
sampler = test
verbosity = standard

[test]
save_dir=output/demo8
Expand All @@ -15,7 +16,6 @@ values = demos/values8.ini
; Not used here, becuase we are not sampling
likelihoods =
extra_output =
quiet=F
debug=T
timing=F

Expand Down
5 changes: 1 addition & 4 deletions demos/demo_abc.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
; The test sampler just runs a single parameter set
sampler = abc
root = .
verbosity = quiet

[abc]
;For a given set of parameters the ABC
Expand All @@ -26,7 +27,6 @@ ngauss = 4
[output]
filename = demo_abc.txt
format = text
verbosity= debug

[test]
; These are the parameters for this sampler.
Expand All @@ -49,9 +49,6 @@ values = demos/values_abc.ini
; Not used here, becuase we are not sampling
likelihoods = abc_multigauss
extra_output =
;ABC sampler runs the pipeline many times over before parameters
;are accepted, best to set quiet = T
quiet=T
debug=F
timing=F

Expand Down
3 changes: 1 addition & 2 deletions demos/metropolis.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[runtime]
; The emcee sampler, which uses the Goodman & Weare algorithm
sampler = metropolis
verbosity = quiet

[metropolis]
samples = 20000
Expand All @@ -11,7 +12,6 @@ random_start = F
[output]
filename = demo_mcmc.txt
format = text
verbosity= debug

[pipeline]
; We use two likelihoods, the JLA (for high redshift) and
Expand All @@ -21,7 +21,6 @@ modules = consistency camb jla riess11
values = demos/values5.ini
extra_output =
likelihoods = jla riess
quiet=T
debug=F
timing=F

Expand Down
2 changes: 1 addition & 1 deletion demos/mocks.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
; The test sampler just runs a single parameter set
sampler = test
root = .
verbosity = standard

[test]
; These are the parameters for this sampler.
Expand All @@ -24,7 +25,6 @@ values = demos/values1.ini
; Not used here, becuase we are not sampling
likelihoods =
extra_output =
quiet=F
debug=T
timing=F

Expand Down
2 changes: 1 addition & 1 deletion examples/act-dr6-lens.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
sampler = test
root = ${PWD}
resume = T
verbosity = noisy

[test]
save_dir=output/act_dr6_lens
Expand All @@ -22,7 +23,6 @@ nsteps = 5
modules = consistency camb act_dr6_lens
values = examples/act-dr6-lens-values.ini
priors = examples/act-dr6-lens-priors.ini
quiet=F
debug=F
timing=F
extra_output=cosmological_parameters/sigma_8 cosmological_parameters/omega_m
Expand Down
3 changes: 1 addition & 2 deletions examples/bao.ini
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
[runtime]
sampler = test

verbosity = quiet


; WARNING: Some of these likelihoods have data in common.
; You shouldn't use them all in a real pipeline - this is just for testing
[pipeline]
modules = consistency camb 6dfgs_1 6dfgs_2 6dfgs_3 6dfgs_4 boss_0 boss_1 boss_dr12_0 boss_dr12_1 eboss_lrg eboss_lya des_y3_bao_1 des_y3_bao_2 des_y3_bao_3 des_y3_bao_4 eboss16_boss_0 eboss16_boss_1 eboss16_elg_0 eboss16_elg_1 eboss16_lrg_0 eboss16_lrg_1 eboss16_lya eboss16_mgs eboss16_qso_0 eboss16_qso_1 mgs wigglez
quiet=T
timing=F
debug=F
values = examples/bao-values.ini
Expand Down
Loading

0 comments on commit a014a83

Please sign in to comment.