Compare commits

3 Commits

Author SHA1 Message Date
Jan Doubravský
94b6333e9a Release 1.3.0 2026-04-21 14:29:49 +02:00
Jan Doubravský
13805a552f Merge branch 'devel' of https://doubynet.eu/Honza/PlanetaryTime into release 2026-04-21 14:28:56 +02:00
6103ab4d7d Release 1.2.0 2026-04-16 19:27:21 +02:00
5 changed files with 3 additions and 21 deletions

View File

@@ -5,18 +5,6 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [1.3.1] - 2026-04-22
### Added
- `Body.EARTH` enum value with `rotation_hours = 23.934`, `orbital_hours = 8766.0`, discovery epoch 1543-01-01 (Copernicus), contact epoch 1969-07-20 (Apollo 11)
- `Luna` moon (Earth's Moon): tidally locked, `rotation_hours = orbital_hours = 655.72`, discovery epoch 1609-11-01 (Galileo), contact epoch 1969-07-20 (Apollo 11)
- `LUNA` constant exported from `moon.py`
### Changed
- `Body.__getitem__` now uses 1-based indexing — `Body.MARS[1]` returns Phobos, `Body.MARS[2]` returns Deimos
## [1.3.0] - 2026-04-21
### Added

View File

@@ -1,6 +1,6 @@
[project]
name = "planetarytime"
version = "1.3.1"
version = "1.3.0"
description = "Python library for representing and working with time on other bodies in the Solar System"
authors = [
{name = "Jan Doubravský", email = "jan.doubravsky@gmail.com"}

View File

@@ -5,7 +5,6 @@ from datetime import date
PLANET_ROWS: list[tuple[str, float, float, date, date | None]] = [
('Mercury' , 1407.600, 2111.2800, date(1631, 11, 7), date(2011, 3, 18)),
('Venus' , 5832.500, 5392.8000, date(1610, 1, 1), date(1970, 12, 15)),
('Earth' , 23.934, 8766.0000, date(1543, 1, 1), date(1969, 7, 20)),
('Mars' , 24.600, 16487.2800, date(1610, 1, 1), date(1976, 7, 20)),
('Jupiter' , 9.900, 103982.1600, date(1610, 1, 7), None),
('Saturn' , 10.700, 258221.2800, date(1610, 7, 25), None),
@@ -15,7 +14,6 @@ PLANET_ROWS: list[tuple[str, float, float, date, date | None]] = [
# (name, rotation_hours, orbital_hours, is_tidally_locked, discovery_date, contact_date | None)
MOON_ROWS: list[tuple[str, float, float, bool, date, date | None]] = [
('Luna' , 655.720, 655.720, True , date(1609, 11, 1), date(1969, 7, 20)),
('Phobos' , 7.653, 7.653, True , date(1877, 8, 18), None),
('Deimos' , 30.312, 30.312, True , date(1877, 8, 12), None),
('Io' , 42.456, 42.456, True , date(1610, 1, 8), None),

View File

@@ -11,7 +11,6 @@ from planetarytime.moon import (
EUROPA,
GANYMEDE,
IO,
LUNA,
MIRANDA,
Moon,
OBERON,
@@ -28,7 +27,6 @@ class Body(Enum):
MERCURY = "Mercury"
VENUS = "Venus"
EARTH = "Earth"
MARS = "Mars"
JUPITER = "Jupiter"
SATURN = "Saturn"
@@ -60,8 +58,8 @@ class Body(Enum):
return self.value
def __getitem__(self, index: int) -> Moon:
"""Return the moon at the given 1-based index for this body."""
return _MOONS[self][index - 1]
"""Return the moon at the given index for this body."""
return _MOONS[self][index]
_ROTATION_HOURS: dict[Body, float] = {
@@ -76,7 +74,6 @@ _ORBITAL_HOURS: dict[Body, float] = {
_MOONS: dict[Body, list[Moon]] = {
Body.MERCURY: [],
Body.VENUS: [],
Body.EARTH: [LUNA],
Body.MARS: [PHOBOS, DEIMOS],
Body.JUPITER: [IO, EUROPA, GANYMEDE, CALLISTO],
Body.SATURN: [TITAN, ENCELADUS],

View File

@@ -56,7 +56,6 @@ _MOONS_BY_NAME: dict[str, Moon] = {
row[0]: _make_moon(*row) for row in MOON_ROWS
}
LUNA = _MOONS_BY_NAME["Luna"]
PHOBOS = _MOONS_BY_NAME["Phobos"]
DEIMOS = _MOONS_BY_NAME["Deimos"]
IO = _MOONS_BY_NAME["Io"]