Skip to content

Matter density as a trait - #18307

Merged
nstarman merged 7 commits into
astropy:mainfrom
preshanth:matter_density
Jun 21, 2025
Merged

nstarman merged 7 commits into
astropy:mainfrom
preshanth:matter_density

Conversation

@preshanth

Copy link
Copy Markdown
Contributor

Description

This pull request is to address the creation of a matter density trait. The goal here is to allow pedagogical models.

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.

@preshanth
preshanth requested a review from a team as a code owner June 18, 2025 17:47
@preshanth
preshanth requested a review from nstarman June 18, 2025 17:47
@preshanth
preshanth marked this pull request as draft June 18, 2025 17:48
@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.

@preshanth

preshanth commented Jun 18, 2025 •

Copy link
Copy Markdown
Contributor Author

@nstarman would you want me to move dark matter density and other related traits into this single class. I am happy to do that. I figured matter density was a good one to tackle before touching the energy densities.

@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.

Thanks @preshanth for the PR! Some comments.

Comment thread astropy/cosmology/_src/flrw/base.py Resolved
@github-project-automation github-project-automation Bot moved this from Triage to Review in progress in Cosmology, the Expansion Jun 19, 2025
@preshanth

Copy link
Copy Markdown
Contributor Author

I was wondering what you thought about having all the matter densities in one class. Include the dark matter here too.

@preshanth

Copy link
Copy Markdown
Contributor Author

I ask because I can compute dark matter density as matter - baryons and I can do that inside the MatterDensity class rather than have a separate one. I have nominally made a separate branch and moved the dark matter there too. I have moved the functions. If we agree on what formats. I am happy to do photon and dark energy along with distance measures next. I will leave the neutrinos to you.

@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.

This is looking really close. I haven't had time yet for a full review. This is a short comment.

@nstarman

Copy link
Copy Markdown
Member

I was wondering what you thought about having all the matter densities in one class. Include the dark matter here too.

I think it's best to keep them separate. We want to use these traits to build e.g. MatterOnlyCosmology, for which we should have only $\Omega_{m,0}$, $\Omega_{m}(z)$.

@nstarman nstarman added this to the v7.2.0 milestone Jun 21, 2025
@nstarman
nstarman marked this pull request as ready for review June 21, 2025 01:32

@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.

Thanks @preshanth. This looks great.

@github-project-automation github-project-automation Bot moved this from Review in progress to Reviewer approved in Cosmology, the Expansion Jun 21, 2025
@nstarman
nstarman merged commit e48dd1c into astropy:main Jun 21, 2025
@github-project-automation github-project-automation Bot moved this from Reviewer approved to Done in Cosmology, the Expansion Jun 21, 2025
@preshanth
preshanth deleted the matter_density branch June 26, 2025 04:08
@nstarman nstarman mentioned this pull request Oct 20, 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