Skip to content

Generic module to include baryonic effects#1252

Open
sambit-giri wants to merge 5 commits into
LSSTDESC:masterfrom
sambit-giri:master
Open

Generic module to include baryonic effects#1252
sambit-giri wants to merge 5 commits into
LSSTDESC:masterfrom
sambit-giri:master

Conversation

@sambit-giri
Copy link
Copy Markdown

This pull request contains a custom class (BaryonCustom) to add baryonic effects from any framework. This class takes the suppression or boost data and creates an interpolator.

@damonge damonge closed this Jan 13, 2026
@damonge damonge reopened this Jan 13, 2026
Copy link
Copy Markdown
Collaborator

@damonge damonge left a comment

Choose a reason for hiding this comment

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

With many apologies for the delay, here's a review.

In addition to the comments below, flake8 is currently failing.

Comment thread pyccl/baryons/baryons_custom.py
Comment thread pyccl/baryons/baryons_custom.py Outdated
Comment thread pyccl/baryons/baryons_custom.py Outdated
Comment thread pyccl/baryons/baryons_custom.py
@coveralls
Copy link
Copy Markdown

coveralls commented Jan 13, 2026

Coverage Report for CI Build 24191658979

Coverage decreased (-0.4%) to 97.061%

Details

  • Coverage decreased (-0.4%) from the base build.
  • Patch coverage: 29 uncovered changes across 1 file (13 of 42 lines covered, 30.95%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
pyccl/baryons/baryons_custom.py 41 12 29.27%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 6838
Covered Lines: 6637
Line Coverage: 97.06%
Coverage Strength: 4.85 hits per line

💛 - Coveralls

@sambit-giri sambit-giri requested a review from damonge March 18, 2026 15:08
@sambit-giri
Copy link
Copy Markdown
Author

Apologies for the delayed response! I've addressed all the review comments:

  • Fixed the boost_data docstring to specify the expected array shape and axis ordering.
  • Fixed the update_parameters docstring to list the correct parameters.
  • Simplified the array-dimension logic in boost_factor using the np.squeeze pattern (as in nfw.py).
  • Also fixed a bug in update_parameters where the interpolator was being rebuilt using the local (potentially None) arguments instead of self.boost_data, self.k_data, and self.a_data.

Please let me know if anything else needs changing.

@damonge
Copy link
Copy Markdown
Collaborator

damonge commented Apr 9, 2026

@sambit-giri looks great! Could we add one unit test to check that this is doing the right thing?
You can see a few examples here: https://github.com/LSSTDESC/CCL/blob/master/pyccl/tests/test_baryons_vd19.py

In this case this could be extremely simple (just checking that you recover the arrays you put in when you query the boost factor, for example).

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.

3 participants