Skip to content

ALFA-project-erc/kanon

Folders and files

NameName
Last commit message
Last commit date
Sep 25, 2022
Mar 10, 2023
Mar 14, 2022
Jul 17, 2023
Jan 14, 2022
Jan 14, 2022
Mar 10, 2023
Jan 14, 2022
Jun 30, 2022
Mar 10, 2021
Mar 10, 2021
Feb 9, 2022
Jan 14, 2022
Mar 10, 2023
Mar 10, 2023
Jan 17, 2022

Repository files navigation

GitHub Pipeline Status Coverage Docs status Kanon Pypi Python 3.8 Powered by Astropy Badge

Kanon is the History of Astronomy Python package and tools.

Current Features

units

  • Define standard positional numeral systems with standard arithmetics (BasedReal)
  • Set your own precision contexts and algorithms on arithmetical operations (PrecisionContext)
  • Keep track of all operations

tables

  • Build or import ancient astronomical tables
  • Perform arithmetical and statistical operations
  • Support for BasedReal values

calendars

  • Define new calendar types
  • Date conversions

models

  • Collection of mathematical models used for all kinds of geocentric astronomical tables

How to use

Install the package with pip

pip install kanon

Import Kanon and begin trying all its features

import kanon.units as u

a = u.Sexagesimal(1,2,3)
b = u.Sexagesimal(2,1,59)

a + b
# 3,4,2 ;

Development

To start developing on this project you need to install the package with poetry (Installing Poetry <https://python-poetry.org/docs/>)

git clone https://github.com/legau/kanon.git
cd kanon
poetry install

The changes you make in the code are reflected on your Python environment.

Activate pre-commit checks :

pre-commit install

Tests

Run tests with tox

# source code tests
tox -e test

# example notebooks tests
tox -e test_notebooks

# linting
pre-commit run --all-files