Skip to content

gh-510: Method sigma8_0 failing on repeated calls for HMemu perturbations#535

Open
NastassiaG wants to merge 1 commit into
mainfrom
510-fix-sigma8_0-for-hmemu-perturbations
Open

gh-510: Method sigma8_0 failing on repeated calls for HMemu perturbations#535
NastassiaG wants to merge 1 commit into
mainfrom
510-fix-sigma8_0-for-hmemu-perturbations

Conversation

@NastassiaG
Copy link
Copy Markdown
Collaborator

🚀 Pull Request Checklist

✅ Summary

This PR modifies the self.sigma8_0() method in HMemuNonLinearPerturbations to avoid failure on repeated calls. It is also adding the same method to HMemuLinearPerturbations, where it is currently missing.

🔄 Changes

  • HMemuNonLinearPerturbations: Renaming the instance attribute self.sigma8_0 assigned inside the method self.sigma8_0() to self.sigma8; this avoids the method being shadowed by an array (causing failure on repeated calls).
  • HMemuLinearPerturbations: Implementing the missing self.sigma8_0() method by reusing the updated implementation from the nonlinear perturbations class.

🛠 How to Test

  1. Create instances of both HMemuLinearPerturbations and HMemuNonLinearPerturbations.
  2. Verify that the sigma8_0() method exists for both instances.
  3. Verify that, upon repeated calls, it yields the expected result with no exceptions raised.

See also screenshots below.

📝 Documentation

  • This PR updates documentation
  • This PR does not require documentation changes
  • Issue created for documentation update: Don't forget to link the task!

🏗 Related Issues

Resolves #510

📸 Screenshots (if applicable)

Before implementing changes:

Bildschirmfoto 2026-05-01 um 15 18 45

After implementing changes:

Bildschirmfoto 2026-05-15 um 09 22 46

✅ PR Checklist for Developers

  • I have titled this PR before merging as "gh-#:", where "#" represents the task it closes
  • I have run locally pre-commit using pre-commit run --all-files
  • I have tested my changes locally
  • No new warnings or errors introduced
  • I have updated documentation (if applicable)
  • My changes do not introduce breaking changes (i.e: the package still gets installed)
  • I have added unit tests (if applicable)
  • I have consistently updated the GitHub information for the project, including milestones, task types, and other relevant details.

✅ PR Checklist for Reviewers

  • The next PR targets the correct branch
  • CI tests have run and passed for the latest commit on the source branch
  • Check that the code can still be installed if new packages are imported
  • If necessary, the notebooks in the playground will be updated in a corresponding follow-up PR
  • Coverage percentage is retained or increased
  • Quality of new/changed code is acceptable
  • Quality of new/changed unit tests is acceptable
  • No data files have been included in the commits
  • Implementation follows the agreed task description point by point
  • Check that any added folder/file has been added to the README.md file
  • Check that the documentation has been updated accordantly
  • Check that the corresponding branch has been deleted after merging. If not, delete it

Renaming self.sigma8_0 array to self.sigma8 in the sigma8_0() method for HMemuNonLinearPerturbations; adding the sigma8_0() method for HMemuLinearPerturbations
@NastassiaG NastassiaG self-assigned this May 15, 2026
@NastassiaG NastassiaG added the bug Something isn't working label May 15, 2026
@NastassiaG NastassiaG linked an issue May 15, 2026 that may be closed by this pull request
@NastassiaG NastassiaG changed the title gh-#510 gh-#510: Method sigma8_0 failing on repeated calls for HMemu perturbations May 15, 2026
chiaramoretti added a commit that referenced this pull request May 16, 2026
@gcanasherrera gcanasherrera changed the title gh-#510: Method sigma8_0 failing on repeated calls for HMemu perturbations gh-510: Method sigma8_0 failing on repeated calls for HMemu perturbations May 18, 2026
@gcanasherrera
Copy link
Copy Markdown
Member

Hi @NastassiaG,

I was unable to reproduce your original reported bug, really. I've been running chains with this implementation for months now. Before we proceed with the review, could you specify a bit more what the issue could potentially be?

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Method sigma8_0 failing on repeated calls for HMemu perturbations

2 participants