Skip to content

Commit

Permalink
📝 Improve project description, add installation and usage sections.
Browse files Browse the repository at this point in the history
  • Loading branch information
ilikecubesnstuff committed Jan 14, 2024
1 parent 7552750 commit fbd755b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 = "[email protected]" },
]
Expand Down

0 comments on commit fbd755b

Please sign in to comment.