Skip to content
This repository has been archived by the owner on Oct 14, 2023. It is now read-only.

Orbit.from_sbdb raises unhelpful error if no object was found #916

Closed
astrojuanlu opened this issue Apr 18, 2020 · 5 comments
Closed

Orbit.from_sbdb raises unhelpful error if no object was found #916

astrojuanlu opened this issue Apr 18, 2020 · 5 comments
Labels
good first issue Easy tasks for beginners triaging:bug

Comments

@astrojuanlu
Copy link
Member

In [9]: Orbit.from_sbdb("67/P")
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-9-75d3da3ffd57> in <module>
----> 1 Orbit.from_sbdb("67/P")

~/.pyenv/versions/poliastro37_4/lib/python3.7/site-packages/poliastro/twobody/orbit.py in from_sbdb(cls, name, **kargs)
    572             )
    573 
--> 574         a = obj["orbit"]["elements"]["a"].to(u.AU) * u.AU
    575         ecc = float(obj["orbit"]["elements"]["e"]) * u.one
    576         inc = obj["orbit"]["elements"]["i"].to(u.deg) * u.deg

KeyError: 'orbit'

It should give something more meaningful, like ValueError("Object 67/P not found")

@astrojuanlu astrojuanlu added triaging:bug good first issue Easy tasks for beginners labels Apr 18, 2020
@priyanshurohilla

This comment has been minimized.

@priyanshurohilla

This comment has been minimized.

@astrojuanlu

This comment has been minimized.

@priyanshurohilla

This comment has been minimized.

@astrojuanlu
Copy link
Member Author

Fixed in #919!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Easy tasks for beginners triaging:bug
Projects
None yet
Development

No branches or pull requests

2 participants