Poliastro: Orbit.from_sbdb raises unhelpful error if no object was found

Created on 18 Apr 2020  路  5Comments  路  Source: poliastro/poliastro

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")

bug good first issue

All 5 comments

I am on it

@iamabhishek0 I was working on it.:)

@priyanshurohilla As per my comment from 15 days ago:

On the other hand, it gives the impression that others should refrain to work on the issue, which is wrong.

I will be more explicit this time: blocking issues this way is not the correct attitude. Please refrain from doing so in the future.

@priyanshurohilla As per my comment from 15 days ago:

On the other hand, it gives the impression that others should refrain to work on the issue, which is wrong.

I will be more explicit this time: blocking issues this way is not the correct attitude. Please refrain from doing so in the future.

@astrojuanlu understood.. Won't happen from now onwards 馃槉

Fixed in #919!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fanxinxing picture fanxinxing  路  3Comments

Yash-10 picture Yash-10  路  3Comments

ana-cp picture ana-cp  路  3Comments

astrojuanlu picture astrojuanlu  路  7Comments

astrojuanlu picture astrojuanlu  路  4Comments