Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Baryons objects as convenience input for Cosmology #1113

Merged
merged 4 commits into from
Jul 28, 2023
Merged

Conversation

damonge
Copy link
Collaborator

@damonge damonge commented Jul 24, 2023

This implements, as discussed in the last CCL telecon, the possibility to pass baryonic effects objects as part of the cosmology initialisation. This is a convenience feature, so users can just keep using Cosmology objects as containers for the non-linear matter power spectrum, which now can include baryonic effects.

@coveralls
Copy link

coveralls commented Jul 24, 2023

Pull Request Test Coverage Report for Build 5694186616

  • 7 of 7 (100.0%) changed or added relevant lines in 1 file are covered.
  • 12 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.004%) to 97.446%

Files with Coverage Reduction New Missed Lines %
pyccl/cosmology.py 1 99.49%
pyccl/boltzmann.py 11 95.32%
Totals Coverage Status
Change from base Build 5625195580: 0.004%
Covered Lines: 5685
Relevant Lines: 5834

💛 - Coveralls

Copy link
Collaborator

@elisachisari elisachisari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working well for me. Some small suggestions.
I don't see files for the docs except the cosmicemu one - did you recompile the docs?

pyccl/tests/test_baryons.py Outdated Show resolved Hide resolved
pyccl/cosmology.py Outdated Show resolved Hide resolved
pyccl/cosmology.py Outdated Show resolved Hide resolved
pyccl/cosmology.py Show resolved Hide resolved
pyccl/tests/test_baryons.py Show resolved Hide resolved
@damonge
Copy link
Collaborator Author

damonge commented Jul 28, 2023

@elisachisari @tilmantroester back to you. I think the main question mark is whether we keep "bcm" as a convenient option or just remove it completely (since it's not much harder than passing ccl.baryons.BaryonsSchneider15().

@marcpaterno
Copy link

While I’m somewhat late to the game, I think having a default-initialized ccl.baryons.BaryonsSchneider15 object is clearer than having a string with a special value in the interface is clearer, and easier to search for with tools like an IDE or even grep.

@damonge
Copy link
Collaborator Author

damonge commented Jul 28, 2023

Thanks @marcpaterno , but to be clear, the default here will be None (meaning no baryonic effects correction)

@tilmantroester
Copy link
Contributor

This might be a more general idea than what's covered in this PR but would it make sense to allow the baryons object to be more general than the baryons.Baryons API? What I have in mind is having something like a HMCode2020Params class that could be passed to the baryons argument to Cosmology and which internally sets the extra_parameters that get passed to CAMB. This HMCode2020Params wouldn't have the include_baryonic_effects API but would allow a consistent use of the Cosmology API for HMCode2020 baryons.

Copy link
Collaborator

@elisachisari elisachisari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we remove the 'bcm' option I think we are then done.

@damonge
Copy link
Collaborator Author

damonge commented Jul 28, 2023

OK, thanks all. The proposal is then:
a) the default value of baryonic_effects is None, which means "do not apply any baryonic effects".
b) the only other option is a Baryons object. No 'bcm' option (users need to instantiate the corresponding Schneider15 class).

All happy?

@marcpaterno
Copy link

I like this solution.

@damonge
Copy link
Collaborator Author

damonge commented Jul 28, 2023

Alright, done!

@damonge damonge merged commit 5022b89 into master Jul 28, 2023
4 checks passed
@damonge damonge deleted the baryons_in_cosmo branch July 28, 2023 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants