Warning
This package is under active development and is not ready for public use.
galactic_dynamics_interoperability
provides tools for converting objects
between galactic dynamics Python libraries.
pip install galactic_dynamics_interoperability
The main docs are in development.
galactic_dynamics_interoperability
provides type objects for representing
different galactic dynamics libraries. These types are used for dispatching to
converters:
AbstractInteroperableLibrary
: the base classAgamaLibrary
: representsagama
GalaLibrary
: representsgala
GalaxLibrary
: representsgalax
GalpyLibrary
: representsgalpy
To convert potential objects between libraries use convert_potential
. As an
example, here is converting from a gala
Potential to a galax
Potential.
>>> from galactic_dynamics_interoperability import convert_potential, GalaxLibrary
>>> import gala.potential
>>> from gala.units import galactic
>>> import galax.potential
>>> potential = gala.potential.KeplerPotential(m=1e11, units=galactic)
>>> convert_potential(GalaxLibrary, potential)
KeplerPotential(
units=LTMAUnitSystem( length=Unit("kpc"), ...),
constants=ImmutableMap({'G': ...}),
m_tot=ConstantParameter( value=Quantity[...](value=f64[], unit=Unit("solMass")) )
)
-
Why have the argument order
convert_potential(to, from)
, notconvert_potential(from, to)
?This is because of how Julia structures its conversions (
convert
), from which this library draws inspiration. We aim to increase interoperability between galactic dynamics libraries and with the ongoing development of Python-Julia bridges, Julia-wrapped-into-Python galactic dynamics libraries are well within our remit.
If you found this library to be useful and want to support the development and maintenance of lower-level code libraries for the scientific community, please consider citing this work.
We welcome contributions!