From 64c8dd901da118e8dd11e932ad2a13874ccb2726 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Deuchnord?= Date: Mon, 12 Apr 2021 15:11:10 +0200 Subject: [PATCH] fix: add missing enums to the exposed model, rename data.py to model.py (#11) BREAKING CHANGE: `kosmorrolib.data` has been renamed to `kosmorrolib.model`. To ensure further BC-break to happen on this side, prefer using the model now exposed from kosmorrolib directly. --- kosmorrolib/__init__.py | 3 ++- kosmorrolib/ephemerides.py | 2 +- kosmorrolib/events.py | 2 +- kosmorrolib/{data.py => model.py} | 0 tests/data.py | 4 ++-- tests/ephemerides.py | 2 +- tests/events.py | 2 +- 7 files changed, 8 insertions(+), 7 deletions(-) rename kosmorrolib/{data.py => model.py} (100%) diff --git a/kosmorrolib/__init__.py b/kosmorrolib/__init__.py index 74a65dc..d317d1c 100644 --- a/kosmorrolib/__init__.py +++ b/kosmorrolib/__init__.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 -from .data import Position +from .model import Position, Event, AsterEphemerides, Object from .ephemerides import get_ephemerides, get_moon_phase from .events import get_events +from .enum import EventType, MoonPhaseType diff --git a/kosmorrolib/ephemerides.py b/kosmorrolib/ephemerides.py index 33b25e6..14f5397 100644 --- a/kosmorrolib/ephemerides.py +++ b/kosmorrolib/ephemerides.py @@ -8,7 +8,7 @@ from skyfield.timelib import Time from skyfield.constants import tau from skyfield.errors import EphemerisRangeError -from .data import Position, AsterEphemerides, MoonPhase, Object, ASTERS +from .model import Position, AsterEphemerides, MoonPhase, Object, ASTERS from .dateutil import translate_to_timezone from .core import get_skf_objects, get_timescale, get_iau2000b from .enum import MoonPhaseType diff --git a/kosmorrolib/events.py b/kosmorrolib/events.py index 86c70c6..f1d1e86 100644 --- a/kosmorrolib/events.py +++ b/kosmorrolib/events.py @@ -7,7 +7,7 @@ from skyfield.timelib import Time from skyfield.searchlib import find_discrete, find_maxima, find_minima from numpy import pi -from .data import Event, Star, Planet, ASTERS +from .model import Event, Star, Planet, ASTERS from .dateutil import translate_to_timezone from .enum import EventType from .exceptions import OutOfRangeDateError diff --git a/kosmorrolib/data.py b/kosmorrolib/model.py similarity index 100% rename from kosmorrolib/data.py rename to kosmorrolib/model.py diff --git a/tests/data.py b/tests/data.py index 0b68fb0..0cab89c 100644 --- a/tests/data.py +++ b/tests/data.py @@ -1,11 +1,11 @@ import unittest -from kosmorrolib import data, core +from kosmorrolib import model, core class DataTestCase(unittest.TestCase): def test_object_radius_must_be_set_to_get_apparent_radius(self): - o = data.Planet("Saturn", "SATURN") + o = model.Planet("Saturn", "SATURN") with self.assertRaises(ValueError) as context: o.get_apparent_radius( diff --git a/tests/ephemerides.py b/tests/ephemerides.py index 90a6003..589f7ee 100644 --- a/tests/ephemerides.py +++ b/tests/ephemerides.py @@ -4,7 +4,7 @@ from kosmorrolib.enum import MoonPhaseType from .testutils import expect_assertions from kosmorrolib import ephemerides -from kosmorrolib.data import Position, MoonPhase +from kosmorrolib.model import Position, MoonPhase from datetime import date from kosmorrolib.exceptions import OutOfRangeDateError diff --git a/tests/events.py b/tests/events.py index da6485c..70f12a7 100644 --- a/tests/events.py +++ b/tests/events.py @@ -4,7 +4,7 @@ from datetime import date, datetime from parameterized import parameterized from kosmorrolib import events -from kosmorrolib.data import Event, ASTERS +from kosmorrolib.model import Event, ASTERS from kosmorrolib.enum import EventType from kosmorrolib.exceptions import OutOfRangeDateError