Skip to content

Dark Energy Component Trait Class - #18447

Merged
nstarman merged 11 commits into
astropy:mainfrom
preshanth:darkenergy
Jul 20, 2025
Merged

nstarman merged 11 commits into
astropy:mainfrom
preshanth:darkenergy

Conversation

@preshanth

Copy link
Copy Markdown
Contributor

Description

This pull request is to introduce a trait class for dark energy as planned in the issue #17150 . The goal here is allow for users to create custom cosmologies using these traits.

Fixes a portion 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 July 18, 2025 20:34
@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.

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

@preshanth

Copy link
Copy Markdown
Contributor Author

Let me know when you are ready and I will push changes to the changelog and such. I was puzzled by the failures last time around as all tests pass locally.

@nstarman nstarman added this to the v7.2.0 milestone Jul 18, 2025
@nstarman nstarman moved this from Triage to In Progress in Cosmology, the Expansion Jul 18, 2025
@nstarman

Copy link
Copy Markdown
Member

On a bus, sry. limited connection.
The RTD error is coming from

/home/docs/checkouts/readthedocs.org/user_builds/astropy/conda/18447/lib/python3.13/site-packages/astropy/cosmology/_src/flrw/base.py:docstring of astropy.cosmology._src.flrw.base.FLRW:1: WARNING: py:class reference target not found: astropy.cosmology._src.traits.darkenergy.DarkEnergyComponent [ref.class]
[3698](https://app.readthedocs.org/projects/astropy/builds/28907193/#279028093--3698)	/home/docs/checkouts/readthedocs.org/user_builds/astropy/checkouts/18447/docs/<rst_epilog>:2: WARNING: py:class reference target not found: astropy.cosmology._src.traits.darkenergy.DarkEnergyComponent [ref.class]

@nstarman

Copy link
Copy Markdown
Member

@preshanth

Copy link
Copy Markdown
Contributor Author

I am on it. No rush please take your time. Will take me a bit to parse and get to the bottom of it.

Comment thread astropy/cosmology/_src/flrw/base.py Resolved
@preshanth

Copy link
Copy Markdown
Contributor Author

So while I fix the docs I want to know if you want this to be publicly exposed or make it an internal reference only class. I just need to put that into base.py so docs can find it or skip accordingly.

@nstarman

Copy link
Copy Markdown
Member

Since this has an internal check for inv_efunc I think it can be public! Long term we'll want to move that check from inside the method to a subclassing or initialization check, but for now it's fine.

@preshanth

Copy link
Copy Markdown
Contributor Author

@nstarman Any suggestions on how to improve the code coverage for traits testing ?

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

Looking great. I think one more thing.

Comment thread docs/cosmology/traits.rst Resolved
@preshanth

Copy link
Copy Markdown
Contributor Author

@nstarman The test failure is not related to the code here. Thanks for looking it over. If you are up for it. I have the angular distances as the next one.

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

Excellent. Thanks @preshanth for another great PR!

@github-project-automation github-project-automation Bot moved this from In Progress to Reviewer approved in Cosmology, the Expansion Jul 20, 2025
@nstarman
nstarman merged commit faa8f5e into astropy:main Jul 20, 2025
@github-project-automation github-project-automation Bot moved this from Reviewer approved to Done in Cosmology, the Expansion Jul 20, 2025
@preshanth
preshanth deleted the darkenergy branch July 21, 2025 00:54
@nstarman nstarman mentioned this pull request Oct 23, 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