Celerity
Celerity is a lightweight, research-grade, zero-dependency type-safe Python library for astronomical calculations to plan your observations. It's only dependency is the Python 3.11+ standard library.
It has been designed to be independent of any other popular astronomical libraries, with a focus on providing a simple and intuitive API for performing common astronomical calculations.
N.B. This project is currently in the early stages of development and is not yet ready for production use.
Usage
Installation
Celerity can be installed using pip:
pip install celerity
or poetry:
poetry add celerity
API
The API has been designed to be written in an idiomatic and natural way for English speakers, as well as idiomatic to Python.
It has been specifically designed to only depend on the core set of Python modules, such that it is not strictly dependent on other popular astronomical libraries, e.g., astropy (although it can compliment the usage of these libraries).
It's important to note that the API does not perform string parsing of times and coordinates, but instead requires the user to provide the correct data types. This is to ensure that the API is type-safe and that the user is aware of the data types being used at all times.
For example, to find out the horizontal coordinate for the star Betelgeuse on the 14th May 2021 at 12:00 UTC, at Mauna Kea, Hawaii, you would write:
from datetime import datetime, timezone
from celerity import Observer, Time
# Mauna Kea, Hawaii:
observer = Observer(
latitude=19.82,
longitude=-155.47,
elevation=4205,
)
# Time of observation in UTC:
time = Time(
when=datetime(2021, 5, 14, 12, 0, 0, tzinfo=timezone.utc)
)
# Provide a Sky target in equatorial coordinates at epoch J2000:
betelgeuse = { ra: 88.792938, dec: 7.407064 }
# Observe the target:
betelgeuse = observer.at(time).observe({ ra: 88.792938, dec: 7.407064 })
# Get the horizontal coordinates:
{ alt, az } = betelgeuse.altAz()
# What is the Local Sidereal Time at the time of observation?
lst = observer.at(time).LST()
# What is the Julian Date at the time of observation?
jd = observer.at(time).JD()
Package Development
Project Requirements
- Python 3.11.*
- Docker.
- Docker Compose.
- Poetry for Python package and environment management.
Installing Dependencies
The Celerity project manages Python package dependencies using Poetry. You'll need to follow the instructions for installation there.
Then you can start a shell session with the new environment with:
$ poetry shell
N.B. For development with vscode you will need to run the following command:
$ poetry config virtualenvs.in-project true
This will installed the poetry .venv in the root of the project and allow vscode to setup the environment correctly for development.
To start development, install all of the dependencies as:
$ poetry install
N.B. Ensure that any dependency changes are committed to source control, so everyone has a consistenct package dependecy list.
Local Development
The Celerity development stack can be built with the following docker compose command, with the $INSTALL_DEV build environment argument*.
$ docker compose -f local.yml build --build-arg INSTALL_DEV="true"
* This is required to install the development dependencies in the container.
Then start the development stack with a running shell session with:
$ docker compose -f local.yml run app bash
N.B. The docker compose command will build the development stack if it has not been built already.
Running Tests
To run the tests, please ensure you have followed the steps for building the development server:
The Celerity development stack can be built with the following docker compose command, with the $INSTALL_DEV build environment argument*.
$ docker compose -f local.yml build --build-arg INSTALL_DEV="true"
You can then run the pytest suite using the following command:
$ docker compose -f local.yml exec api pytest
Metadata
Release files for celerity 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| celerity-0.1.0.tar.gz | 5.4 kB | Without provenance | Details for celerity-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| celerity-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for celerity-0.1.0-py3-none-any.whl |
Total release size: 11.1 kB
Release files / celerity-0.1.0.tar.gz
| Download URL | celerity-0.1.0.tar.gz |
|---|---|
| Size | 5.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1a631788f45fd12162192fb173157faacf9b5f0b0ad2972e1fa6013816ca37c1
|
|
BLAKE2b-256 checksum How to use checksums |
ef4e74f586ee68a3aeed234b110d9066a4199f85dc6e7b62bccc6d0972fd1ea8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.2 CPython/3.11.3 Darwin/21.4.0
|
Release files / celerity-0.1.0-py3-none-any.whl
| Download URL | celerity-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
411df742e0d7659f1f42517475da15e10591861c3e60045307206a3f79f39308
|
|
BLAKE2b-256 checksum How to use checksums |
035617f102f9dfce8f0b6628ce4335de0f5512d73fb0b46cb2c72678d5fd95a7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.2 CPython/3.11.3 Darwin/21.4.0
|
Security for celerity 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.