gala icon indicating copy to clipboard operation
gala copied to clipboard

EXP interface enhancements

Open adrn opened this issue 1 year ago • 3 comments

Once #413 is in, and exp-code/exp#136 is addressed, we should:

  • [x] Use getAccel() to compute the acceleration instead of getFields (to save on computation)
  • [x] Improve C++ exception handling (e.g., evaluating interpolator at a time outside of range)
  • [ ] Improve speed and benchmark against pyEXP orbit integration
  • [ ] Hessian
  • [ ] Pickling, saving, and loading an EXPPotential instance

cc @lgarrison

adrn avatar May 06 '25 13:05 adrn

As discussed today, we'll try to rebuild the EXP interface to use PyEXP objects. We will probably extract the EXP objects/pointers at the Python level and pass those to the Gala-EXP extension. The extension will thus depend on EXP but not PyEXP, although PyEXP will be a Python dependency.

For the existing API of passing filename strings, we can make PyEXP objects under the hood and use those.

lgarrison avatar Oct 15 '25 17:10 lgarrison

From @the9cat:

A quick follow up on getAccel(). I did put a getAccelArray() in the interface which takes arrays (x, y, z) and returns accel value as rows of a matrix. I think you want this to be a pure overload? So both named versions named getAccelArray? That's easy to do; just a binding change. FYI, my implementation of getAccelArray is a naive loop over getArray on the C++ side. This could be optimized.

adrn avatar Oct 20 '25 13:10 adrn

I've overloaded getAccel() in the C++ inteface in EXP-code/EXP#170 so that both versions should bind and changed the pyEXP interface accordingly. This is probably the better choice? Not sure. Good for me either way.

The9Cat avatar Oct 20 '25 15:10 The9Cat