Skip to content

Total Component Trait - #18794

Merged
nstarman merged 11 commits into
astropy:mainfrom
preshanth:totalcomponent
Oct 31, 2025
Merged

nstarman merged 11 commits into
astropy:mainfrom
preshanth:totalcomponent

Conversation

@preshanth

Copy link
Copy Markdown
Contributor

…private api

Description

This pull request introduces the total component trait in cosmology. It currently has a private api which should be made public upon the implementation of a neutrinos trait class.

Fixes a part of #17150

  • By checking this box, the PR author has requested that maintainers do NOT use the "Squash and Merge" button. Maintainers should respect this when possible; however, the final decision is at the discretion of the maintainer that merges the PR.

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.

  • Do the proposed changes actually accomplish desired goals?
  • Do the proposed changes follow the Astropy coding guidelines?
  • Are tests added/updated as required? If so, do they follow the Astropy testing guidelines?
  • Are docs added/updated as required? If so, do they follow the Astropy documentation guidelines?
  • Is rebase and/or squash necessary? If so, please provide the author with appropriate instructions. Also see instructions for rebase and squash.
  • Did the CI pass? If no, are the failures related? If you need to run daily and weekly cron jobs as part of the PR, please apply the "Extra CI" label. Codestyle issues can be fixed by the bot.
  • Is a change log needed? If yes, did the change log check pass? If no, add the "no-changelog-entry-needed" label. If this is a manual backport, use the "skip-changelog-checks" label unless special changelog handling is necessary.
  • Is this a big PR that makes a "What's new?" entry worthwhile and if so, is (1) a "what's new" entry included in this PR and (2) the "whatsnew-needed" label applied?
  • At the time of adding the milestone, if the milestone set requires a backport to release branch(es), apply the appropriate "backport-X.Y.x" label(s) before merge.

@github-actions

Copy link
Copy Markdown
Contributor

👋 Thank you for your draft pull request! Do you know that you can use [ci skip] or [skip ci] in your commit messages to skip running continuous integration tests until you are ready?

@preshanth

Copy link
Copy Markdown
Contributor Author

@nstarman I think this should be private api until we have a refactored trait class Onu. Also I am thinking of creating an issue and creating some tests for these traits. I am also thinking another issue to show example of using it for example create a notebook for matter dominated universe or radiation dominated universe lets say and such. That is the goal of the trait refactoring right ?

@preshanth
preshanth marked this pull request as ready for review October 28, 2025 19:03
@preshanth
preshanth requested a review from a team as a code owner October 28, 2025 19:03
@preshanth
preshanth requested a review from nstarman October 28, 2025 19:03
@nstarman nstarman moved this from Triage to In Progress in Cosmology, the Expansion Oct 29, 2025

@nstarman nstarman left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think it can be made public! Since the components cannot be known a priori, it's best to make this abstract and defer to the subclass.

Comment thread astropy/cosmology/_src/flrw/base.py Resolved
Comment thread astropy/cosmology/_src/flrw/base.py Resolved
@github-project-automation github-project-automation Bot moved this from In Progress to Review in progress in Cosmology, the Expansion Oct 29, 2025
Comment thread astropy/cosmology/_src/flrw/base.py Resolved
@nstarman nstarman added this to the v7.2.0 milestone Oct 29, 2025
@nstarman

nstarman commented Oct 29, 2025 •

Copy link
Copy Markdown
Member

Thanks! In the traits.rst can you add an example of Otot being called?

@preshanth

Copy link
Copy Markdown
Contributor Author

Done as suggested.

@preshanth
preshanth requested a review from nstarman October 29, 2025 20:24

@nstarman nstarman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I like how this is shaping up.

Comment thread docs/cosmology/traits.rst Resolved
Comment thread docs/cosmology/traits.rst Resolved
@preshanth
preshanth requested a review from a team as a code owner October 30, 2025 00:06
@nstarman

Copy link
Copy Markdown
Member

@preshanth, instead of merging in main, it's often better to do a rebase.

@preshanth

Copy link
Copy Markdown
Contributor Author

I have been rebasing. I did a merge by mistake. My apologies

@nstarman nstarman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

One small nitpick, otherwise LGTM. Thanks @preshanth!

Comment thread docs/cosmology/traits.rst Resolved
@github-project-automation github-project-automation Bot moved this from Review in progress to Reviewer approved in Cosmology, the Expansion Oct 30, 2025
Comment thread docs/cosmology/traits.rst
... self.Ok0 = 0.0
... self.Tcmb0 = u.Quantity(Tcmb0, "K")
... self.Ogamma0 = Ogamma0 # Photon density parameter
... self.is_flat = bool(abs(self.Otot0 - 1.0) < 1e-12)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You want me to remove these ? Also because of the rebase it thinks all commits are new and wants another review from you. My apologies for the mess up

@nstarman

Copy link
Copy Markdown
Member

@preshanth can you rebase / delete the commits that got picked up by merges? E.g. fb600f6

@preshanth

Copy link
Copy Markdown
Contributor Author

I just did. Hope it fixed it.

@nstarman
nstarman enabled auto-merge (squash) October 31, 2025 16:26
@nstarman
nstarman merged commit 7467961 into astropy:main Oct 31, 2025
4 checks passed
@github-project-automation github-project-automation Bot moved this from Reviewer approved to Done in Cosmology, the Expansion Oct 31, 2025
@preshanth
preshanth deleted the totalcomponent branch October 31, 2025 17:42
@nstarman nstarman mentioned this pull request Nov 11, 2025
12 of 22 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants