Describe the bug
The latest version of SSAPy raises the following warning upon import:
> python
Python 3.10.10 (main, Mar 21 2023, 18:45:11) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssapy
WARNING: TimeDeltaMissingUnitWarning: Numerical value without unit or explicit format passed to TimeDelta, assuming days [astropy.time.core]
To Reproduce
SSAPy version: 9ed512e
Astropy version: 6.1.2
Steps to reproduce the behavior:
Install SSAPy
Import SSAPy (import ssapy)
I have tracked this warning through the __init__.py file where it imports plotUtils.py. The warning is raised by the following function signature in plotUtils.py:
def koe_plot(r, v, t=Time("2025-01-01", scale='utc') + np.linspace(0, int(1 * 365.25), int(365.25 * 24)), elements=['a', 'e', 'i'], save_path=False, body='Earth'):
Specifically this is raised by astropy's TimeDelta function because the np.linspace array that is added to the Time object does not have a specified unit.
A proposed solution: Change the keo_plot signature to:
def koe_plot(r, v, t= np.linspace(Time("2025-01-01", scale='utc'), Time("2026-01-01", scale='utc'), int(365.25*24)), elements=['a', 'e', 'i'], save_path=False, body='Earth'):
Describe the bug The latest version of SSAPy raises the following warning upon import:
To Reproduce SSAPy version: 9ed512e Astropy version: 6.1.2 Steps to reproduce the behavior:
import ssapy
)I have tracked this warning through the
__init__.py
file where it importsplotUtils.py
. The warning is raised by the following function signature inplotUtils.py
:def koe_plot(r, v, t=Time("2025-01-01", scale='utc') + np.linspace(0, int(1 * 365.25), int(365.25 * 24)), elements=['a', 'e', 'i'], save_path=False, body='Earth'):
Specifically this is raised by astropy's TimeDelta function because the np.linspace array that is added to the Time object does not have a specified unit.
A proposed solution: Change the keo_plot signature to:
def koe_plot(r, v, t= np.linspace(Time("2025-01-01", scale='utc'), Time("2026-01-01", scale='utc'), int(365.25*24)), elements=['a', 'e', 'i'], save_path=False, body='Earth'):
This is supported by Astropy>=5.1 (source)
Desktop (please complete the following information):