From fbd755b87a3684fc1fb899fd7bfbdb85b006a8fa Mon Sep 17 00:00:00 2001 From: ilikecubesnstuff <25328250+ilikecubesnstuff@users.noreply.github.com> Date: Sun, 14 Jan 2024 13:24:25 +0000 Subject: [PATCH] :memo: Improve project description, add installation and usage sections. --- README.md | 28 +++++++++++++++++++++++++++- pyproject.toml | 2 +- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5e9397b..83aaddd 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,32 @@ [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/) -A pythin interface for dynamics of galaxies, using existing galactic dynamics libraries in Python ([`galpy`](https://github.com/jobovy/galpy), [`gala`](https://github.com/adrn/gala) and [`agama`](https://github.com/GalacticDynamics-Oxford/Agama)) as backends. +A python interface for dynamics of galaxies, using existing galactic dynamics libraries in Python ([`galpy`](https://github.com/jobovy/galpy), [`gala`](https://github.com/adrn/gala) and [`agama`](https://github.com/GalacticDynamics-Oxford/Agama)) as backends. This is currently used in the [commensurability](https://github.com/ilikecubesnstuff/commensurability/) library. + +## Installation + +Install this package via `pip`: + +``` +python -m pip install pidgey +``` + +## Usage + +Get the points from an orbit integration stored in an `astropy.coordinates.SkyCoord` object by calling the `compute_orbit` method of a backend. The backend can generally be obtained from the potential used for the orbit integration with the `get_backend_from` function. + +```py +import astropy.coordinates as c +import astropy.units as u + +from pidgey import get_backend_from + +def calculate_orbit(ic: c.SkyCoord, + potential: Any + ) -> c.SkyCoord: + backend = get_backend_from(potential) + orbit = backend.compute_orbit(ic, potential, dt=0.01 * u.Gyr, steps=1000) + return orbit +``` diff --git a/pyproject.toml b/pyproject.toml index fb0a6f9..2f1bac3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "pidgey" version = "0.2.1" -description = "Python interface for dynamics in galaxies, using Agama, Gala, and Galpy as backends." +description = "Python interface for the dynamics of galaxies. Uses agama, gala, and galpy as backends." authors = [ { name = "ilikecubesnstuff", email = "25328250+ilikecubesnstuff@users.noreply.github.com" }, ]