galactics / beyond

Flight Dynamic Library
MIT License
49 stars 8 forks source link

Collaborate and share low level code #36

Open astrojuanlu opened 2 years ago

astrojuanlu commented 2 years ago

Hi! Congratulations on the beyond 0.7.4 release 🎉

I develop poliastro, another Python library for Astrodynamics. In some things, it's very different from beyond, but both projects share some similarities. I think beyond is very cleanly designed and I sometimes look at your source code for inspiration (thanks for releasing it with MIT!)

I'm not a fan of the mighty "join forces" or "design the one and only Astrodynamics library in Python": we tried that in the past and failed, and since then we adopted a different approach. I think beyond is great and I hope you keep finding time to push it forward 🚀

However, I do think that we could find a way to share some super low level code that is going to be identical for both libraries. For example: I noticed that you have the proverbial "cartesian to keplerian" and "keplerian to cartesian" conversion functions that we astrodynamicists love to implement:

https://github.com/galactics/beyond/blob/334a37202a7138050e46d97f719f81a4350987b5/beyond/orbits/forms.py#L77-L130

We of course have our own implementations as well. Different coding styles and probably slightly different choices, but essentially the same.

For some time I have been considering the idea of moving the core poliastro algorithms to a separate library, and I'd be motivated to collaborate with you so that beyond could adopt such a low-level layer. This wouldn't come for free of course, probably both projects would have to do some "adaptation" for their purposes (I foresee for example leaving numba out of the question, in which case poliastro would @jit the functions on import).

If you are not at all excited about such collaboration that's also fine, no hard feelings 😃 Or if, on the other hand, you're open to the idea but would like to have a more superficial shared layer (simpler things like "circular orbit from grav parameter and semimajor axis") that's also fine. Also, no need to "get it right" from the start or do a grand design, we can maybe iterate with some small functions and continue from there.

Cheers!

galactics commented 2 years ago

Hi Juan Luis,

Thank you very much for your kind word, they are very heartwarming ! The idea of externalizing some functions is also something I delved on, but wasn't sure of the benefit. Now you give me plenty of excellent reasons. I would gladly contribute to that kind of project, though I don't know how much time I can leverage. As you've probably noticed, beyond is not a particularly fast-moving library, and follows my interest of the moment. For example I have recently added Lagrange points computation, due to the launch of James Webb, but other important features are still missing.

astrojuanlu commented 2 years ago

Hi @galactics , thanks for your reply! Sure, I see that you work on beyond sparsely. What we can do then is: when I finally split poliastro.core into its own package I will let you know in this thread, and if you have the time to give it a try and propose changes, awesome. If it doesn't work out in the end, at least is good that we are aware of each other's projects :)