A practical astronomy library
Project description
This project is based on the algorithms found in Practical Astronomy with your Calculator or Spreadsheet by Peter Duffett-Smith and Jonathan Zwart.
This is a library of functions, with unit tests, written in Python 3.12, the standard library, unittest framework, and the math module.
All credit for the accuracy and usefulness of these algorithms goes to the original authors.
Test
To run all tests run this command:
python -m unittest
Local Development Setup
Start/Activate a Virtual Environment
Start:
python3 -m venv venv
Activate:
source venv/bin/activate
On Windows
venv\Scripts\activate
Install dependencies
pip install --upgrade -r requirements.txt
Installation
pip install af_practical_astronomy
Running
Currently, you will have to manually import these functions into your project if you wish.
Future plans
- Finish implementing all of the algorithms from the book.
- Note: skipped section 31, matrix method for coordinate conversions. Will implement later.
- Add a test runner.
Updating and Repackaging the Project with setuptools
To update and repackage this Python project using setuptools on macOS, follow these steps:
1. Install or Activate the Virtual Environment
It's recommended to use a virtual environment for isolation. If you don't already have a virtual environment, create and activate one:
Create and start virtual environment:
python3 -m venv venv
source venv/bin/activate
2. Install Required Dependencies
Ensure that setuptools and wheel are installed in your environment:
pip install -r requirements.txt
3. Update version number
setup(
version="0.2.0", # Update this to the new version number
...
)
4. Build the dist
python setup.py sdist bdist_wheel
5. Upload with twine
twine upload dist/*
And enter in the API token when prompted
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file af_practical_astronomy-1.0.9.tar.gz.
File metadata
- Download URL: af_practical_astronomy-1.0.9.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df814a3edcb1b8edad4cc328bbbb36b0e4612bdb5b01f8191277018683839d0b
|
|
| MD5 |
b3fcae80ac899ef88911365e9ff39767
|
|
| BLAKE2b-256 |
da41bbc9d61fd5f70438cb884f3f1208cfbed9158418fd039bc6d0fc339a7530
|
File details
Details for the file af_practical_astronomy-1.0.9-py3-none-any.whl.
File metadata
- Download URL: af_practical_astronomy-1.0.9-py3-none-any.whl
- Upload date:
- Size: 2.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e484bb2a8505b8e3f3c914baef9fb4c9aaee916a50db83563417301d5468c11
|
|
| MD5 |
a9b3fb8875e63508d762d45c835b87ad
|
|
| BLAKE2b-256 |
9c05e9be196035bdc8004d95f415c7d76ba0b44bfa0de5aa1d27658fb3f8beea
|