Skip to content

Add Einasto potential#760

Merged
jobovy merged 4 commits intojobovy:mainfrom
johnwez1:potential/einasto
Nov 3, 2025
Merged

Add Einasto potential#760
jobovy merged 4 commits intojobovy:mainfrom
johnwez1:potential/einasto

Conversation

@johnwez1
Copy link
Contributor

Added the Einasto density profile using many of results and conventions in https://arxiv.org/pdf/1202.5242

@codecov
Copy link

codecov bot commented Sep 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.91%. Comparing base (7cfe3bf) to head (e0a7805).

Additional details and impacted files
@@           Coverage Diff            @@
##             main     #760    +/-   ##
========================================
  Coverage   99.91%   99.91%            
========================================
  Files         206      208     +2     
  Lines       30060    30196   +136     
  Branches      620      619     -1     
========================================
+ Hits        30033    30169   +136     
  Misses         27       27            

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jobovy
Copy link
Owner

jobovy commented Oct 1, 2025

Thanks for this, this looks great! I'll need a bit of time to do a full review, but I did a quick review and everything looks pretty good. Two quick comments:

  • A bunch of tests fail because of an unrelated issue with numexpr that I'm fixing in Change numexpr unparseable error test now that logical operations are supported in numexpr #761. Once that's merged, you could rebase to the updated main and the tests should then fully run
  • I understand the simplicity of the r/h form of the Einasto profile, but usually I think people use the form from equations (3) or (4) from the paper you link to, so it might be useful to support the alternative rs or rm2 (r_{-2}) forms of the profile as well. The rm2 one is easy to translate to h with equation (7), but even the rs one should be straightforward with a numerical solution to equation (15) or just using equation (16) (or use equation (16) as an initial guess for solving equation (15) numerically...).
  • I think you meant to link to the paper in the docs?

@johnwez1
Copy link
Contributor Author

Thanks Jo. I'll add the other options in.

@jobovy
Copy link
Owner

jobovy commented Oct 27, 2025

Hi! Just a quick note that I'll be releasing a new version of galpy later this week, so if you wanted to get this into that, now's the time. But no worries if not, there's a release every four months, so it can also wait until the next one!

@jobovy
Copy link
Owner

jobovy commented Nov 3, 2025

Thanks @johnwez1 ! Because it's a bit tedious to cover all of the test bases and because the pre-commit failure was a bit annoying to fix, I've pushed a few commits to add the final tests, tweak the code a bit, and fix the pre-commit issue. I'm also going to rebase this to clean up the history, so we can keep a bit of history rather than squashing everything. But then it should be good to go, thanks again for your contribution, this is great!

@jobovy jobovy changed the title Potential/einasto Add Einasto potential Nov 3, 2025
@jobovy jobovy force-pushed the potential/einasto branch from e0a7805 to 94e7687 Compare November 3, 2025 02:28
@jobovy jobovy merged commit 594d066 into jobovy:main Nov 3, 2025
146 of 147 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants