Conversation
…rapper Co-authored-by: jobovy <1044876+jobovy@users.noreply.github.com>
Co-authored-by: jobovy <1044876+jobovy@users.noreply.github.com>
|
@copilot Let's try a different approach. It appears that Boost.math's hypergeometric function for p=2 and q=1 doesn't work for |z| > 1, which we need (GSL also doesn't work). So please remove all mentions of boost in this PR in a commit. Remember to install pre-commit with pre-commit install. As an alternative, download the v0.1.3 version of the xsf library here: https://github.com/scipy/xsf/releases/tag/v0.1.3. This is the header-only C++ library back-end to scipy.special. So update the setup.py script to include this library's path if it exists (download the release to a folder xsf int he repository root, and check for the xsf directory's existence). Then write similar glue to use the hyp2f1.h function as you wrote already. Finally, note that potentials are passed through galpy/orbit/integrateFullOrbit.py and galpy/orbit/orbit_c_ext/integrateFullOrbit.c to pass their parameters to the C code. Again, look at PR 760 for an example of how this is done (note that there are similar files for planar and linear orbits). Remember to keep commits atomic. |
|
@jobovy Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub. You can ask me to try again later by mentioning me in a new comment. If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: Sorry for the inconvenience! |
Co-authored-by: jobovy <1044876+jobovy@users.noreply.github.com>
…download to CI Co-authored-by: jobovy <1044876+jobovy@users.noreply.github.com>
Completed all requested changes:
Tested successfully - orbit integration works with energy conservation std < 1e-10. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #785 +/- ##
========================================
Coverage 99.91% 99.91%
========================================
Files 208 210 +2
Lines 30250 30350 +100
Branches 620 621 +1
========================================
+ Hits 30223 30323 +100
Misses 27 27 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
jobovy
left a comment
There was a problem hiding this comment.
@copilot Please address the CI failures. There are two I can see immediately:
- Orbit tests fail, for example in https://github.com/jobovy/galpy/actions/runs/19285935699/job/55147106670. I think this is because the TwoPowerSphericalPotentialPlanarRforce in TwoPowerSphericalPotential.c is slightly wrong. It should start with
-amp * pow(R, 1.0 - alpha) Also note that some of the other pow code in c could be changed from a division to a multiplication with pow to the negative power, for example, R / pow(r, alpha) --> R * pow(r, -alpha)
- Some of the wheel building jobs fail, e.g., https://github.com/jobovy/galpy/actions/runs/19285936349/job/55147106772?pr=785. Don't worry about the error about -fopenmp, this is expected, but the other errors are not. I'm not sure why the compilation in build.yml works, but not the one in wheels.yml, but maybe it has to do with cibuildwheel's environment.
As always, make sure to install pre-commit so pre-commit hooks are run before commits. And keep commits atomic, comments not too verbose. Thanks!
Co-authored-by: jobovy <1044876+jobovy@users.noreply.github.com>
Fixed CI failures in commit 1864680:
Tested locally - orbit integration works with energy conservation std < 1e-10. |
jobovy
left a comment
There was a problem hiding this comment.
@copilot Mac/Windows CI builds in build.yml, build_windows.yml, and wheels.yml still fail. I don't think adding graft xsf to MANIFEST.in was correct (although the new header file for the wrapping of xsf might need to be added?). It seems like the issue might be the C++ standard being C++17 for xsf, so perhaps that needs to be added? Make sure to install pre-commit!
Co-authored-by: jobovy <1044876+jobovy@users.noreply.github.com>
Fixed Mac/Windows CI builds in commit fb983a4:
Tested locally with C++17 - builds and runs successfully. |
Co-authored-by: jobovy <1044876+jobovy@users.noreply.github.com>
Co-authored-by: jobovy <1044876+jobovy@users.noreply.github.com>
Added LICENSE and LICENSES_bundled.txt from xsf v0.1.3 to xsf/ directory in commit 42ffba3. Files are already included via existing |
…v files Co-authored-by: jobovy <1044876+jobovy@users.noreply.github.com>
Co-authored-by: jobovy <1044876+jobovy@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Adds C implementation for
TwoPowerSphericalPotentialto enable fast orbit integration. Uses xsf library'shyp2f1(scipy.special backend) for hypergeometric function with support for |z| > 1.Implementation
hyp2f1.hfunction, pruned to essential dependenciesgalpy/util/wrap_xsf.{cpp,h}): Wraps xsf's complexhyp2f1to provide C-callable interfacegalpy/potential/potential_c_ext/TwoPowerSphericalPotential.c): Implements all required functions (Eval, Rforce, zforce, PlanarRforce, PlanarR2deriv, Dens) taking 4 args:amp, a, alpha, betahasC,hasC_dxdv,hasC_densflags inTwoPowerSphericalPotential.__init__integrateFullOrbit.py/candintegratePlanarOrbit.py/cBuild & Dependencies
xsf/include/xsf/_compile()wrapper with-std=c++17compile()wrapper with/std:c++17 /Zc:__cplusplusTesting
Added
TwoPowerSphericalPotential(alpha=1.5, beta=3.5)andTwoPowerSphericalPotential(alpha=1.5, beta=3.0)to:test_actionAngleStaeckel_wSpherical_conserved_actions_ctest_dynamfric_ctest_liouville_planarVerified:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.