From f0b42679853d2d8310005cdde2afd1c7674ccaf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Deuchnord?= Date: Sun, 9 Jan 2022 11:24:31 +0100 Subject: [PATCH] fix: remove NumPy direct dependency (#41) Note that Numpy is still a dependency of Skyfield and its dependencies. --- kosmorrolib/events.py | 3 +-- kosmorrolib/model.py | 5 ++--- pyproject.toml | 1 - 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/kosmorrolib/events.py b/kosmorrolib/events.py index e1c84fb..7b4c9f8 100644 --- a/kosmorrolib/events.py +++ b/kosmorrolib/events.py @@ -23,10 +23,9 @@ from skyfield.timelib import Time from skyfield.searchlib import find_discrete, find_maxima, find_minima from skyfield.units import Angle from skyfield import almanac, eclipselib -from numpy import pi +from math import pi from kosmorrolib.model import ( - Object, Event, Object, Star, diff --git a/kosmorrolib/model.py b/kosmorrolib/model.py index 6f83fe1..aadf068 100644 --- a/kosmorrolib/model.py +++ b/kosmorrolib/model.py @@ -19,8 +19,7 @@ from abc import ABC, abstractmethod from typing import Union from datetime import datetime, timezone - -import numpy +from math import asin from skyfield.api import Topos, Time, Angle from skyfield.vectorlib import VectorSum as SkfPlanet @@ -180,7 +179,7 @@ class Object(Serializable): .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: """Serialize the given object diff --git a/pyproject.toml b/pyproject.toml index 4e3f6ae..0b85428 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,7 +23,6 @@ classifiers = [ python = ">=3.7,<3.11" skyfield = "^1.21" skyfield-data = "^3.0" -numpy = "^1.17" python-dateutil = "^2.8" [tool.poetry.dev-dependencies]