joezuntz / cosmosis-standard-library

11 stars 31 forks source link

Imrprove consistency relations docs, allow adding extras #92

Closed itrharrison closed 1 year ago

itrharrison commented 1 year ago

This both adds more explicit documentation for the creation of a relations_file to the consistency module and adds the setup parameter extra_relations which allows you to add more relations as a comma separated list.

Merging will close #90

itrharrison commented 1 year ago

Draft until I have tested locally. Opened the PR to check the CI runs.

itrharrison commented 1 year ago

Verified locally that in demo1: extra_relations = omega_cdm=omega_c,omega_cold=omega_c,omega_weird=omega_c*omega_m*100 gives:

(Pdb) block[cosmo, 'omega_c']
0.2741
(Pdb) block[cosmo, 'omega_cdm']
0.2741
(Pdb) block[cosmo, 'omega_cold']
0.2741
(Pdb) block[cosmo, 'omega_weird']
8.609480999999999
(Pdb) block[cosmo, 'omega_c']*block[cosmo, 'omega_m']*100
8.609480999999999
joezuntz commented 1 year ago

I've done a few tweaks here. The module file needs a particular format to generate the doc pages. I added a test in the CI. And I put in a "replace" to allow whitespace. Thanks for giving me push permission!