Skip to content

Comments

Feature/baryons hmcode#1278

Open
nikosarcevic wants to merge 3 commits intomasterfrom
feature/baryons-hmcode-blueprint
Open

Feature/baryons hmcode#1278
nikosarcevic wants to merge 3 commits intomasterfrom
feature/baryons-hmcode-blueprint

Conversation

@nikosarcevic
Copy link
Contributor

In this PR I have ported out HMCode baryons into baryons module so it can be called in a similar manner to other baryon base modules.

To do so, I have used the existing hook to HMCode whihc is via camb call within the Cosmology object -- but wrapped in such a way that emulates the convention we want defined inside baryons_base.

One thing that was tricky is to ensure that the cosmology defined is always the cosmology object with camb BUT doing internal chekcs there is no baryonification already applied -- this is solved.

(side note: I can do the same for bacco and I think we should so that all of our baryon modules are called in the same way)

This PR adds:

  • utility/helper functions defined inside pyccl/baryons/mead20_hmcode/mead20_utils.py

  • pyccl/baryons/mead20.py which is the main script (kept pretty lightweight and readable) where BaryonsMead20 submodule is defined

  • corresponding unit tests

  • example notebooks (inside the pyccl/baryons/mead20_hmcode/ dir:

    • baryon_modules: a copy of the existing notebooks where we compare different baryon models available in ccl. i also compare the new Mead20 method to the "standard via Cosmology object" method
    • baryons_mead20.ipynb which just illustrates how to access different avaialble model parameters and how they impact the power spectrum

    locally unit tests are passing, linting is healthy

@coveralls
Copy link

Pull Request Test Coverage Report for Build 21349264080

Details

  • 155 of 163 (95.09%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.06%) to 97.408%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pyccl/baryons/mead20_hmcode/mead20_utils.py 88 96 91.67%
Totals Coverage Status
Change from base Build 21003793779: -0.06%
Covered Lines: 6727
Relevant Lines: 6906

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants