Browse Source

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.
tags/v0.11.0
Jérôme Deuchnord 3 years ago
committed by Jérôme Deuchnord
parent
commit
4dd21c2b29
7 changed files with 7 additions and 7 deletions
  1. +1
    -1
      kosmorrolib/__init__.py
  2. +1
    -1
      kosmorrolib/ephemerides.py
  3. +1
    -1
      kosmorrolib/events.py
  4. +0
    -0
      kosmorrolib/model.py
  5. +2
    -2
      tests/data.py
  6. +1
    -1
      tests/ephemerides.py
  7. +1
    -1
      tests/events.py

+ 1
- 1
kosmorrolib/__init__.py View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python3 #!/usr/bin/env python3


from .data import Position
from .model import Position, Event, AsterEphemerides, Object
from .ephemerides import get_ephemerides, get_moon_phase from .ephemerides import get_ephemerides, get_moon_phase
from .events import get_events from .events import get_events
from .enum import * from .enum import *

+ 1
- 1
kosmorrolib/ephemerides.py View File

@@ -8,7 +8,7 @@ from skyfield.timelib import Time
from skyfield.constants import tau from skyfield.constants import tau
from skyfield.errors import EphemerisRangeError 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, normalize_datetime from .dateutil import translate_to_timezone, normalize_datetime
from .core import get_skf_objects, get_timescale, get_iau2000b from .core import get_skf_objects, get_timescale, get_iau2000b
from .enum import MoonPhaseType from .enum import MoonPhaseType


+ 1
- 1
kosmorrolib/events.py View File

@@ -7,7 +7,7 @@ from skyfield.timelib import Time
from skyfield.searchlib import find_discrete, find_maxima, find_minima from skyfield.searchlib import find_discrete, find_maxima, find_minima
from numpy import pi 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 .dateutil import translate_to_timezone
from .enum import EventType from .enum import EventType
from .exceptions import OutOfRangeDateError from .exceptions import OutOfRangeDateError


kosmorrolib/data.py → kosmorrolib/model.py View File


+ 2
- 2
tests/data.py View File

@@ -1,12 +1,12 @@
import unittest import unittest


from kosmorrolib import data, core
from kosmorrolib import model, core
from kosmorrolib.enum import ObjectIdentifier from kosmorrolib.enum import ObjectIdentifier




class DataTestCase(unittest.TestCase): class DataTestCase(unittest.TestCase):
def test_object_radius_must_be_set_to_get_apparent_radius(self): def test_object_radius_must_be_set_to_get_apparent_radius(self):
o = data.Planet(ObjectIdentifier.SATURN, "SATURN")
o = model.Planet(ObjectIdentifier.SATURN, "SATURN")


with self.assertRaises(ValueError) as context: with self.assertRaises(ValueError) as context:
o.get_apparent_radius( o.get_apparent_radius(


+ 1
- 1
tests/ephemerides.py View File

@@ -4,7 +4,7 @@ from kosmorrolib.enum import MoonPhaseType


from .testutils import expect_assertions from .testutils import expect_assertions
from kosmorrolib import ephemerides from kosmorrolib import ephemerides
from kosmorrolib.data import Position, MoonPhase
from kosmorrolib.model import Position, MoonPhase
from datetime import date from datetime import date
from kosmorrolib.exceptions import OutOfRangeDateError from kosmorrolib.exceptions import OutOfRangeDateError




+ 1
- 1
tests/events.py View File

@@ -4,7 +4,7 @@ from datetime import date, datetime
from parameterized import parameterized from parameterized import parameterized


from kosmorrolib import events from kosmorrolib import events
from kosmorrolib.data import Event, ASTERS
from kosmorrolib.model import Event, ASTERS
from kosmorrolib.enum import EventType from kosmorrolib.enum import EventType
from kosmorrolib.exceptions import OutOfRangeDateError from kosmorrolib.exceptions import OutOfRangeDateError




Loading…
Cancel
Save