Skip to content

FKEM Non-Limber refactor#1281

Merged
carlosggarcia merged 8 commits intomasterfrom
FKEM_Refactor
Mar 3, 2026
Merged

FKEM Non-Limber refactor#1281
carlosggarcia merged 8 commits intomasterfrom
FKEM_Refactor

Conversation

@paulrogozenski
Copy link
Contributor

@paulrogozenski paulrogozenski commented Feb 25, 2026

Refactor of FKEM Non-Limber algorithm, aimed at

  • Increasing the readability of the code
  • Modularizing to reduce repeated, identical code structures
  • Moving to a dedicated folder for future non-Limber module implementations
  • Adding cosmology dependence to integral caching to avoid cache edge-effects
  • Enforcing upper-limit of integral caching to reduce the memory consumption of large chains
  • Adding unit tests
  • Revising benchmark test to include shape/shot noise in covariance computation
  • Fixing 'auto' methodology to make sure switch to Limber is applicable for all tracers in the tracer collection

…hape/shot noise terms to benchamrk calculations. Removed redundant calculations and added some additional unit tests to catch warnings.
…d FKEM to cache cosmo object and to test individual tracer combinations for "auto" setting instead of total combination.
@carlosggarcia
Copy link
Collaborator

@damonge, moving _nonlimberFKEM into nonlimber._nonlimberFKEM is technically breaking the API. However, this module seems to be private. Opinion?

Copy link
Collaborator

@carlosggarcia carlosggarcia left a comment

Choose a reason for hiding this comment

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

Great work. Some comments/questions to address while we decide what we do with the (private) API change.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 22635547529

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 158 of 165 (95.76%) changed or added relevant lines in 5 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.02%) to 97.446%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pyccl/tracers.py 19 20 95.0%
pyccl/nonlimber/_nonlimber_FKEM.py 135 141 95.74%
Files with Coverage Reduction New Missed Lines %
pyccl/cosmology.py 1 99.52%
Totals Coverage Status
Change from base Build 21003793779: -0.02%
Covered Lines: 6601
Relevant Lines: 6774

💛 - Coveralls

@damonge
Copy link
Collaborator

damonge commented Mar 3, 2026

@carlosggarcia I wouldn't worry about that kind of API breakage, to be honest. Not worth wasting time on that. Is the idea that we will want to implement other non-Limber methods?

@carlosggarcia
Copy link
Collaborator

Ok. So let's merge it.

Yes, the idea behind this change of structure is to leave room for new non-limber methods. @nikosarcevic and @paulrogozenski can say more.

@carlosggarcia carlosggarcia merged commit 14e0752 into master Mar 3, 2026
21 of 34 checks passed
@carlosggarcia
Copy link
Collaborator

carlosggarcia commented Mar 3, 2026

For the record. I forgot to mark it as approved it but I approved it.

Also, the errors were due to being too slow to push to coveralls, which had already sent a report back for those jobs that had already finished. And the lower coverage I believe it was due to a misestimation due to merging main, instead of rebasing.

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.

4 participants