Skip to content

gh-1158: Add CosmologyWithGrowthFactor protocol#1163

Open
paddyroddy wants to merge 1 commit into
mainfrom
paddy/issue-1158
Open

gh-1158: Add CosmologyWithGrowthFactor protocol#1163
paddyroddy wants to merge 1 commit into
mainfrom
paddy/issue-1158

Conversation

@paddyroddy

@paddyroddy paddyroddy commented Jul 8, 2026

Copy link
Copy Markdown
Member

Description

Adds a CosmologyWithGrowthFactor protocol as growth_factor isn't used that often.

Closes: #1158

Changelog entry

Added: A CosmologyWithGrowthFactor protocol

Checks

  • Is your code passing linting?
  • Is your code passing tests?
  • Have you added additional tests (if required)?
  • Have you modified/extended the documentation (if required)?
  • Have you added a one-liner changelog entry above (if required)?

@paddyroddy
paddyroddy requested a review from Copilot July 8, 2026 10:53
@paddyroddy paddyroddy self-assigned this Jul 8, 2026
@paddyroddy paddyroddy added enhancement New feature or request science Science improvement or question needs-2-reviewers Could be considered "controversial" so worth a second pair of eyes labels Jul 8, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates GLASS’s cosmology typing to make the growth factor optional in the core Cosmology protocol, while still requiring it where it’s actually needed (the internal _kappa_ia_nla() intrinsic-alignment computation).

Changes:

  • Removed HasGrowthFactor from the base Cosmology protocol and introduced a CosmologyWithGrowthFactor protocol for the stricter requirement.
  • Updated _kappa_ia_nla() to accept CosmologyWithGrowthFactor and clarified the parameter documentation accordingly.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
glass/galaxies.py Narrows _kappa_ia_nla()’s cosmology type requirement to CosmologyWithGrowthFactor and updates the docstring.
glass/cosmology.py Removes growth factor from Cosmology and adds a new CosmologyWithGrowthFactor protocol.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread glass/cosmology.py
@paddyroddy
paddyroddy requested review from connoraird and ntessore July 8, 2026 11:54
@paddyroddy paddyroddy added the typing Static typing label Jul 8, 2026

@connoraird connoraird left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

_kappa_ia_nla isn't used in the repo and has been hidden. Can we instead just delete it and remove the growth factor from the Cosmology interface?

@paddyroddy

Copy link
Copy Markdown
Member Author

_kappa_ia_nla isn't used in the repo and has been hidden. Can we instead just delete it and remove the growth factor from the Cosmology interface?

Yes I know (#411)... @ntessore want it to stay. What we really need is some tests and for it be exposed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@paddyroddy
paddyroddy requested a review from connoraird July 14, 2026 12:32

@connoraird connoraird left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good

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

Labels

enhancement New feature or request needs-2-reviewers Could be considered "controversial" so worth a second pair of eyes science Science improvement or question typing Static typing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove HasGrowthFactor from Cosmology protocol

3 participants