Browse Source

fix: remove NumPy direct dependency

Note that Numpy is still a dependency of Skyfield and its dependencies.
pull/41/head
Jérôme Deuchnord 2 years ago
parent
commit
a2a6bc0c12
3 changed files with 3 additions and 6 deletions
  1. +1
    -2
      kosmorrolib/events.py
  2. +2
    -3
      kosmorrolib/model.py
  3. +0
    -1
      pyproject.toml

+ 1
- 2
kosmorrolib/events.py View File

@@ -23,10 +23,9 @@ 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 skyfield.units import Angle from skyfield.units import Angle
from skyfield import almanac, eclipselib from skyfield import almanac, eclipselib
from numpy import pi
from math import pi


from kosmorrolib.model import ( from kosmorrolib.model import (
Object,
Event, Event,
Object, Object,
Star, Star,


+ 2
- 3
kosmorrolib/model.py View File

@@ -19,8 +19,7 @@
from abc import ABC, abstractmethod from abc import ABC, abstractmethod
from typing import Union from typing import Union
from datetime import datetime, timezone from datetime import datetime, timezone

import numpy
from math import asin


from skyfield.api import Topos, Time, Angle from skyfield.api import Topos, Time, Angle
from skyfield.vectorlib import VectorSum as SkfPlanet from skyfield.vectorlib import VectorSum as SkfPlanet
@@ -180,7 +179,7 @@ class Object(Serializable):
.radec() .radec()
) )


return Angle(radians=numpy.arcsin(self.radius / distance.km) * 2.0)
return Angle(radians=asin(self.radius / distance.km) * 2.0)


def serialize(self) -> dict: def serialize(self) -> dict:
"""Serialize the given object """Serialize the given object


+ 0
- 1
pyproject.toml View File

@@ -23,7 +23,6 @@ classifiers = [
python = ">=3.7,<3.11" python = ">=3.7,<3.11"
skyfield = "^1.21" skyfield = "^1.21"
skyfield-data = "^3.0" skyfield-data = "^3.0"
numpy = "^1.17"
python-dateutil = "^2.8" python-dateutil = "^2.8"


[tool.poetry.dev-dependencies] [tool.poetry.dev-dependencies]


Loading…
Cancel
Save