Replies: 3 comments 7 replies
-
My two cents: I think it would be ideal if all conversion code is hosted outside of the libraries themselves, e.g., here. I think it's easiest for maintaining each library to not take on the tech debt of having to support all the other libraries. But I think we'd have to commit to supporting some sort of NEP-29-style support policy, to support conversions going back a few versions for each library. But again, that would then be effectively done through tests hosted in this repository. We could Even with just four libraries, the combinatorics of implementing all
|
Beta Was this translation helpful? Give feedback.
-
💯. I totally agree. I really like the NEP-29 backwards compatibility idea.
I like this idea in the abstract, but worry that there's no ideal library to choose as the standard. The ideal standard library is
I actually think this might be the more feasible! We could define a schema for each potential, with a mathematical definition of the potential (and density) given the parameters in the schema. I would advocate using PotentialSchema(NamedTuple):
doc: str
constants: tuple[Symbol, ...] = ...
parameters: tuple[Symbol, ...] = ...
variables: tuple[Symbol, ...] = ...
potential: Expression = ...
kepler = PotentialSchema(
"""The Kepler Potential.
Parameters:
G: Gravitational constant
M: total mass
r: spherical radius
"""
(<symbols>),
(<symbols>),
(<symbols>),
- G M / r^2
)
... With sympy libraries could programatically create utilities for conversion... Each library could then support a conversion function that provides the parameter values.
|
Beta Was this translation helpful? Give feedback.
-
can you more clearly define the scope of this package? I could think of two rather different possibilities:
Now, (1) seems to be out of question for the reasons you listed above – impossible to find the common language base. Pure Python is slow, C/C++ is not JAXable, and vice versa JAX is not easy to port into the C++ workflow (I haven't tried though, but in any case it's a separate language, adding an unwelcome dependency). |
Beta Was this translation helpful? Give feedback.
-
In
galax
we have implemented many specific conversions, for example both thegala
togalax
and thegalax
togala
conversions, as done here.The question is what to do with these functions? Should everything be moved here? Or should each galactic dynamics library
host the conversion functions from the other libraries to their own library?
This is partly a question about how best to support long-term compatibility, when one library updates and changes some definitions. Does every other library then have to cut compatibility releases? Or if it's hosted here, then only this package needs to cut a new release.
Thoughts? @jobovy @adrn @eugvas
Working Overview:
Beta Was this translation helpful? Give feedback.
All reactions